]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix conflict in images vocab
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 5 Mar 2009 03:43:56 +0000 (21:43 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 5 Mar 2009 03:43:56 +0000 (21:43 -0600)
636 files changed:
Factor.app/Contents/Resources/English.lproj/Factor.nib/classes.nib
Factor.app/Contents/Resources/English.lproj/Factor.nib/info.nib
Factor.app/Contents/Resources/English.lproj/Factor.nib/keyedobjects.nib
README.txt
basis/alien/destructors/authors.txt [new file with mode: 0644]
basis/alien/destructors/destructors-tests.factor [new file with mode: 0644]
basis/alien/destructors/destructors.factor [new file with mode: 0644]
basis/alien/destructors/summary.txt [new file with mode: 0644]
basis/alien/syntax/syntax.factor
basis/bootstrap/ui/tools/tools.factor
basis/bootstrap/ui/ui.factor [changed mode: 0644->0755]
basis/cache/authors.txt [new file with mode: 0644]
basis/cache/cache-tests.factor [new file with mode: 0644]
basis/cache/cache.factor [new file with mode: 0644]
basis/cache/summary.txt [new file with mode: 0644]
basis/cache/tags.txt [new file with mode: 0644]
basis/cairo/authors.txt
basis/cairo/cairo-tests.factor [new file with mode: 0644]
basis/cairo/cairo.factor
basis/cairo/ffi/ffi.factor
basis/cairo/gadgets/gadgets.factor
basis/cocoa/application/application-docs.factor
basis/cocoa/application/application.factor
basis/cocoa/cocoa-docs.factor
basis/cocoa/cocoa-tests.factor
basis/cocoa/enumeration/enumeration.factor
basis/cocoa/messages/messages.factor
basis/cocoa/pasteboard/pasteboard.factor
basis/cocoa/plists/plists-tests.factor [new file with mode: 0644]
basis/cocoa/plists/plists.factor
basis/cocoa/subclassing/subclassing.factor
basis/cocoa/types/types-docs.factor [deleted file]
basis/cocoa/types/types.factor
basis/cocoa/views/views.factor
basis/colors/colors-docs.factor [new file with mode: 0644]
basis/colors/colors.factor
basis/colors/constants/constants-docs.factor [new file with mode: 0644]
basis/colors/constants/constants.factor
basis/colors/gray/gray-docs.factor [new file with mode: 0644]
basis/colors/gray/gray.factor
basis/colors/hsv/hsv-docs.factor [new file with mode: 0644]
basis/colors/hsv/hsv-tests.factor
basis/colors/hsv/hsv.factor
basis/compiler/cfg/intrinsics/fixnum/fixnum.factor
basis/compiler/cfg/intrinsics/slots/slots.factor
basis/compiler/cfg/linear-scan/allocation/allocation.factor
basis/compiler/tree/dead-code/simple/simple.factor
basis/core-foundation/attributed-strings/attributed-strings-tests.factor [new file with mode: 0644]
basis/core-foundation/attributed-strings/attributed-strings.factor [new file with mode: 0644]
basis/core-foundation/attributed-strings/authors.txt [new file with mode: 0644]
basis/core-foundation/core-foundation.factor
basis/core-foundation/data/data.factor
basis/core-foundation/dictionaries/authors.txt [new file with mode: 0644]
basis/core-foundation/dictionaries/dictionaries-tests.factor [new file with mode: 0644]
basis/core-foundation/dictionaries/dictionaries.factor [new file with mode: 0644]
basis/core-foundation/dictionaries/tags.txt [new file with mode: 0644]
basis/core-foundation/numbers/authors.txt [new file with mode: 0644]
basis/core-foundation/numbers/numbers-tests.factor [new file with mode: 0644]
basis/core-foundation/numbers/numbers.factor [new file with mode: 0644]
basis/core-foundation/numbers/tags.txt [new file with mode: 0644]
basis/core-foundation/run-loop/run-loop.factor
basis/core-foundation/strings/strings-tests.factor
basis/core-foundation/strings/strings.factor
basis/core-foundation/summary.txt
basis/core-foundation/utilities/authors.txt [new file with mode: 0644]
basis/core-foundation/utilities/tags.txt [new file with mode: 0644]
basis/core-foundation/utilities/utilities-tests.factor [new file with mode: 0644]
basis/core-foundation/utilities/utilities.factor [new file with mode: 0644]
basis/core-graphics/authors.txt [new file with mode: 0644]
basis/core-graphics/core-graphics-docs.factor [new file with mode: 0644]
basis/core-graphics/core-graphics-tests.factor [new file with mode: 0644]
basis/core-graphics/core-graphics.factor [new file with mode: 0644]
basis/core-graphics/summary.txt [new file with mode: 0644]
basis/core-graphics/tags.txt [new file with mode: 0644]
basis/core-graphics/types/authors.txt [new file with mode: 0644]
basis/core-graphics/types/types-docs.factor [new file with mode: 0644]
basis/core-graphics/types/types-tests.factor [new file with mode: 0644]
basis/core-graphics/types/types.factor [new file with mode: 0644]
basis/core-text/authors.txt [new file with mode: 0644]
basis/core-text/core-text-tests.factor [new file with mode: 0644]
basis/core-text/core-text.factor [new file with mode: 0644]
basis/core-text/fonts/authors.txt [new file with mode: 0644]
basis/core-text/fonts/fonts-tests.factor [new file with mode: 0644]
basis/core-text/fonts/fonts.factor [new file with mode: 0644]
basis/core-text/summary.txt [new file with mode: 0644]
basis/core-text/tags.txt [new file with mode: 0644]
basis/core-text/utilities/authors.txt [new file with mode: 0644]
basis/core-text/utilities/utilities-tests.factor [new file with mode: 0644]
basis/core-text/utilities/utilities.factor [new file with mode: 0644]
basis/debugger/debugger.factor
basis/definitions/icons/authors.txt [new file with mode: 0644]
basis/definitions/icons/class-predicate-word.tiff [new file with mode: 0644]
basis/definitions/icons/class-word.tiff [new file with mode: 0644]
basis/definitions/icons/constant-word.tiff [new file with mode: 0644]
basis/definitions/icons/generic-word.tiff [new file with mode: 0644]
basis/definitions/icons/help-article.tiff [new file with mode: 0644]
basis/definitions/icons/icons-tests.factor [new file with mode: 0644]
basis/definitions/icons/icons.factor [new file with mode: 0644]
basis/definitions/icons/macro-word.tiff [new file with mode: 0644]
basis/definitions/icons/normal-word.tiff [new file with mode: 0644]
basis/definitions/icons/open-vocab.tiff [new file with mode: 0644]
basis/definitions/icons/parsing-word.tiff [new file with mode: 0644]
basis/definitions/icons/primitive-word.tiff [new file with mode: 0644]
basis/definitions/icons/runnable-vocab.tiff [new file with mode: 0644]
basis/definitions/icons/symbol-word.tiff [new file with mode: 0644]
basis/definitions/icons/unopen-vocab.tiff [new file with mode: 0644]
basis/definitions/icons/word-help-article.tiff [new file with mode: 0644]
basis/delegate/delegate-tests.factor
basis/delegate/delegate.factor
basis/delegate/protocols/protocols.factor
basis/documents/documents-docs.factor
basis/documents/documents-tests.factor
basis/documents/documents.factor
basis/documents/elements/authors.txt [new file with mode: 0644]
basis/documents/elements/elements-docs.factor [new file with mode: 0644]
basis/documents/elements/elements-tests.factor [new file with mode: 0644]
basis/documents/elements/elements.factor [new file with mode: 0644]
basis/fonts/authors.txt [new file with mode: 0644]
basis/fonts/fonts-docs.factor [new file with mode: 0644]
basis/fonts/fonts-tests.factor [new file with mode: 0644]
basis/fonts/fonts.factor [new file with mode: 0644]
basis/fonts/summary.txt [new file with mode: 0644]
basis/freetype/authors.txt [deleted file]
basis/freetype/freetype.factor [deleted file]
basis/freetype/summary.txt [deleted file]
basis/freetype/tags.txt [deleted file]
basis/generalizations/generalizations.factor
basis/glib/authors.txt [new file with mode: 0644]
basis/glib/glib.factor [new file with mode: 0755]
basis/glib/summary.txt [new file with mode: 0644]
basis/glib/tags.txt [new file with mode: 0644]
basis/hash2/hash2-tests.factor
basis/hash2/hash2.factor
basis/heaps/heaps.factor
basis/help/cookbook/cookbook.factor
basis/help/crossref/crossref-tests.factor
basis/help/crossref/crossref.factor
basis/help/handbook/handbook.factor
basis/help/help-docs.factor
basis/help/help.factor
basis/help/markup/markup-tests.factor
basis/help/markup/markup.factor
basis/help/stylesheet/stylesheet.factor
basis/help/topics/topics.factor
basis/help/tutorial/tutorial.factor
basis/html/streams/streams-tests.factor
basis/html/streams/streams.factor
basis/html/templates/chloe/syntax/syntax.factor
basis/images/images.factor
basis/images/memory/authors.txt [new file with mode: 0644]
basis/images/memory/memory.factor [new file with mode: 0644]
basis/inspector/inspector-docs.factor
basis/inspector/inspector-tests.factor
basis/inspector/inspector.factor
basis/interval-maps/interval-maps.factor
basis/io/encodings/japanese/CP932.TXT [new file with mode: 0644]
basis/io/launcher/unix/unix.factor
basis/io/sockets/secure/openssl/openssl.factor
basis/io/streams/duplex/duplex.factor
basis/io/streams/string/authors.txt [new file with mode: 0644]
basis/io/streams/string/string-docs.factor [new file with mode: 0644]
basis/io/streams/string/string-tests.factor [new file with mode: 0644]
basis/io/streams/string/string.factor [new file with mode: 0644]
basis/io/streams/string/summary.txt [new file with mode: 0644]
basis/io/styles/styles-docs.factor
basis/io/styles/styles.factor
basis/libc/libc.factor
basis/listener/listener.factor
basis/math/complex/complex-docs.factor
basis/math/complex/complex.factor
basis/math/functions/functions.factor
basis/math/geometry/geometry.factor [deleted file]
basis/math/geometry/rect/rect-docs.factor [deleted file]
basis/math/geometry/rect/rect-tests.factor [deleted file]
basis/math/geometry/rect/rect.factor [deleted file]
basis/math/intervals/intervals.factor
basis/math/partial-dispatch/partial-dispatch.factor
basis/math/ratios/ratios.factor
basis/math/rectangles/positioning/authors.txt [new file with mode: 0644]
basis/math/rectangles/positioning/positioning-tests.factor [new file with mode: 0644]
basis/math/rectangles/positioning/positioning.factor [new file with mode: 0644]
basis/math/rectangles/rectangles-docs.factor [new file with mode: 0644]
basis/math/rectangles/rectangles-tests.factor [new file with mode: 0644]
basis/math/rectangles/rectangles.factor [new file with mode: 0644]
basis/math/statistics/statistics.factor
basis/math/vectors/vectors.factor
basis/models/arrow/arrow-docs.factor [new file with mode: 0644]
basis/models/arrow/arrow-tests.factor [new file with mode: 0644]
basis/models/arrow/arrow.factor [new file with mode: 0644]
basis/models/arrow/summary.txt [new file with mode: 0644]
basis/models/compose/compose-docs.factor [deleted file]
basis/models/compose/compose-tests.factor [deleted file]
basis/models/compose/compose.factor [deleted file]
basis/models/compose/summary.txt [deleted file]
basis/models/delay/delay-docs.factor
basis/models/filter/filter-docs.factor [deleted file]
basis/models/filter/filter-tests.factor [deleted file]
basis/models/filter/filter.factor [deleted file]
basis/models/filter/summary.txt [deleted file]
basis/models/models-docs.factor
basis/models/models-tests.factor
basis/models/models.factor
basis/models/product/product-docs.factor [new file with mode: 0644]
basis/models/product/product-tests.factor [new file with mode: 0644]
basis/models/product/product.factor [new file with mode: 0644]
basis/models/product/summary.txt [new file with mode: 0644]
basis/models/range/range-docs.factor
basis/models/range/range.factor
basis/models/search/search.factor [new file with mode: 0644]
basis/models/sort/sort.factor [new file with mode: 0644]
basis/opengl/gl/gl-docs.factor
basis/opengl/opengl-docs.factor
basis/opengl/opengl.factor
basis/opengl/textures/authors.txt [new file with mode: 0644]
basis/opengl/textures/textures-docs.factor [new file with mode: 0644]
basis/opengl/textures/textures-tests.factor [new file with mode: 0644]
basis/opengl/textures/textures.factor [new file with mode: 0644]
basis/pango/cairo/authors.txt [new file with mode: 0644]
basis/pango/cairo/cairo.factor [new file with mode: 0644]
basis/pango/fonts/authors.txt [new file with mode: 0644]
basis/pango/fonts/fonts.factor [new file with mode: 0644]
basis/pango/fonts/tags.txt [new file with mode: 0644]
basis/pango/layouts/layouts-tests.factor [new file with mode: 0644]
basis/pango/layouts/layouts.factor [new file with mode: 0644]
basis/pango/pango.factor [new file with mode: 0644]
basis/present/present-tests.factor [new file with mode: 0644]
basis/present/present.factor
basis/prettyprint/prettyprint.factor
basis/random/random.factor
basis/stack-checker/transforms/transforms.factor
basis/strings/tables/authors.txt [new file with mode: 0644]
basis/strings/tables/tables-tests.factor [new file with mode: 0644]
basis/strings/tables/tables.factor [new file with mode: 0644]
basis/tools/apropos/apropos-docs.factor [new file with mode: 0644]
basis/tools/apropos/apropos-tests.factor [new file with mode: 0644]
basis/tools/apropos/apropos.factor [new file with mode: 0644]
basis/tools/completion/completion.factor
basis/tools/crossref/crossref-docs.factor
basis/tools/crossref/crossref.factor
basis/tools/deploy/macosx/macosx.factor
basis/tools/memory/memory.factor
basis/tools/profiler/profiler-docs.factor
basis/tools/profiler/profiler.factor
basis/tools/test/tools.factor [deleted file]
basis/tools/test/ui/ui.factor
basis/tools/vocabs/browser/browser-docs.factor
basis/tools/vocabs/browser/browser-tests.factor
basis/tools/vocabs/browser/browser.factor
basis/tools/walker/walker.factor
basis/ui/backend/backend.factor
basis/ui/backend/cocoa/authors.txt [new file with mode: 0644]
basis/ui/backend/cocoa/cocoa.factor [new file with mode: 0755]
basis/ui/backend/cocoa/summary.txt [new file with mode: 0644]
basis/ui/backend/cocoa/tags.txt [new file with mode: 0644]
basis/ui/backend/cocoa/tools/authors.txt [new file with mode: 0644]
basis/ui/backend/cocoa/tools/summary.txt [new file with mode: 0644]
basis/ui/backend/cocoa/tools/tags.txt [new file with mode: 0644]
basis/ui/backend/cocoa/tools/tools.factor [new file with mode: 0644]
basis/ui/backend/cocoa/views/authors.txt [new file with mode: 0644]
basis/ui/backend/cocoa/views/summary.txt [new file with mode: 0644]
basis/ui/backend/cocoa/views/tags.txt [new file with mode: 0644]
basis/ui/backend/cocoa/views/views-tests.factor [new file with mode: 0644]
basis/ui/backend/cocoa/views/views.factor [new file with mode: 0644]
basis/ui/backend/windows/authors.txt [new file with mode: 0755]
basis/ui/backend/windows/tags.txt [new file with mode: 0644]
basis/ui/backend/windows/windows.factor [new file with mode: 0755]
basis/ui/backend/x11/authors.txt [new file with mode: 0755]
basis/ui/backend/x11/tags.txt [new file with mode: 0644]
basis/ui/backend/x11/x11.factor [new file with mode: 0755]
basis/ui/baseline-alignment/authors.txt [new file with mode: 0644]
basis/ui/baseline-alignment/baseline-alignment-tests.factor [new file with mode: 0644]
basis/ui/baseline-alignment/baseline-alignment.factor [new file with mode: 0644]
basis/ui/cocoa/authors.txt [deleted file]
basis/ui/cocoa/cocoa.factor [deleted file]
basis/ui/cocoa/summary.txt [deleted file]
basis/ui/cocoa/tags.txt [deleted file]
basis/ui/cocoa/tools/authors.txt [deleted file]
basis/ui/cocoa/tools/summary.txt [deleted file]
basis/ui/cocoa/tools/tags.txt [deleted file]
basis/ui/cocoa/tools/tools.factor [deleted file]
basis/ui/cocoa/views/authors.txt [deleted file]
basis/ui/cocoa/views/summary.txt [deleted file]
basis/ui/cocoa/views/tags.txt [deleted file]
basis/ui/cocoa/views/views-tests.factor [deleted file]
basis/ui/cocoa/views/views.factor [deleted file]
basis/ui/commands/commands-docs.factor
basis/ui/commands/commands-tests.factor
basis/ui/commands/commands.factor
basis/ui/event-loop/event-loop.factor [changed mode: 0644->0755]
basis/ui/freetype/authors.txt [deleted file]
basis/ui/freetype/freetype-docs.factor [deleted file]
basis/ui/freetype/freetype.factor [deleted file]
basis/ui/freetype/summary.txt [deleted file]
basis/ui/gadgets/books/books-docs.factor
basis/ui/gadgets/books/books.factor
basis/ui/gadgets/borders/borders-docs.factor
basis/ui/gadgets/borders/borders-tests.factor
basis/ui/gadgets/borders/borders.factor
basis/ui/gadgets/buttons/buttons-docs.factor
basis/ui/gadgets/buttons/buttons-tests.factor
basis/ui/gadgets/buttons/buttons.factor
basis/ui/gadgets/canvas/canvas.factor
basis/ui/gadgets/debug/authors.txt [new file with mode: 0644]
basis/ui/gadgets/debug/debug-tests.factor [new file with mode: 0644]
basis/ui/gadgets/debug/debug.factor [new file with mode: 0644]
basis/ui/gadgets/editors/editors-docs.factor
basis/ui/gadgets/editors/editors-tests.factor
basis/ui/gadgets/editors/editors.factor
basis/ui/gadgets/frames/frames-docs.factor
basis/ui/gadgets/frames/frames-tests.factor
basis/ui/gadgets/frames/frames.factor
basis/ui/gadgets/gadgets-docs.factor
basis/ui/gadgets/gadgets-tests.factor
basis/ui/gadgets/gadgets.factor
basis/ui/gadgets/glass/glass-tests.factor [new file with mode: 0644]
basis/ui/gadgets/glass/glass.factor [new file with mode: 0644]
basis/ui/gadgets/grid-lines/grid-lines-docs.factor
basis/ui/gadgets/grid-lines/grid-lines-tests.factor [new file with mode: 0644]
basis/ui/gadgets/grid-lines/grid-lines.factor
basis/ui/gadgets/grids/grids-docs.factor
basis/ui/gadgets/grids/grids-tests.factor
basis/ui/gadgets/grids/grids.factor
basis/ui/gadgets/icons/authors.txt [new file with mode: 0644]
basis/ui/gadgets/icons/icons.factor [new file with mode: 0644]
basis/ui/gadgets/incremental/incremental.factor
basis/ui/gadgets/labeled/authors.txt [new file with mode: 0644]
basis/ui/gadgets/labeled/labeled-docs.factor [new file with mode: 0644]
basis/ui/gadgets/labeled/labeled.factor [new file with mode: 0644]
basis/ui/gadgets/labeled/summary.txt [new file with mode: 0644]
basis/ui/gadgets/labelled/authors.txt [deleted file]
basis/ui/gadgets/labelled/labelled-docs.factor [deleted file]
basis/ui/gadgets/labelled/labelled.factor [deleted file]
basis/ui/gadgets/labelled/summary.txt [deleted file]
basis/ui/gadgets/labels/labels-docs.factor
basis/ui/gadgets/labels/labels.factor
basis/ui/gadgets/line-support/authors.txt [new file with mode: 0644]
basis/ui/gadgets/line-support/line-support-docs.factor [new file with mode: 0644]
basis/ui/gadgets/line-support/line-support-tests.factor [new file with mode: 0644]
basis/ui/gadgets/line-support/line-support.factor [new file with mode: 0644]
basis/ui/gadgets/line-support/summary.txt [new file with mode: 0644]
basis/ui/gadgets/lists/authors.txt [deleted file]
basis/ui/gadgets/lists/lists-docs.factor [deleted file]
basis/ui/gadgets/lists/lists-tests.factor [deleted file]
basis/ui/gadgets/lists/lists.factor [deleted file]
basis/ui/gadgets/lists/summary.txt [deleted file]
basis/ui/gadgets/menus/menus.factor
basis/ui/gadgets/packs/packs-docs.factor
basis/ui/gadgets/packs/packs-tests.factor
basis/ui/gadgets/packs/packs.factor
basis/ui/gadgets/panes/panes-docs.factor
basis/ui/gadgets/panes/panes-tests.factor
basis/ui/gadgets/panes/panes.factor
basis/ui/gadgets/paragraphs/paragraphs-tests.factor [new file with mode: 0644]
basis/ui/gadgets/paragraphs/paragraphs.factor
basis/ui/gadgets/presentations/presentations-docs.factor
basis/ui/gadgets/presentations/presentations.factor
basis/ui/gadgets/scrollers/scrollers-docs.factor
basis/ui/gadgets/scrollers/scrollers-tests.factor
basis/ui/gadgets/scrollers/scrollers.factor
basis/ui/gadgets/search-tables/search-tables.factor [new file with mode: 0644]
basis/ui/gadgets/sliders/sliders-docs.factor
basis/ui/gadgets/sliders/sliders.factor
basis/ui/gadgets/slots/slots-tests.factor
basis/ui/gadgets/slots/slots.factor
basis/ui/gadgets/status-bar/status-bar-docs.factor
basis/ui/gadgets/status-bar/status-bar.factor
basis/ui/gadgets/tabbed/tabbed.factor [new file with mode: 0644]
basis/ui/gadgets/tables/tables-docs.factor [new file with mode: 0644]
basis/ui/gadgets/tables/tables-tests.factor [new file with mode: 0644]
basis/ui/gadgets/tables/tables.factor [new file with mode: 0644]
basis/ui/gadgets/theme/active-tab-left.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/active-tab-lip.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/active-tab-middle.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/active-tab-right.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/button-clicked-left.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/button-clicked-middle.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/button-clicked-right.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/button-left.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/button-middle.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/button-right.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/checkbox-clicked.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/checkbox-set-clicked.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/checkbox-set.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/checkbox.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/clear-button-clicked.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/clear-button.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/horizontal-scroller-handle-grip.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/horizontal-scroller-handle-left.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/horizontal-scroller-handle-middle.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/horizontal-scroller-handle-right.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/horizontal-scroller-left.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/horizontal-scroller-leftarrow-clicked.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/horizontal-scroller-middle.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/horizontal-scroller-right-disabled.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/horizontal-scroller-right.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/horizontal-scroller-rightarrow-clicked.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/inactive-tab-left.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/inactive-tab-middle.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/inactive-tab-right.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/labeled-block-bottom-left.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/labeled-block-bottom-middle.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/labeled-block-bottom-right.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/labeled-block-left-edge.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/labeled-block-right-edge.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/labeled-block-title-left.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/labeled-block-title-middle.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/labeled-block-title-right.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/radio-clicked.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/radio-set-clicked.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/radio-set.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/radio.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/theme.factor [deleted file]
basis/ui/gadgets/theme/vertical-scroller-bottom-disabled.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/vertical-scroller-bottom.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/vertical-scroller-downarrow-clicked.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/vertical-scroller-handle-bottom.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/vertical-scroller-handle-grip.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/vertical-scroller-handle-middle.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/vertical-scroller-handle-top.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/vertical-scroller-middle.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/vertical-scroller-top.tiff [new file with mode: 0644]
basis/ui/gadgets/theme/vertical-scroller-uparrow-clicked.tiff [new file with mode: 0644]
basis/ui/gadgets/tracks/tracks-docs.factor
basis/ui/gadgets/tracks/tracks-tests.factor
basis/ui/gadgets/tracks/tracks.factor
basis/ui/gadgets/viewports/viewports.factor
basis/ui/gadgets/worlds/worlds-docs.factor
basis/ui/gadgets/worlds/worlds-tests.factor
basis/ui/gadgets/worlds/worlds.factor
basis/ui/gadgets/wrappers/wrappers.factor
basis/ui/gestures/gestures-docs.factor
basis/ui/gestures/gestures-tests.factor [new file with mode: 0644]
basis/ui/gestures/gestures.factor
basis/ui/images/authors.txt [new file with mode: 0644]
basis/ui/images/images-tests.factor [new file with mode: 0644]
basis/ui/images/images.factor [new file with mode: 0644]
basis/ui/operations/operations-docs.factor
basis/ui/operations/operations-tests.factor
basis/ui/operations/operations.factor
basis/ui/pens/authors.txt [new file with mode: 0644]
basis/ui/pens/caching/authors.txt [new file with mode: 0644]
basis/ui/pens/caching/caching-tests.factor [new file with mode: 0644]
basis/ui/pens/caching/caching.factor [new file with mode: 0644]
basis/ui/pens/gradient/authors.txt [new file with mode: 0644]
basis/ui/pens/gradient/gradient-docs.factor [new file with mode: 0644]
basis/ui/pens/gradient/gradient-tests.factor [new file with mode: 0644]
basis/ui/pens/gradient/gradient.factor [new file with mode: 0644]
basis/ui/pens/image/authors.txt [new file with mode: 0644]
basis/ui/pens/image/image-tests.factor [new file with mode: 0644]
basis/ui/pens/image/image.factor [new file with mode: 0644]
basis/ui/pens/pens-docs.factor [new file with mode: 0644]
basis/ui/pens/pens-tests.factor [new file with mode: 0644]
basis/ui/pens/pens.factor [new file with mode: 0644]
basis/ui/pens/polygon/authors.txt [new file with mode: 0644]
basis/ui/pens/polygon/polygon-docs.factor [new file with mode: 0644]
basis/ui/pens/polygon/polygon-tests.factor [new file with mode: 0644]
basis/ui/pens/polygon/polygon.factor [new file with mode: 0644]
basis/ui/pens/solid/authors.txt [new file with mode: 0644]
basis/ui/pens/solid/solid-docs.factor [new file with mode: 0644]
basis/ui/pens/solid/solid-tests.factor [new file with mode: 0644]
basis/ui/pens/solid/solid.factor [new file with mode: 0644]
basis/ui/pens/tile/authors.txt [new file with mode: 0644]
basis/ui/pens/tile/tile-tests.factor [new file with mode: 0644]
basis/ui/pens/tile/tile.factor [new file with mode: 0644]
basis/ui/render/render-docs.factor
basis/ui/render/render-tests.factor [new file with mode: 0644]
basis/ui/render/render.factor
basis/ui/text/authors.txt [new file with mode: 0644]
basis/ui/text/core-text/authors.txt [new file with mode: 0644]
basis/ui/text/core-text/core-text.factor [new file with mode: 0644]
basis/ui/text/core-text/summary.txt [new file with mode: 0644]
basis/ui/text/core-text/tags.txt [new file with mode: 0644]
basis/ui/text/pango/authors.txt [new file with mode: 0644]
basis/ui/text/pango/pango.factor [new file with mode: 0755]
basis/ui/text/text-docs.factor [new file with mode: 0644]
basis/ui/text/text-tests.factor [new file with mode: 0644]
basis/ui/text/text.factor [new file with mode: 0644]
basis/ui/tools/browser/browser-docs.factor [new file with mode: 0644]
basis/ui/tools/browser/browser-tests.factor
basis/ui/tools/browser/browser.factor
basis/ui/tools/browser/popups/authors.txt [new file with mode: 0644]
basis/ui/tools/browser/popups/popups.factor [new file with mode: 0644]
basis/ui/tools/common/common.factor [new file with mode: 0644]
basis/ui/tools/debugger/debugger-docs.factor
basis/ui/tools/debugger/debugger.factor
basis/ui/tools/deploy/deploy.factor
basis/ui/tools/inspector/inspector-docs.factor [new file with mode: 0644]
basis/ui/tools/inspector/inspector-tests.factor [new file with mode: 0644]
basis/ui/tools/inspector/inspector.factor
basis/ui/tools/interactor/authors.txt [deleted file]
basis/ui/tools/interactor/interactor-docs.factor [deleted file]
basis/ui/tools/interactor/interactor-tests.factor [deleted file]
basis/ui/tools/interactor/interactor.factor [deleted file]
basis/ui/tools/interactor/summary.txt [deleted file]
basis/ui/tools/listener/completion/authors.txt [new file with mode: 0644]
basis/ui/tools/listener/completion/completion-tests.factor [new file with mode: 0644]
basis/ui/tools/listener/completion/completion.factor [new file with mode: 0644]
basis/ui/tools/listener/history/authors.txt [new file with mode: 0644]
basis/ui/tools/listener/history/history-tests.factor [new file with mode: 0644]
basis/ui/tools/listener/history/history.factor [new file with mode: 0644]
basis/ui/tools/listener/listener-docs.factor [new file with mode: 0644]
basis/ui/tools/listener/listener-tests.factor
basis/ui/tools/listener/listener.factor
basis/ui/tools/listener/popups/authors.txt [new file with mode: 0644]
basis/ui/tools/listener/popups/popups-tests.factor [new file with mode: 0644]
basis/ui/tools/listener/popups/popups.factor [new file with mode: 0644]
basis/ui/tools/operations/operations.factor
basis/ui/tools/profiler/profiler.factor
basis/ui/tools/search/authors.txt [deleted file]
basis/ui/tools/search/search-tests.factor [deleted file]
basis/ui/tools/search/search.factor [deleted file]
basis/ui/tools/search/summary.txt [deleted file]
basis/ui/tools/tools-docs.factor
basis/ui/tools/tools-tests.factor [deleted file]
basis/ui/tools/tools.factor
basis/ui/tools/traceback/traceback.factor
basis/ui/tools/walker/walker-docs.factor
basis/ui/tools/walker/walker.factor
basis/ui/tools/workspace/authors.txt [deleted file]
basis/ui/tools/workspace/summary.txt [deleted file]
basis/ui/tools/workspace/tags.txt [deleted file]
basis/ui/tools/workspace/workspace-tests.factor [deleted file]
basis/ui/tools/workspace/workspace.factor [deleted file]
basis/ui/traverse/traverse.factor
basis/ui/ui-docs.factor
basis/ui/ui-tests.factor
basis/ui/ui.factor
basis/ui/windows/authors.txt [deleted file]
basis/ui/windows/tags.txt [deleted file]
basis/ui/windows/windows.factor [deleted file]
basis/ui/x11/authors.txt [deleted file]
basis/ui/x11/tags.txt [deleted file]
basis/unicode/normalize/normalize.factor
basis/validators/validators.factor
basis/windows/com/com.factor
basis/windows/com/wrapper/wrapper.factor
basis/x11/windows/windows.factor
basis/xml/tests/xmltest.factor
basis/xml/writer/writer-tests.factor
core/alien/alien-tests.factor
core/alien/alien.factor
core/assocs/assocs.factor
core/classes/tuple/tuple.factor
core/continuations/continuations-tests.factor
core/effects/effects-tests.factor
core/effects/effects.factor
core/generic/math/math.factor
core/graphs/graphs.factor
core/io/encodings/encodings.factor
core/io/encodings/utf8/utf8-tests.factor [changed mode: 0644->0755]
core/io/encodings/utf8/utf8.factor [changed mode: 0644->0755]
core/io/pathnames/pathnames-docs.factor
core/io/streams/string/authors.txt [deleted file]
core/io/streams/string/string-docs.factor [deleted file]
core/io/streams/string/string-tests.factor [deleted file]
core/io/streams/string/string.factor [deleted file]
core/io/streams/string/summary.txt [deleted file]
core/kernel/kernel-docs.factor
core/lexer/lexer.factor
core/make/make-docs.factor
core/math/integers/integers.factor
core/math/math.factor
core/namespaces/namespaces-tests.factor
core/namespaces/namespaces.factor
core/parser/parser.factor
core/sequences/sequences-docs.factor
core/sequences/sequences-tests.factor
core/sequences/sequences.factor
core/slots/slots-docs.factor
core/sorting/sorting.factor
core/source-files/source-files.factor
core/splitting/splitting.factor
core/syntax/syntax-docs.factor
core/words/words.factor
extra/boids/boids.factor
extra/color-picker/color-picker.factor
extra/color-table/authors.txt [new file with mode: 0644]
extra/color-table/color-table-tests.factor [new file with mode: 0644]
extra/color-table/color-table.factor [new file with mode: 0644]
extra/color-table/tags.txt [new file with mode: 0644]
extra/freetype/authors.txt [new file with mode: 0644]
extra/freetype/freetype.factor [new file with mode: 0644]
extra/freetype/summary.txt [new file with mode: 0644]
extra/freetype/tags.txt [new file with mode: 0644]
extra/game-input/dinput/dinput.factor
extra/gesture-logger/gesture-logger.factor
extra/hello-unicode/authors.txt [new file with mode: 0644]
extra/hello-unicode/hello-unicode-tests.factor [new file with mode: 0644]
extra/hello-unicode/hello-unicode.factor [new file with mode: 0644]
extra/hello-unicode/summary.txt [new file with mode: 0644]
extra/hello-unicode/tags.txt [new file with mode: 0644]
extra/images/viewer/viewer.factor
extra/iokit/hid/hid.factor
extra/iokit/iokit.factor
extra/joystick-demo/joystick-demo.factor
extra/key-caps/key-caps.factor
extra/lcd/lcd.factor
extra/maze/maze.factor
extra/nehe/2/2.factor
extra/nehe/3/3.factor
extra/nehe/4/4.factor
extra/nehe/5/5.factor
extra/opengl/demo-support/demo-support.factor
extra/quadtrees/quadtrees-docs.factor
extra/quadtrees/quadtrees-tests.factor
extra/quadtrees/quadtrees.factor
extra/slides/slides.factor
extra/tetris/tetris.factor
extra/ui/gadgets/broken/broken.factor [deleted file]
extra/ui/gadgets/lists/authors.txt [new file with mode: 0644]
extra/ui/gadgets/lists/lists-docs.factor [new file with mode: 0644]
extra/ui/gadgets/lists/lists-tests.factor [new file with mode: 0644]
extra/ui/gadgets/lists/lists.factor [new file with mode: 0644]
extra/ui/gadgets/lists/summary.txt [new file with mode: 0644]
extra/ui/gadgets/tabs/tabs.factor
extra/ui/render/test/test.factor
fonts/Vera.ttf [deleted file]
fonts/VeraBI.ttf [deleted file]
fonts/VeraBd.ttf [deleted file]
fonts/VeraIt.ttf [deleted file]
fonts/VeraMoBI.ttf [deleted file]
fonts/VeraMoBd.ttf [deleted file]
fonts/VeraMoIt.ttf [deleted file]
fonts/VeraMono.ttf [deleted file]
fonts/VeraSe.ttf [deleted file]
fonts/VeraSeBd.ttf [deleted file]
unmaintained/pango/cairo/cairo.factor [deleted file]
unmaintained/pango/cairo/gadgets/gadgets.factor [deleted file]
unmaintained/pango/cairo/samples/samples.factor [deleted file]
unmaintained/pango/fonts/fonts.factor [deleted file]
unmaintained/pango/ft2/ft2.factor [deleted file]
unmaintained/pango/ft2/gadgets/gadgets.factor [deleted file]
unmaintained/pango/gadgets/gadgets.factor [deleted file]
unmaintained/pango/layouts/layouts.factor [deleted file]
unmaintained/pango/pango.factor [deleted file]
vm/Config.unix

index bf3d2a65608e45f465b0ee815204720924a36609..6a6eedfcc0caa10bb48691f60a4d49f20208a0ba 100644 (file)
@@ -1,17 +1,38 @@
-{
-    IBClasses = (
-        {
-            ACTIONS = {
-                newFactorWorkspace = id; 
-                runFactorFile = id; 
-                saveFactorImage = id; 
-                saveFactorImageAs = id; 
-                showFactorHelp = id; 
-            }; 
-            CLASS = FirstResponder; 
-            LANGUAGE = ObjC; 
-            SUPERCLASS = NSObject; 
-        }
-    ); 
-    IBVersion = 1; 
-}
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>IBClasses</key>
+       <array>
+               <dict>
+                       <key>ACTIONS</key>
+                       <dict>
+                               <key>factorBrowser</key>
+                               <string>id</string>
+                               <key>factorListener</key>
+                               <string>id</string>
+                               <key>newFactorBrowser</key>
+                               <string>id</string>
+                               <key>newFactorListener</key>
+                               <string>id</string>
+                               <key>refreshAll</key>
+                               <string>id</string>
+                               <key>runFactorFile</key>
+                               <string>id</string>
+                               <key>saveFactorImage</key>
+                               <string>id</string>
+                               <key>saveFactorImageAs</key>
+                               <string>id</string>
+                       </dict>
+                       <key>CLASS</key>
+                       <string>FirstResponder</string>
+                       <key>LANGUAGE</key>
+                       <string>ObjC</string>
+                       <key>SUPERCLASS</key>
+                       <string>NSObject</string>
+               </dict>
+       </array>
+       <key>IBVersion</key>
+       <string>1</string>
+</dict>
+</plist>
index 8e4b9eeba85984431ea1571bae5874dbcbf4e282..1096a1224a31e0aa0314bb31653ebc4153c15373 100644 (file)
@@ -1,21 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-       <key>IBDocumentLocation</key>
-       <string>557 119 525 491 0 0 2560 1578 </string>
-       <key>IBEditorPositions</key>
-       <dict>
-               <key>29</key>
-               <string>326 905 270 44 0 0 2560 1578 </string>
-       </dict>
        <key>IBFramework Version</key>
-       <string>439.0</string>
+       <string>629</string>
+       <key>IBOldestOS</key>
+       <integer>5</integer>
        <key>IBOpenObjects</key>
        <array>
-               <integer>29</integer>
+               <integer>305</integer>
        </array>
        <key>IBSystem Version</key>
-       <string>8R218</string>
+       <string>9G55</string>
+       <key>targetFramework</key>
+       <string>IBCocoaFramework</string>
 </dict>
 </plist>
index 8dfebba5669ffdf8e672731f7d51c4dd3320621d..c30c9e4bfda079b3069b7a323ccf59063fcf199f 100644 (file)
Binary files a/Factor.app/Contents/Resources/English.lproj/Factor.nib/keyedobjects.nib and b/Factor.app/Contents/Resources/English.lproj/Factor.nib/keyedobjects.nib differ
index d60bf03130beda211bb15f8a27383c58f87207cc..dfe70c00f428c5d565ca78d06e9c0d49e3dba370 100755 (executable)
@@ -153,7 +153,6 @@ The Factor source tree is organized as follows:
   core/ - Factor core library
   basis/ - Factor basis library, compiler, tools
   extra/ - more libraries and applications
-  fonts/ - TrueType fonts used by UI
   misc/ - editor modes, icons, etc
   unmaintained/ - unmaintained contributions, please help!
 
diff --git a/basis/alien/destructors/authors.txt b/basis/alien/destructors/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/alien/destructors/destructors-tests.factor b/basis/alien/destructors/destructors-tests.factor
new file mode 100644 (file)
index 0000000..4f43445
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test alien.destructors ;
+IN: alien.destructors.tests
diff --git a/basis/alien/destructors/destructors.factor b/basis/alien/destructors/destructors.factor
new file mode 100644 (file)
index 0000000..6c55528
--- /dev/null
@@ -0,0 +1,29 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: functors destructors accessors kernel parser words ;
+IN: alien.destructors
+
+SLOT: alien
+
+FUNCTOR: define-destructor ( F -- )
+
+F-destructor DEFINES-CLASS ${F}-destructor
+<F-destructor> DEFINES <${F}-destructor>
+&F DEFINES &${F}
+|F DEFINES |${F}
+
+WHERE
+
+TUPLE: F-destructor alien disposed ;
+
+: <F-destructor> ( alien -- destructor ) f F-destructor boa ; inline
+
+M: F-destructor dispose* alien>> F ;
+
+: &F ( alien -- alien ) dup <F-destructor> &dispose drop ; inline
+
+: |F ( alien -- alien ) dup <F-destructor> |dispose drop ; inline
+
+;FUNCTOR
+
+: DESTRUCTOR: scan-word define-destructor ; parsing
\ No newline at end of file
diff --git a/basis/alien/destructors/summary.txt b/basis/alien/destructors/summary.txt
new file mode 100644 (file)
index 0000000..301655b
--- /dev/null
@@ -0,0 +1 @@
+Functor for defining destructors which call a C function to dispose of resources
index bed454e81d1625aac2b335f83c9c1291904ef782..987c73127ee5feddf694a3bed65338920af44225 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2005, 2008 Slava Pestov, Alex Chapman.
+! Copyright (C) 2005, 2009 Slava Pestov, Alex Chapman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays alien alien.c-types alien.structs
 alien.arrays alien.strings kernel math namespaces parser
index a3d02a00166e6872f8db5b56e69241ab9ce89681..5cf05aef91a539723bb8292f7ec1a039066d76de 100644 (file)
@@ -4,8 +4,8 @@ USING: kernel vocabs vocabs.loader sequences system ;
 [ "bootstrap." prepend vocab ] all? [
     "ui.tools" require
 
-    "ui.cocoa" vocab [
-        "ui.cocoa.tools" require
+    "ui.backend.cocoa" vocab [
+        "ui.backend.cocoa.tools" require
     ] when
 
     "ui.tools.walker" require
old mode 100644 (file)
new mode 100755 (executable)
index 0cdf313..4f7f82a
@@ -9,7 +9,13 @@ IN: bootstrap.ui
             { [ os windows? ] [ "windows" ] }
             { [ os unix? ] [ "x11" ] }
         } cond
-    ] unless* "ui." prepend require
+    ] unless* "ui.backend." prepend require
 
-    "ui.freetype" require
+    "ui-text-backend" get [
+        {
+            { [ os macosx? ] [ "core-text" ] }
+            { [ os windows? ] [ "pango" ] }
+            { [ os unix? ] [ "pango" ] }
+        } cond
+    ] unless* "ui.text." prepend require
 ] when
diff --git a/basis/cache/authors.txt b/basis/cache/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/cache/cache-tests.factor b/basis/cache/cache-tests.factor
new file mode 100644 (file)
index 0000000..cbf4f64
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test cache ;
+IN: cache.tests
diff --git a/basis/cache/cache.factor b/basis/cache/cache.factor
new file mode 100644 (file)
index 0000000..f16461b
--- /dev/null
@@ -0,0 +1,43 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel assocs math accessors destructors fry sequences ;
+IN: cache
+
+TUPLE: cache-assoc assoc max-age disposed ;
+
+: <cache-assoc> ( -- cache )
+    H{ } clone 10 f cache-assoc boa ;
+
+<PRIVATE
+
+TUPLE: cache-entry value age ;
+
+: <cache-entry> ( value -- entry ) 0 cache-entry boa ; inline
+
+M: cache-entry dispose value>> dispose ;
+
+M: cache-assoc assoc-size assoc>> assoc-size ;
+
+M: cache-assoc at* assoc>> at* [ dup [ 0 >>age value>> ] when ] dip ;
+
+M: cache-assoc set-at
+    [ check-disposed ] keep
+    [ <cache-entry> ] 2dip
+    assoc>> set-at ;
+
+M: cache-assoc clear-assoc assoc>> clear-assoc ;
+
+M: cache-assoc >alist assoc>> [ value>> ] { } assoc-map-as ;
+
+INSTANCE: cache-assoc assoc
+
+M: cache-assoc dispose*
+    [ values dispose-each ] [ clear-assoc ] bi ;
+
+PRIVATE>
+
+: purge-cache ( cache -- )
+    dup max-age>> '[
+        [ nip [ 1+ ] change-age age>> _ >= ] assoc-partition
+        [ values dispose-each ] dip
+    ] change-assoc drop ;
\ No newline at end of file
diff --git a/basis/cache/summary.txt b/basis/cache/summary.txt
new file mode 100644 (file)
index 0000000..2382bfd
--- /dev/null
@@ -0,0 +1 @@
+An associative mapping whose entries expire after a while
diff --git a/basis/cache/tags.txt b/basis/cache/tags.txt
new file mode 100644 (file)
index 0000000..42d711b
--- /dev/null
@@ -0,0 +1 @@
+collections
index 68d35d192b42a2515c48045af4ab6a419eb0ca2e..4023d08987d487c76440269008a98289bb9936b0 100644 (file)
@@ -1,2 +1,3 @@
 Sampo Vuori
 Doug Coleman
+Slava Pestov
diff --git a/basis/cairo/cairo-tests.factor b/basis/cairo/cairo-tests.factor
new file mode 100644 (file)
index 0000000..bf7c468
--- /dev/null
@@ -0,0 +1,8 @@
+IN: cairo.tests
+USING: cairo tools.test math.rectangles accessors ;
+
+[ { 10 20 } ] [
+    { 10 20 } [
+        { 0 1 } { 3 4 } <rect> fill-rect
+    ] make-bitmap-image dim>>
+] unit-test
\ No newline at end of file
index da7f5a2f320a28bce1582f6467a7c2d0338a7729..3a41f0bcf94af03502c454527c554278e27a6653 100755 (executable)
@@ -1,37 +1,52 @@
 ! Copyright (C) 2008 Doug Coleman.
+! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: cairo.ffi kernel accessors sequences
-namespaces fry continuations destructors ;
+USING: colors fonts cairo.ffi alien alien.c-types kernel accessors
+sequences namespaces fry continuations destructors math images
+images.memory math.rectangles ;
 IN: cairo
 
-TUPLE: cairo-t alien ;
-C: <cairo-t> cairo-t
-M: cairo-t dispose ( alien -- ) alien>> cairo_destroy ;
+ERROR: cairo-error message ;
 
-TUPLE: cairo-surface-t alien ;
-C: <cairo-surface-t> cairo-surface-t
-M: cairo-surface-t dispose ( alien -- ) alien>> cairo_surface_destroy ;
+: (check-cairo) ( cairo_status_t -- )
+    dup CAIRO_STATUS_SUCCESS =
+    [ drop ] [ cairo_status_to_string cairo-error ] if ;
 
-: check-cairo ( cairo_status_t -- )
-    dup CAIRO_STATUS_SUCCESS = [ drop ]
-    [ cairo_status_to_string "Cairo error: " prepend throw ] if ;
+: check-cairo ( cairo -- ) cairo_status (check-cairo) ;
 
-SYMBOL: cairo
-: cr ( -- cairo ) cairo get ; inline
+: check-surface ( surface -- ) cairo_surface_status (check-cairo) ;
 
-: (with-cairo) ( cairo-t quot -- )
-    [ alien>> cairo ] dip
-    '[ @ cr cairo_status check-cairo ]
-    with-variable ; inline
-    
-: with-cairo ( cairo quot -- )
-    [ <cairo-t> ] dip '[ _ (with-cairo) ] with-disposal ; inline
+: width>stride ( width -- stride ) "uint" heap-size * ; inline
 
-: (with-surface) ( cairo-surface-t quot -- )
-    [ alien>> ] dip [ cairo_surface_status check-cairo ] bi ; inline
+: <image-surface> ( data dim -- surface )
+    [ CAIRO_FORMAT_ARGB32 ] dip first2 over width>stride
+    cairo_image_surface_create_for_data
+    dup check-surface ;
 
-: with-surface ( cairo_surface quot -- )
-    [ <cairo-surface-t> ] dip '[ _ (with-surface) ] with-disposal ; inline
+: <cairo> ( surface -- cairo ) cairo_create dup check-cairo ; inline
 
-: with-cairo-from-surface ( cairo_surface quot -- )
-    '[ cairo_create _ with-cairo ] with-surface ; inline
+: make-bitmap-image ( dim quot -- image )
+    '[
+        <image-surface> &cairo_surface_destroy
+        <cairo> &cairo_destroy
+        @
+    ] make-memory-bitmap
+    BGRA >>component-order ; inline
+
+: dummy-cairo ( -- cr )
+    #! Sometimes we want a dummy context; eg with Pango, we want
+    #! to measure text dimensions to create a new image context with,
+    #! but we need an existing context to measure text dimensions
+    #! with so we use the dummy.
+    \ dummy-cairo [
+        CAIRO_FORMAT_ARGB32 0 0 cairo_image_surface_create
+        cairo_create
+    ] initialize-alien ;
+
+: set-source-color ( cr color -- )
+    >rgba-components cairo_set_source_rgba ;
+
+: fill-rect ( cr rect -- )
+    [ rect-bounds [ first2 ] bi@ cairo_rectangle ]
+    [ drop cairo_fill ]
+    2bi ;
index c2daa053741b0b6fe86026200ecd4efb7a8e79d9..e7c0a1766043b600b362d0f33eeb922c7cc3656a 100644 (file)
@@ -4,15 +4,15 @@
 ! Adapted from cairo.h, version 1.5.14
 ! License: http://factorcode.org/license.txt
 
-USING: system combinators alien alien.syntax kernel 
-alien.c-types accessors sequences arrays ui.gadgets ;
+USING: system combinators alien alien.syntax alien.c-types
+alien.destructors kernel accessors sequences arrays ui.gadgets ;
 
 IN: cairo.ffi
-<< "cairo" {
-    { [ os winnt? ] [ "libcairo-2.dll" ] }
-    { [ os macosx? ] [ "/opt/local/lib/libcairo.dylib" ] }
-    { [ os unix? ] [ "libcairo.so.2" ] }
-} cond "cdecl" add-library >>
+<< {
+    { [ os winnt? ] [ "cairo" "libcairo-2.dll" "cdecl" add-library ] }
+    { [ os macosx? ] [ "cairo" "/opt/local/lib/libcairo.dylib" "cdecl" add-library ] }
+    { [ os unix? ] [ ] }
+} cond >>
 
 LIBRARY: cairo
 
@@ -94,6 +94,8 @@ cairo_reference ( cairo_t* cr ) ;
 FUNCTION: void
 cairo_destroy ( cairo_t* cr ) ;
 
+DESTRUCTOR: cairo_destroy
+
 FUNCTION: uint
 cairo_get_reference_count ( cairo_t* cr ) ;
 
@@ -694,6 +696,8 @@ cairo_surface_finish ( cairo_surface_t* surface ) ;
 FUNCTION: void
 cairo_surface_destroy ( cairo_surface_t* surface ) ;
 
+DESTRUCTOR: cairo_surface_destroy
+
 FUNCTION: uint
 cairo_surface_get_reference_count ( cairo_surface_t* surface ) ;
 
index 87942b4c91540b24887039815ebb04f262e671ce..a120f8653919262cfb9e45cb52227a3e1b495b57 100644 (file)
@@ -26,7 +26,7 @@ GENERIC: render-cairo* ( gadget -- )
 TUPLE: cairo-gadget < gadget ;
 
 : <cairo-gadget> ( dim -- gadget )
-    cairo-gadget new-gadget
+    cairo-gadget new
         swap >>dim ;
 
 M: cairo-gadget draw-gadget*
index 60a0232a2cc5ed823884bec79fb71d6c559a9960..a2c711c3ea199d83459680250869f1f0a1a8a0a5 100644 (file)
@@ -8,12 +8,6 @@ HELP: <NSString>
 
 { <NSString> <CFString> CF>string } related-words
 
-HELP: <NSArray>
-{ $values { "seq" "a sequence of " { $link alien } " instances" } { "alien" alien } }
-{ $description "Allocates an autoreleased " { $snippet "CFArray" } "." } ;
-
-{ <NSArray> <CFArray> } related-words
-
 HELP: with-autorelease-pool
 { $values { "quot" quotation } }
 { $description "Sets up a new " { $snippet "NSAutoreleasePool"  } ", calls the quotation and frees the pool." } ;
index 19d83b86d7d5640288d8fa7df9af10c4636bfd21..9437051dad91a1c388b95eb68636ae21e67d3cc5 100644 (file)
@@ -1,27 +1,17 @@
 ! Copyright (C) 2006, 2008 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.syntax io kernel namespaces core-foundation
-core-foundation.arrays core-foundation.data
 core-foundation.strings cocoa.messages cocoa cocoa.classes
 cocoa.runtime sequences threads init summary kernel.private
 assocs ;
 IN: cocoa.application
 
 : <NSString> ( str -- alien ) <CFString> -> autorelease ;
-: <NSArray> ( seq -- alien ) <CFArray> -> autorelease ;
-: <NSNumber> ( number -- alien ) <CFNumber> -> autorelease ;
-: <NSData> ( byte-array -- alien ) <CFData> -> autorelease ;
-: <NSDictionary> ( assoc -- alien )
-    NSMutableDictionary over assoc-size -> dictionaryWithCapacity:
-    [
-        [
-            spin -> setObject:forKey:
-        ] curry assoc-each
-    ] keep ;
 
-CONSTANT: NSApplicationDelegateReplySuccess 0
-CONSTANT: NSApplicationDelegateReplyCancel  1
-CONSTANT: NSApplicationDelegateReplyFailure 2
+C-ENUM:
+NSApplicationDelegateReplySuccess
+NSApplicationDelegateReplyCancel
+NSApplicationDelegateReplyFailure ;
 
 : with-autorelease-pool ( quot -- )
     NSAutoreleasePool -> new slip -> release ; inline
@@ -45,7 +35,8 @@ FUNCTION: void NSBeep ( ) ;
     [ NSNotificationCenter -> defaultCenter ] dip
     -> removeObserver: ;
 
-: cocoa-app ( quot -- ) [ call NSApp -> run ] with-cocoa ; inline
+: cocoa-app ( quot -- )
+    [ call NSApp -> run ] with-cocoa ; inline
 
 : install-delegate ( receiver delegate -- )
     -> alloc -> init -> setDelegate: ;
index dd8d331b35f2f13a3c174f19549c7560e29cb030..17621dc6348ac760190152ebda376e7d7e7131fb 100644 (file)
@@ -44,7 +44,6 @@ $nl
 { $subsection "objc-calling" }
 { $subsection "objc-subclassing" }
 "A utility library is built to faciliate the development of Cocoa applications in Factor:"
-{ $subsection "cocoa-types" }
 { $subsection "cocoa-application-utils" }
 { $subsection "cocoa-dialogs" }
 { $subsection "cocoa-pasteboard-utils" }
index 59ea91c3cfb87bbcca8ec0015ac07f09e35cee85..d77435a8ad21263353f34428b76b549d202dfc38 100644 (file)
@@ -1,7 +1,7 @@
 IN: cocoa.tests
 USING: cocoa cocoa.messages cocoa.subclassing cocoa.types
 compiler kernel namespaces cocoa.classes tools.test memory
-compiler.units math ;
+compiler.units math core-graphics.types ;
 
 CLASS: {
     { +superclass+ "NSObject" }
@@ -15,15 +15,15 @@ CLASS: {
 
 : test-foo
     Foo -> alloc -> init
-    dup 1.0 2.0 101.0 102.0 <NSRect> -> foo:
+    dup 1.0 2.0 101.0 102.0 <CGRect> -> foo:
     -> release ;
 
 test-foo
 
-[ 1.0 ] [ "x" get NSRect-x ] unit-test
-[ 2.0 ] [ "x" get NSRect-y ] unit-test
-[ 101.0 ] [ "x" get NSRect-w ] unit-test
-[ 102.0 ] [ "x" get NSRect-h ] unit-test
+[ 1.0 ] [ "x" get CGRect-x ] unit-test
+[ 2.0 ] [ "x" get CGRect-y ] unit-test
+[ 101.0 ] [ "x" get CGRect-w ] unit-test
+[ 102.0 ] [ "x" get CGRect-h ] unit-test
 
 CLASS: {
     { +superclass+ "NSObject" }
@@ -41,10 +41,10 @@ Bar [
     -> release
 ] compile-call
 
-[ 1.0 ] [ "x" get NSRect-x ] unit-test
-[ 2.0 ] [ "x" get NSRect-y ] unit-test
-[ 101.0 ] [ "x" get NSRect-w ] unit-test
-[ 102.0 ] [ "x" get NSRect-h ] unit-test
+[ 1.0 ] [ "x" get CGRect-x ] unit-test
+[ 2.0 ] [ "x" get CGRect-y ] unit-test
+[ 101.0 ] [ "x" get CGRect-w ] unit-test
+[ 102.0 ] [ "x" get CGRect-h ] unit-test
 
 ! Make sure that we can add methods
 CLASS: {
index 919e8f86c5ff097b23faaecfad22abfc8daade58..1f9430e443e1f4f522005cdfdb58912b4dd39a67 100644 (file)
@@ -8,12 +8,11 @@ IN: cocoa.enumeration
 CONSTANT: NS-EACH-BUFFER-SIZE 16
 
 : with-enumeration-buffers ( quot -- )
-    [
-        [
-            "NSFastEnumerationState" malloc-object &free
-            NS-EACH-BUFFER-SIZE "id" heap-size * malloc-object &free
-            NS-EACH-BUFFER-SIZE
-        ] dip call
+    '[
+        "NSFastEnumerationState" malloc-object &free
+        NS-EACH-BUFFER-SIZE "id" malloc-array &free
+        NS-EACH-BUFFER-SIZE
+        @
     ] with-destructors ; inline
 
 :: (NSFastEnumeration-each) ( object quot: ( elt -- ) state stackbuf count -- )
index 9a1bebd38f326e16b29a06bdbc7852129dcf8d19..8818c9a217a6f241231db53ba6d05555cc148863 100644 (file)
@@ -167,13 +167,19 @@ assoc-union alien>objc-types set-global
         drop "void*"
     ] unless ;
 
+ERROR: no-objc-type name ;
+
+: decode-type ( ch -- ctype )
+    1string dup objc>alien-types get at
+    [ ] [ no-objc-type ] ?if ;
+
 : (parse-objc-type) ( i string -- ctype )
     [ [ 1+ ] dip ] [ nth ] 2bi {
         { [ dup "rnNoORV" member? ] [ drop (parse-objc-type) ] }
         { [ dup CHAR: ^ = ] [ 3drop "void*" ] }
         { [ dup CHAR: { = ] [ drop objc-struct-type ] }
         { [ dup CHAR: [ = ] [ 3drop "void*" ] }
-        [ 2nip 1string objc>alien-types get at ]
+        [ 2nip decode-type ]
     } cond ;
 
 : parse-objc-type ( string -- ctype ) 0 swap (parse-objc-type) ;
index 1a21b338be4fa2ce3ec3f0e60bb12b20470b3a3f..ef1c86836b4c976d9f5caaf08dc843eea186fca9 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.accessors arrays kernel cocoa.messages
 cocoa.classes cocoa.application sequences cocoa core-foundation
@@ -15,7 +15,7 @@ CONSTANT: NSStringPboardType "NSStringPboardType"
     dup [ CF>string ] when ;
 
 : set-pasteboard-types ( seq pasteboard -- )
-    swap <NSArray> f -> declareTypes:owner: drop ;
+    swap <CFArray> -> autorelease f -> declareTypes:owner: drop ;
 
 : set-pasteboard-string ( str pasteboard -- )
     NSStringPboardType <NSString>
diff --git a/basis/cocoa/plists/plists-tests.factor b/basis/cocoa/plists/plists-tests.factor
new file mode 100644 (file)
index 0000000..beb7665
--- /dev/null
@@ -0,0 +1,10 @@
+IN: cocoa.plists.tests
+USING: tools.test cocoa.plists colors kernel hashtables
+core-foundation.utilities core-foundation destructors
+assocs cocoa.enumeration ;
+
+[
+    [ V{ } ] [ H{ } >cf &CFRelease [ ] NSFastEnumeration-map ] unit-test
+    [ V{ "A" } ] [ { "A" } >cf &CFRelease plist> ] unit-test
+    [ H{ { "A" "B" } } ] [ "B" "A" associate >cf &CFRelease plist> ] unit-test
+] with-destructors
\ No newline at end of file
index cf68f9864ae059ec7c4d46c63e040a21198e0ab7..31b59a6eacdfde285975d86f2cafe6a710f6ef65 100644 (file)
@@ -1,68 +1,60 @@
-! Copyright (C) 2007, 2008 Slava Pestov.
+! Copyright (C) 2007, 2009 Slava Pestov.
+! Copyright (C) 2008 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: strings arrays hashtables assocs sequences
+USING: strings arrays hashtables assocs sequences fry macros
 cocoa.messages cocoa.classes cocoa.application cocoa kernel
 namespaces io.backend math cocoa.enumeration byte-arrays
-combinators alien.c-types core-foundation core-foundation.data ;
+combinators alien.c-types words core-foundation
+core-foundation.data core-foundation.utilities ;
 IN: cocoa.plists
 
-GENERIC: >plist ( value -- plist )
-
-M: number >plist
-    <NSNumber> ;
-M: t >plist
-    <NSNumber> ;
-M: f >plist
-    <NSNumber> ;
-M: string >plist
-    <NSString> ;
-M: byte-array >plist
-    <NSData> ;
-M: hashtable >plist
-    [ [ >plist ] bi@ ] assoc-map <NSDictionary> ;
-M: sequence >plist
-    [ >plist ] map <NSArray> ;
+: >plist ( value -- plist ) >cf -> autorelease ;
 
 : write-plist ( assoc path -- )
-    [ >plist ] [ normalize-path <NSString> ] bi* 0
-    -> writeToFile:atomically:
+    [ >plist ] [ normalize-path <NSString> ] bi* 0 -> writeToFile:atomically:
     [ "write-plist failed" throw ] unless ;
 
 DEFER: plist>
 
+<PRIVATE
+
 : (plist-NSString>) ( NSString -- string )
     -> UTF8String ;
 
 : (plist-NSNumber>) ( NSNumber -- number )
     dup -> doubleValue dup >integer =
-    [ -> longLongValue ]
-    [ -> doubleValue ] if ;
+    [ -> longLongValue ] [ -> doubleValue ] if ;
 
 : (plist-NSData>) ( NSData -- byte-array )
     dup -> length <byte-array> [ -> getBytes: ] keep ;
 
 : (plist-NSArray>) ( NSArray -- vector )
-    [ plist> ] NSFastEnumeration-map ;    
+    [ plist> ] NSFastEnumeration-map ;
 
 : (plist-NSDictionary>) ( NSDictionary -- hashtable )
-    dup [ [ -> valueForKey: ] keep swap [ plist> ] bi@ 2array ] with
+    dup [ [ nip ] [ -> valueForKey: ] 2bi [ plist> ] bi@ 2array ] with
     NSFastEnumeration-map >hashtable ;
 
-: plist> ( plist -- value )
-    {
-        { [ dup NSString     -> isKindOfClass: c-bool> ] [ (plist-NSString>)      ] }
-        { [ dup NSNumber     -> isKindOfClass: c-bool> ] [ (plist-NSNumber>)      ] }
-        { [ dup NSData       -> isKindOfClass: c-bool> ] [ (plist-NSData>)        ] }
-        { [ dup NSArray      -> isKindOfClass: c-bool> ] [ (plist-NSArray>)       ] }
-        { [ dup NSDictionary -> isKindOfClass: c-bool> ] [ (plist-NSDictionary>)  ] }
-        [ ]
-    } cond ;
-
 : (read-plist) ( NSData -- id )
     NSPropertyListSerialization swap kCFPropertyListImmutable f f <void*>
     [ -> propertyListFromData:mutabilityOption:format:errorDescription: ] keep
     *void* [ -> release "read-plist failed" throw ] when* ;
 
+MACRO: objc-class-case ( alist -- quot )
+    [ [ '[ dup _ execute -> isKindOfClass: c-bool> ] ] dip ] assoc-map '[ _ cond ] ;
+
+PRIVATE>
+
+: plist> ( plist -- value )
+    {
+        { NSString [ (plist-NSString>) ] }
+        { NSNumber [ (plist-NSNumber>) ] }
+        { NSData [ (plist-NSData>) ] }
+        { NSArray [ (plist-NSArray>) ] }
+        { NSDictionary [ (plist-NSDictionary>) ] }
+        { NSObject [ ] }
+    } objc-class-case ;
+
 : read-plist ( path -- assoc )
     normalize-path <NSString>
     NSData swap -> dataWithContentsOfFile:
index 08963126702a657407d3a7efe83ee91341bf3bcc..394f45bef39fdfd25082233118e2045c85acf5be 100644 (file)
@@ -32,10 +32,11 @@ IN: cocoa.subclassing
     [ add-protocols ] [ add-methods ] [ objc_registerClassPair ]
     tri ;
 
+: encode-type ( type -- encoded )
+    dup alien>objc-types get at [ ] [ no-objc-type ] ?if ;
+
 : encode-types ( return types -- encoding )
-    swap prefix [
-        alien>objc-types get at "0" append
-    ] map concat ;
+    swap prefix [ encode-type "0" append ] map concat ;
 
 : prepare-method ( ret types quot -- type imp )
     [ [ encode-types ] 2keep ] dip
diff --git a/basis/cocoa/types/types-docs.factor b/basis/cocoa/types/types-docs.factor
deleted file mode 100644 (file)
index 0c4b01a..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-USING: math help.markup help.syntax ;
-IN: cocoa.types
-
-HELP: <NSRect>
-{ $values { "x" real } { "y" real } { "w" real } { "h" real } { "rect" "an " { $snippet "NSRect" } } }
-{ $description "Allocates a new " { $snippet "NSRect" } " in the Factor heap." } ;
-
-HELP: <NSPoint>
-{ $values { "x" real } { "y" real } { "point" "an " { $snippet "NSPoint" } } }
-{ $description "Allocates a new " { $snippet "NSPoint" } " in the Factor heap." } ;
-
-HELP: <NSSize>
-{ $values { "w" real } { "h" real } { "size" "an " { $snippet "NSSize" } } }
-{ $description "Allocates a new " { $snippet "NSSize" } " in the Factor heap." } ;
-
-ARTICLE: "cocoa-types" "Cocoa types"
-"The Cocoa binding defines some common C structs:"
-{ $code
-    "NSRect"
-    "NSPoint"
-    "NSSize"
-}
-"Some words for working with the above:"
-{ $subsection <NSRect> }
-{ $subsection <NSPoint> }
-{ $subsection <NSSize> } ;
-
-IN: cocoa.types
-ABOUT: "cocoa-types"
index a76e74d9aabaeeaa02fbe024136261c89dd14404..6e03a21bbca5bc8da847e85cacbeabe50e585448 100644 (file)
@@ -1,73 +1,20 @@
-! Copyright (C) 2006, 2007 Slava Pestov
+! Copyright (C) 2006, 2009 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.c-types alien.syntax combinators kernel ;
+USING: alien.c-types alien.syntax combinators kernel layouts
+core-graphics.types ;
 IN: cocoa.types
 
 TYPEDEF: long NSInteger
 TYPEDEF: ulong NSUInteger
-<< "ptrdiff_t" heap-size {
-    { 4 [ "float" ] }
-    { 8 [ "double" ] }
-} case "CGFloat" typedef >>
-
-C-STRUCT: NSPoint
-    { "CGFloat" "x" }
-    { "CGFloat" "y" } ;
 
+TYPEDEF: CGPoint NSPoint
 TYPEDEF: NSPoint _NSPoint
-TYPEDEF: NSPoint CGPoint
-
-: <NSPoint> ( x y -- point )
-    "NSPoint" <c-object>
-    [ set-NSPoint-y ] keep
-    [ set-NSPoint-x ] keep ;
-
-C-STRUCT: NSSize
-    { "CGFloat" "w" }
-    { "CGFloat" "h" } ;
 
+TYPEDEF: CGSize NSSize
 TYPEDEF: NSSize _NSSize
-TYPEDEF: NSSize CGSize
-
-: <NSSize> ( w h -- size )
-    "NSSize" <c-object>
-    [ set-NSSize-h ] keep
-    [ set-NSSize-w ] keep ;
-
-C-STRUCT: NSRect
-    { "NSPoint" "origin" }
-    { "NSSize"  "size"   } ;
 
+TYPEDEF: CGRect NSRect
 TYPEDEF: NSRect _NSRect
-TYPEDEF: NSRect CGRect
-
-: NSRect-x ( NSRect -- x )
-    NSRect-origin NSPoint-x ; inline
-: NSRect-y ( NSRect -- y )
-    NSRect-origin NSPoint-y ; inline
-: NSRect-w ( NSRect -- w )
-    NSRect-size NSSize-w ; inline
-: NSRect-h ( NSRect -- h )
-    NSRect-size NSSize-h ; inline
-
-: set-NSRect-x ( x NSRect -- )
-    NSRect-origin set-NSPoint-x ; inline
-: set-NSRect-y ( y NSRect -- )
-    NSRect-origin set-NSPoint-y ; inline
-: set-NSRect-w ( w NSRect -- )
-    NSRect-size set-NSSize-w ; inline
-: set-NSRect-h ( h NSRect -- )
-    NSRect-size set-NSSize-h ; inline
-
-: <NSRect> ( x y w h -- rect )
-    "NSRect" <c-object>
-    [ set-NSRect-h ] keep
-    [ set-NSRect-w ] keep
-    [ set-NSRect-y ] keep
-    [ set-NSRect-x ] keep ;
-
-: NSRect-x-y ( alien -- origin-x origin-y )
-    [ NSRect-x ] keep NSRect-y ;
 
 C-STRUCT: NSRange
     { "NSUInteger" "location" }
@@ -85,14 +32,6 @@ TYPEDEF: void* unknown_type
     [ set-NSRange-length ] keep
     [ set-NSRange-location ] keep ;
 
-C-STRUCT: CGAffineTransform
-    { "CGFloat" "a" }
-    { "CGFloat" "b" }
-    { "CGFloat" "c" }
-    { "CGFloat" "d" }
-    { "CGFloat" "tx" }
-    { "CGFloat" "ty" } ;
-
 C-STRUCT: NSFastEnumerationState
     { "ulong" "state" }
     { "id*" "itemsPtr" }
index 4bb6468fa6c6cfcb963ece05f6722c8078c23238..0b8346db4bb6a3b610ad96652e81f7f4d4f03d9e 100644 (file)
@@ -1,8 +1,8 @@
-! Copyright (C) 2006, 2008 Slava Pestov
+! Copyright (C) 2006, 2009 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
 USING: specialized-arrays.int arrays kernel math namespaces make
-cocoa cocoa.messages cocoa.classes cocoa.types sequences
-continuations accessors ;
+cocoa cocoa.messages cocoa.classes core-graphics
+core-graphics.types sequences continuations accessors ;
 IN: cocoa.views
 
 CONSTANT: NSOpenGLPFAAllRenderers 1
@@ -40,29 +40,29 @@ CONSTANT: NSOpenGLPFAScreenMask 84
 CONSTANT: NSOpenGLPFAPixelBuffer 90
 CONSTANT: NSOpenGLPFAAllowOfflineRenderers 96
 CONSTANT: NSOpenGLPFAVirtualScreenCount 128
-
-CONSTANT: kCGLRendererGenericFloatID HEX: 00020400
+CONSTANT: NSOpenGLCPSwapInterval 222
 
 <PRIVATE
 
-SYMBOL: +software-renderer+
-SYMBOL: +multisample+
+SYMBOL: software-renderer?
+SYMBOL: multisample?
 
 PRIVATE>
 
 : with-software-renderer ( quot -- )
-    t +software-renderer+ pick with-variable ; inline
+    [ t software-renderer? ] dip with-variable ; inline
+
 : with-multisample ( quot -- )
-    t +multisample+ pick with-variable ; inline
+    [ t multisample? ] dip with-variable ; inline
 
 : <PixelFormat> ( attributes -- pixelfmt )
     NSOpenGLPixelFormat -> alloc swap [
         %
         NSOpenGLPFADepthSize , 16 ,
-        +software-renderer+ get [
+        software-renderer? get [
             NSOpenGLPFARendererID , kCGLRendererGenericFloatID ,
         ] when
-        +multisample+ get [
+        multisample? get [
             NSOpenGLPFASupersample ,
             NSOpenGLPFASampleBuffers , 1 ,
             NSOpenGLPFASamples , 8 ,
@@ -73,7 +73,7 @@ PRIVATE>
     -> autorelease ;
 
 : <GLView> ( class dim -- view )
-    [ -> alloc 0 0 ] dip first2 <NSRect>
+    [ -> alloc 0 0 ] dip first2 <CGRect>
     NSOpenGLPFAWindow NSOpenGLPFADoubleBuffer 2array <PixelFormat>
     -> initWithFrame:pixelFormat:
     dup 1 -> setPostsBoundsChangedNotifications:
@@ -81,26 +81,12 @@ PRIVATE>
 
 : view-dim ( view -- dim )
     -> bounds
-    dup NSRect-w >fixnum
-    swap NSRect-h >fixnum 2array ;
+    [ CGRect-w >fixnum ] [ CGRect-h >fixnum ] bi
+    2array ;
 
 : mouse-location ( view event -- loc )
     [
         -> locationInWindow f -> convertPoint:fromView:
-        [ NSPoint-x ] [ NSPoint-y ] bi
-    ] [ drop -> frame NSRect-h ] 2bi
+        [ CGPoint-x ] [ CGPoint-y ] bi
+    ] [ drop -> frame CGRect-h ] 2bi
     swap - 2array ;
-
-USE: opengl.gl
-USE: alien.syntax
-
-CONSTANT: NSOpenGLCPSwapInterval 222
-
-LIBRARY: OpenGL
-
-TYPEDEF: int CGLError
-TYPEDEF: void* CGLContextObj
-TYPEDEF: int CGLContextParameter
-
-FUNCTION: CGLError CGLSetParameter ( CGLContextObj ctx, CGLContextParameter pname, GLint* params ) ;
-
diff --git a/basis/colors/colors-docs.factor b/basis/colors/colors-docs.factor
new file mode 100644 (file)
index 0000000..8881d89
--- /dev/null
@@ -0,0 +1,39 @@
+IN: colors
+USING: accessors help.markup help.syntax ;
+
+HELP: color
+{ $class-description "The class of colors. Implementations include " { $link rgba } ", " { $vocab-link "colors.gray" } " and " { $vocab-link "colors.hsv" } "." } ;
+
+HELP: rgba
+{ $class-description "The class of colors with red, green, blue and alpha channel components. The slots store color components, which are real numbers in the range 0 to 1, inclusive." } ;
+
+HELP: >rgba
+{ $values { "color" color } { "rgba" rgba } }
+{ $contract "Converts a color to an RGBA color." } ;
+
+ARTICLE: "colors.protocol" "Color protocol"
+"Abstract superclass for colors:"
+{ $subsection color }
+"All color objects must are required to implement a method on the " { $link >rgba } " generic word."
+$nl
+"Optionally, they can provide methods on the accessors " { $link red>> } ", " { $link green>> } ", " { $link blue>> } " and " { $link alpha>> } ", either by defining slots with the appropriate names, or with methods which calculate the color component values. The accessors should return color components which are real numbers in the range between 0 and 1."
+$nl
+"Overriding the accessors is purely an optimization, since the default implementations call " { $link >rgba } " and then extract the appropriate component of the result." ;
+
+ARTICLE: "colors" "Colors"
+"The " { $vocab-link "colors" } " vocabulary defines a protocol for colors, with a concrete implementation for RGBA colors. This vocabulary is used by " { $vocab-link "io.styles" } ", " { $vocab-link "ui" } " and other vocabularies, but it is independent of them."
+$nl
+"RGBA colors:"
+{ $subsection rgba }
+{ $subsection <rgba> }
+"Converting a color to RGBA:"
+{ $subsection >rgba }
+"Extracting RGBA components of colors:"
+{ $subsection >rgba-components }
+"Further topics:"
+{ $subsection "colors.protocol" }
+{ $subsection "colors.constants" }
+{ $vocab-subsection "Grayscale colors" "colors.gray" }
+{ $vocab-subsection "HSV colors" "colors.hsv" } ;
+
+ABOUT: "colors"
\ No newline at end of file
index 9c55b1f29a20ce1eedda1f542d6ef3f31e0d089c..0cd743fa5fd8a1e57a7f6cf8f76c6d361af69f6e 100644 (file)
@@ -1,33 +1,30 @@
-! Copyright (C) 2003, 2008 Slava Pestov.
+! Copyright (C) 2003, 2009 Slava Pestov.
 ! Copyright (C) 2008 Eduardo Cavazos.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel accessors ;
+USING: kernel accessors combinators math ;
 IN: colors
 
 TUPLE: color ;
 
-TUPLE: rgba < color red green blue alpha ;
+TUPLE: rgba < color
+{ red read-only }
+{ green read-only }
+{ blue read-only }
+{ alpha read-only } ;
 
 C: <rgba> rgba
 
-GENERIC: >rgba ( object -- rgba )
+GENERIC: >rgba ( color -- rgba )
 
 M: rgba >rgba ( rgba -- rgba ) ;
 
-M: color red>>   ( color -- red   ) >rgba red>>   ;
+M: color red>> ( color -- red ) >rgba red>> ;
 M: color green>> ( color -- green ) >rgba green>> ;
-M: color blue>>  ( color -- blue  ) >rgba blue>>  ;
-
-CONSTANT: black        T{ rgba f 0.0   0.0   0.0   1.0  }
-CONSTANT: blue         T{ rgba f 0.0   0.0   1.0   1.0  }
-CONSTANT: cyan         T{ rgba f 0     0.941 0.941 1    }
-CONSTANT: gray         T{ rgba f 0.6   0.6   0.6   1.0  }
-CONSTANT: green        T{ rgba f 0.0   1.0   0.0   1.0  }
-CONSTANT: light-gray   T{ rgba f 0.95  0.95  0.95  0.95 }
-CONSTANT: light-purple T{ rgba f 0.8   0.8   1.0   1.0  }
-CONSTANT: magenta      T{ rgba f 0.941 0     0.941 1    }
-CONSTANT: orange       T{ rgba f 0.941 0.627 0     1    }
-CONSTANT: purple       T{ rgba f 0.627 0     0.941 1    }
-CONSTANT: red          T{ rgba f 1.0   0.0   0.0   1.0  }
-CONSTANT: white        T{ rgba f 1.0   1.0   1.0   1.0  }
-CONSTANT: yellow       T{ rgba f 1.0   1.0   0.0   1.0  }
+M: color blue>> ( color -- blue ) >rgba blue>> ;
+
+: >rgba-components ( object -- r g b a )
+    >rgba { [ red>> ] [ green>> ] [ blue>> ] [ alpha>> ] } cleave ; inline
+
+: opaque? ( color -- ? ) alpha>> 1 number= ;
+
+CONSTANT: transparent T{ rgba f 0.0 0.0 0.0 0.0 }
\ No newline at end of file
diff --git a/basis/colors/constants/constants-docs.factor b/basis/colors/constants/constants-docs.factor
new file mode 100644 (file)
index 0000000..633bd20
--- /dev/null
@@ -0,0 +1,31 @@
+IN: colors.constants
+USING: help.markup help.syntax strings colors ;
+
+HELP: named-color
+{ $values { "string" string } { "color" color } }
+{ $description "Outputs a named color from the " { $snippet "rgb.txt" } " database." }
+{ $notes "In most cases, " { $link POSTPONE: COLOR: } " should be used instead." }
+{ $errors "Throws an error if the color is not listed in " { $snippet "rgb.txt" } "." } ;
+
+HELP: named-colors
+{ $values { "keys" "a sequence of strings" } }
+{ $description "Outputs a sequence of all colors in the " { $snippet "rgb.txt" } " database." } ;
+
+HELP: COLOR:
+{ $syntax "COLOR: name" }
+{ $description "Parses as a " { $link color } " object with the given name." }
+{ $errors "Throws an error if the color is not listed in " { $snippet "rgb.txt" } "." }
+{ $examples
+  { $code
+    "USING: colors.constants io.styles ;"
+    "\"Hello!\" { { foreground COLOR: cyan } } format nl"
+  }
+} ;
+
+ARTICLE: "colors.constants" "Standard color database"
+"The " { $vocab-link "colors.constants" } " vocabulary bundles the X11 " { $snippet "rgb.txt" } " database and provides words for looking up color values."
+{ $subsection named-color }
+{ $subsection named-colors }
+{ $subsection POSTPONE: COLOR: } ;
+
+ABOUT: "colors.constants" 
\ No newline at end of file
index e298b3b61e78e3d56fd29c16a0fd281bfbb1e6ec..0e5610a1441e4ab6f065ff27cf408e942fa2dade 100644 (file)
@@ -23,6 +23,8 @@ MEMO: rgb.txt ( -- assoc )
 
 PRIVATE>
 
+: named-colors ( -- keys ) rgb.txt keys ;
+
 ERROR: no-such-color name ;
 
 : named-color ( name -- rgb )
diff --git a/basis/colors/gray/gray-docs.factor b/basis/colors/gray/gray-docs.factor
new file mode 100644 (file)
index 0000000..ac0f45e
--- /dev/null
@@ -0,0 +1,9 @@
+USING: help.markup help.syntax accessors ;
+IN: colors.gray
+
+ARTICLE: "colors.gray" "Grayscale colors"
+"The " { $vocab-link "colors.gray" } " vocabulary implements grayscale colors. These colors hold a single value, and respond to " { $link red>> } ", " { $link green>> } ", " { $link blue>> } " with that value. They also have an independent alpha channel, " { $link alpha>> } "."
+{ $subsection gray }
+{ $subsection <gray> } ;
+
+ABOUT: "colors.gray"
\ No newline at end of file
index 26ec1177b6fe70401733275c10db6e4841ba8923..5d628dc409b58b0f69ef76d2d4e7752cf229e53c 100644 (file)
@@ -3,9 +3,15 @@
 USING: colors kernel accessors ;
 IN: colors.gray
 
-TUPLE: gray < color gray alpha ;
+TUPLE: gray < color { gray read-only } { alpha read-only } ;
 
 C: <gray> gray
 
 M: gray >rgba ( gray -- rgba )
     [ gray>> dup dup ] [ alpha>> ] bi <rgba> ;
+
+M: gray red>> gray>> ;
+
+M: gray green>> gray>> ;
+
+M: gray blue>> gray>> ;
\ No newline at end of file
diff --git a/basis/colors/hsv/hsv-docs.factor b/basis/colors/hsv/hsv-docs.factor
new file mode 100644 (file)
index 0000000..4a9d8a9
--- /dev/null
@@ -0,0 +1,13 @@
+IN: colors.hsv
+USING: help.markup help.syntax ;
+
+HELP: hsva
+{ $class-description "The class of HSV (Hue, Saturation, Value) colors with an alpha channel. The " { $slot "hue" } " slot stores a value in the interval " { $snippet "[0,360]" } " and the remaining slots store values in the interval " { $snippet "[0,1]" } "." } ;
+
+ARTICLE: "colors.hsv" "HSV colors"
+"The " { $vocab-link "colors.hsv" } " vocabulary implements colors specified by their hue, saturation, and value, together with an alpha channel."
+{ $subsection hsva }
+{ $subsection <hsva> }
+{ $see-also "colors" } ;
+
+ABOUT: "colors.hsv"
\ No newline at end of file
index 8a736553bb10bfc703b2cd85716ef9b49f67687e..a825cacda8d2526a1e3707feccf2c1f5bbbe2582 100644 (file)
@@ -24,3 +24,5 @@ USING: accessors kernel colors colors.hsv tools.test math ;
 
 [ 5/6 5/36 5/6 ] [ 5/6 5/6 5/6 hsv>rgb ] unit-test
 [ 1/6 0 1/6 ] [ 5/6 1 1/6 hsv>rgb ] unit-test
+
+[ 0.5 ] [ 180 0.1 0.2 0.5 <hsva> alpha>> ] unit-test
\ No newline at end of file
index 6f658818a1ceda2b685abaeff31bf537c6bd2073..e4451fcb1c10363937a3c28da003842ad3f4c7b3 100644 (file)
@@ -6,7 +6,7 @@ IN: colors.hsv
 ! h [0,360)
 ! s [0,1]
 ! v [0,1]
-TUPLE: hsva < color hue saturation value alpha ;
+TUPLE: hsva < color { hue read-only } { saturation read-only } { value read-only } { alpha read-only } ;
 
 C: <hsva> hsva
 
index 3ad716d847f19a5066fb23b06b8f8e06d0278d55..cb5f2e926d56700e143f207c31930c6b81a008eb 100644 (file)
@@ -70,7 +70,7 @@ IN: compiler.cfg.intrinsics.fixnum
     ds-push ;
 
 : emit-fixnum-comparison ( node cc -- )
-    [ '[ _ ^^compare ] ] [ '[ _ ^^compare-imm ] ] bi
+    [  ^^compare ] [ ^^compare-imm ] bi-curry
     emit-fixnum-op ;
 
 : emit-bignum>fixnum ( -- )
index bc46e6149c0d81dd8ed536b70b80ba8fa89957c8..0cc6e6f5d0499989ad3d6fb05a1584147b67f2f2 100644 (file)
@@ -28,15 +28,14 @@ IN: compiler.cfg.intrinsics.slots
     ] [ drop emit-primitive ] if ;
 
 : (emit-set-slot) ( infos -- obj-reg )
-    [ 3inputs [ tuck ] dip ^^offset>slot ]
-    [ second value-tag ]
-    bi* ^^set-slot ;
+    [ 3inputs ^^offset>slot ] [ second value-tag ] bi*
+    pick [ ^^set-slot ] dip ;
 
 : (emit-set-slot-imm) ( infos -- obj-reg )
     ds-drop
-    [ 2inputs tuck ]
+    [ 2inputs ]
     [ [ third literal>> ] [ second value-tag ] bi ] bi*
-    ##set-slot-imm ;
+    pick [ ##set-slot-imm ] dip ;
 
 : emit-set-slot ( node -- )
     dup node-input-infos
index d75d5649cbbc0870f2940ab7656af74af7d2d49f..8d00a14ea2142c69463605ef53404dae56607f19 100644 (file)
@@ -105,7 +105,7 @@ SYMBOL: spill-counts
     #! If it has been spilled already, reuse spill location.
     over reload-from>>
     [ over vreg>> reg-class>> next-spill-location ] unless*
-    tuck [ >>spill-to ] [ >>reload-from ] 2bi* ;
+    [ >>spill-to ] [ >>reload-from ] bi-curry bi* ;
 
 : split-and-spill ( new existing -- before after )
     dup rot start>> split-interval
index 886233a08b0324c4836a60bd55ee283b47c39944..c9b73808a12a9e97b70685375193c4489070a822 100755 (executable)
@@ -76,7 +76,7 @@ M: #alien-indirect compute-live-values* nip look-at-inputs ;
     ] ;
 
 : drop-dead-outputs ( node -- #shuffle )
-    dup out-d>> drop-dead-values tuck in-d>> >>out-d drop ;
+    dup out-d>> drop-dead-values [ in-d>> >>out-d drop ] keep ;
 
 : some-outputs-dead? ( #call -- ? )
     out-d>> [ live-value? not ] any? ;
diff --git a/basis/core-foundation/attributed-strings/attributed-strings-tests.factor b/basis/core-foundation/attributed-strings/attributed-strings-tests.factor
new file mode 100644 (file)
index 0000000..c96439a
--- /dev/null
@@ -0,0 +1,7 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test core-foundation.attributed-strings
+core-foundation ;
+IN: core-foundation.attributed-strings.tests
+
+[ ] [ "Hello world" H{ } <CFAttributedString> CFRelease ] unit-test
\ No newline at end of file
diff --git a/basis/core-foundation/attributed-strings/attributed-strings.factor b/basis/core-foundation/attributed-strings/attributed-strings.factor
new file mode 100644 (file)
index 0000000..48c262f
--- /dev/null
@@ -0,0 +1,19 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: alien.syntax kernel destructors core-foundation
+core-foundation.utilities ;
+IN: core-foundation.attributed-strings
+
+TYPEDEF: void* CFAttributedStringRef
+
+FUNCTION: CFAttributedStringRef CFAttributedStringCreate (
+   CFAllocatorRef alloc,
+   CFStringRef str,
+   CFDictionaryRef attributes
+) ;
+
+: <CFAttributedString> ( string assoc -- alien )
+    [
+        [ >cf &CFRelease ] bi@
+        [ kCFAllocatorDefault ] 2dip CFAttributedStringCreate
+    ] with-destructors ;
\ No newline at end of file
diff --git a/basis/core-foundation/attributed-strings/authors.txt b/basis/core-foundation/attributed-strings/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
index 40269ae3be62a10662167057880bb3c8a00f7ccd..82f836f28e52e0c5f6da2c3d5b684292fdccfed7 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2006, 2008 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax destructors accessors kernel ;
+USING: alien.syntax alien.c-types alien.destructors accessors kernel ;
 IN: core-foundation
 
 TYPEDEF: void* CFTypeRef
@@ -10,22 +10,27 @@ CONSTANT: kCFAllocatorDefault f
 
 TYPEDEF: bool Boolean
 TYPEDEF: long CFIndex
+TYPEDEF: char UInt8
 TYPEDEF: int SInt32
 TYPEDEF: uint UInt32
 TYPEDEF: ulong CFTypeID
 TYPEDEF: UInt32 CFOptionFlags
 TYPEDEF: void* CFUUIDRef
 
-FUNCTION: CFTypeRef CFRetain ( CFTypeRef cf ) ;
+ALIAS: <CFIndex> <long>
+ALIAS: *CFIndex *long
 
-FUNCTION: void CFRelease ( CFTypeRef cf ) ;
+C-STRUCT: CFRange
+{ "CFIndex" "location" }
+{ "CFIndex" "length" } ;
 
-TUPLE: CFRelease-destructor alien disposed ;
+: <CFRange> ( location length -- range )
+    "CFRange" <c-object>
+    [ set-CFRange-length ] keep
+    [ set-CFRange-location ] keep ;
 
-M: CFRelease-destructor dispose* alien>> CFRelease ;
+FUNCTION: CFTypeRef CFRetain ( CFTypeRef cf ) ;
 
-: &CFRelease ( alien -- alien )
-    dup f CFRelease-destructor boa &dispose drop ; inline
+FUNCTION: void CFRelease ( CFTypeRef cf ) ;
 
-: |CFRelease ( alien -- alien )
   dup f CFRelease-destructor boa |dispose drop ; inline
+DESTRUCTOR: CFRelease
No newline at end of file
index fb5ecaa0431bec02cc414b339c3b5dd58e919edf..c708eacecc8ff5ac2c774d9e759f8e27aafb0adf 100644 (file)
@@ -1,57 +1,20 @@
 ! Copyright (C) 2008 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax alien.c-types sequences kernel math ;
+USING: alien.c-types alien.syntax core-foundation.numbers kernel math
+sequences core-foundation.numbers ;
 IN: core-foundation.data
 
 TYPEDEF: void* CFDataRef
-TYPEDEF: void* CFDictionaryRef
-TYPEDEF: void* CFMutableDictionaryRef
-TYPEDEF: void* CFNumberRef
 TYPEDEF: void* CFSetRef
 
-TYPEDEF: int CFNumberType
-CONSTANT: kCFNumberSInt8Type 1
-CONSTANT: kCFNumberSInt16Type 2
-CONSTANT: kCFNumberSInt32Type 3
-CONSTANT: kCFNumberSInt64Type 4
-CONSTANT: kCFNumberFloat32Type 5
-CONSTANT: kCFNumberFloat64Type 6
-CONSTANT: kCFNumberCharType 7
-CONSTANT: kCFNumberShortType 8
-CONSTANT: kCFNumberIntType 9
-CONSTANT: kCFNumberLongType 10
-CONSTANT: kCFNumberLongLongType 11
-CONSTANT: kCFNumberFloatType 12
-CONSTANT: kCFNumberDoubleType 13
-CONSTANT: kCFNumberCFIndexType 14
-CONSTANT: kCFNumberNSIntegerType 15
-CONSTANT: kCFNumberCGFloatType 16
-CONSTANT: kCFNumberMaxType 16
-
 TYPEDEF: int CFPropertyListMutabilityOptions
-CONSTANT: kCFPropertyListImmutable                  0
-CONSTANT: kCFPropertyListMutableContainers          1
+CONSTANT: kCFPropertyListImmutable 0
+CONSTANT: kCFPropertyListMutableContainers 1
 CONSTANT: kCFPropertyListMutableContainersAndLeaves 2
 
-FUNCTION: CFNumberRef CFNumberCreate ( CFAllocatorRef allocator, CFNumberType theType, void* valuePtr ) ;
-
 FUNCTION: CFDataRef CFDataCreate ( CFAllocatorRef allocator, uchar* bytes, CFIndex length ) ;
 
 FUNCTION: CFTypeID CFGetTypeID ( CFTypeRef cf ) ;
 
-GENERIC: <CFNumber> ( number -- alien )
-
-M: integer <CFNumber>
-    [ f kCFNumberLongLongType ] dip <longlong> CFNumberCreate ;
-
-M: float <CFNumber>
-    [ f kCFNumberDoubleType ] dip <double> CFNumberCreate ;
-
-M: t <CFNumber>
-    drop f kCFNumberIntType 1 <int> CFNumberCreate ;
-
-M: f <CFNumber>
-    drop f kCFNumberIntType 0 <int> CFNumberCreate ;
-
 : <CFData> ( byte-array -- alien )
-    [ f ] dip dup length CFDataCreate ;
+    [ f ] dip dup length CFDataCreate ;
\ No newline at end of file
diff --git a/basis/core-foundation/dictionaries/authors.txt b/basis/core-foundation/dictionaries/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/core-foundation/dictionaries/dictionaries-tests.factor b/basis/core-foundation/dictionaries/dictionaries-tests.factor
new file mode 100644 (file)
index 0000000..61ca131
--- /dev/null
@@ -0,0 +1,18 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test core-foundation core-foundation.dictionaries
+arrays destructors core-foundation.strings kernel namespaces ;
+IN: core-foundation.dictionaries.tests
+
+[ ] [ { } <CFDictionary> CFRelease ] unit-test
+
+[ "raps in the back of cars and doesn't afraid of anything" ] [
+    [
+        "cpst" <CFString> &CFRelease dup "key" set
+        "raps in the back of cars and doesn't afraid of anything" <CFString> &CFRelease
+        2array 1array <CFDictionary> &CFRelease
+        "key" get
+        CFDictionaryGetValue
+        dup [ CF>string ] when
+    ] with-destructors
+] unit-test
\ No newline at end of file
diff --git a/basis/core-foundation/dictionaries/dictionaries.factor b/basis/core-foundation/dictionaries/dictionaries.factor
new file mode 100644 (file)
index 0000000..f758e0e
--- /dev/null
@@ -0,0 +1,32 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: alien.syntax core-foundation kernel assocs
+specialized-arrays.alien math sequences accessors ;
+IN: core-foundation.dictionaries
+
+TYPEDEF: void* CFDictionaryRef
+TYPEDEF: void* CFMutableDictionaryRef
+TYPEDEF: void* CFDictionaryKeyCallBacks*
+TYPEDEF: void* CFDictionaryValueCallBacks*
+
+FUNCTION: CFDictionaryRef CFDictionaryCreate (
+   CFAllocatorRef allocator,
+   void** keys,
+   void** values,
+   CFIndex numValues,
+   CFDictionaryKeyCallBacks* keyCallBacks,
+   CFDictionaryValueCallBacks* valueCallBacks
+) ;
+
+FUNCTION: void* CFDictionaryGetValue (
+   CFDictionaryRef theDict,
+   void* key
+) ;
+
+: <CFDictionary> ( alist -- dictionary )
+    [ kCFAllocatorDefault ] dip
+    unzip [ >void*-array ] bi@
+    [ [ underlying>> ] bi@ ] [ nip length ] 2bi
+    &: kCFTypeDictionaryKeyCallBacks
+    &: kCFTypeDictionaryValueCallBacks
+    CFDictionaryCreate ;
\ No newline at end of file
diff --git a/basis/core-foundation/dictionaries/tags.txt b/basis/core-foundation/dictionaries/tags.txt
new file mode 100644 (file)
index 0000000..2320bdd
--- /dev/null
@@ -0,0 +1,2 @@
+unportable
+bindings
diff --git a/basis/core-foundation/numbers/authors.txt b/basis/core-foundation/numbers/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/core-foundation/numbers/numbers-tests.factor b/basis/core-foundation/numbers/numbers-tests.factor
new file mode 100644 (file)
index 0000000..1c50f2d
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test core-foundation.numbers ;
+IN: core-foundation.numbers.tests
diff --git a/basis/core-foundation/numbers/numbers.factor b/basis/core-foundation/numbers/numbers.factor
new file mode 100644 (file)
index 0000000..f01f522
--- /dev/null
@@ -0,0 +1,42 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: alien.c-types alien.syntax kernel math core-foundation ;
+IN: core-foundation.numbers
+
+TYPEDEF: void* CFNumberRef
+
+TYPEDEF: int CFNumberType
+CONSTANT: kCFNumberSInt8Type 1
+CONSTANT: kCFNumberSInt16Type 2
+CONSTANT: kCFNumberSInt32Type 3
+CONSTANT: kCFNumberSInt64Type 4
+CONSTANT: kCFNumberFloat32Type 5
+CONSTANT: kCFNumberFloat64Type 6
+CONSTANT: kCFNumberCharType 7
+CONSTANT: kCFNumberShortType 8
+CONSTANT: kCFNumberIntType 9
+CONSTANT: kCFNumberLongType 10
+CONSTANT: kCFNumberLongLongType 11
+CONSTANT: kCFNumberFloatType 12
+CONSTANT: kCFNumberDoubleType 13
+CONSTANT: kCFNumberCFIndexType 14
+CONSTANT: kCFNumberNSIntegerType 15
+CONSTANT: kCFNumberCGFloatType 16
+CONSTANT: kCFNumberMaxType 16
+
+FUNCTION: CFNumberRef CFNumberCreate ( CFAllocatorRef allocator, CFNumberType theType, void* valuePtr ) ;
+
+GENERIC: <CFNumber> ( number -- alien )
+
+M: integer <CFNumber>
+    [ f kCFNumberLongLongType ] dip <longlong> CFNumberCreate ;
+
+M: float <CFNumber>
+    [ f kCFNumberDoubleType ] dip <double> CFNumberCreate ;
+
+M: t <CFNumber>
+    drop f kCFNumberIntType 1 <int> CFNumberCreate ;
+
+M: f <CFNumber>
+    drop f kCFNumberIntType 0 <int> CFNumberCreate ;
+
diff --git a/basis/core-foundation/numbers/tags.txt b/basis/core-foundation/numbers/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
index 8bdce2ec3794356dc8f30d660db470667b4cb2f7..a63a3ea6747af3ca3be40ab72fb4b2c5fa61c3c8 100644 (file)
@@ -56,25 +56,17 @@ FUNCTION: void CFRunLoopRemoveTimer (
 
 : CFRunLoopDefaultMode ( -- alien )
     #! Ugly, but we don't have static NSStrings
-    \ CFRunLoopDefaultMode get-global dup expired? [
-        drop
+    \ CFRunLoopDefaultMode [
         "kCFRunLoopDefaultMode" <CFString>
-        dup \ CFRunLoopDefaultMode set-global
-    ] when ;
+    ] initialize-alien ;
 
 TUPLE: run-loop fds sources timers ;
 
 : <run-loop> ( -- run-loop )
     V{ } clone V{ } clone V{ } clone \ run-loop boa ;
 
-SYMBOL: expiry-check
-
 : run-loop ( -- run-loop )
-    \ run-loop get-global not expiry-check get expired? or
-    [
-        31337 <alien> expiry-check set-global
-        <run-loop> dup \ run-loop set-global
-    ] [ \ run-loop get-global ] if ;
+    \ run-loop [ <run-loop> ] initialize-alien ;
 
 : add-source-to-run-loop ( source -- )
     [ run-loop sources>> push ]
index 39d5ee6ac0e1e387cc1f4cd13cc33448cdf52013..1c52752b2195e52ca27a1d3b70189eb8e8d2cbed 100644 (file)
@@ -1,9 +1,15 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: core-foundation.strings core-foundation tools.test kernel ;
+USING: core-foundation.strings core-foundation tools.test kernel
+strings ;
 IN: core-foundation
 
 [ ] [ "Hello" <CFString> CFRelease ] unit-test
 [ "Hello" ] [ "Hello" <CFString> [ CF>string ] [ CFRelease ] bi ] unit-test
 [ "Hello\u003456" ] [ "Hello\u003456" <CFString> [ CF>string ] [ CFRelease ] bi ] unit-test
 [ "Hello\u013456" ] [ "Hello\u013456" <CFString> [ CF>string ] [ CFRelease ] bi ] unit-test
+[ ] [ "\0" <CFString> CFRelease ] unit-test
+[ "\0" ] [ "\0" <CFString> [ CF>string ] [ CFRelease ] bi ] unit-test
+
+! This shouldn't fail
+[ ] [ { HEX: 123456 } >string <CFString> CFRelease ] unit-test
\ No newline at end of file
index 50c17dc6fd03e6fc0e9eff86852df9b3af037a28..21f3d7efd44771f7687a38510575212a3daea7b8 100644 (file)
@@ -1,7 +1,8 @@
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax alien.strings kernel sequences byte-arrays
-io.encodings.utf8 math core-foundation core-foundation.arrays ;
+USING: alien.syntax alien.strings io.encodings.string kernel
+sequences byte-arrays io.encodings.utf8 math core-foundation
+core-foundation.arrays destructors unicode.data ;
 IN: core-foundation.strings
 
 TYPEDEF: void* CFStringRef
@@ -41,26 +42,44 @@ FUNCTION: Boolean CFStringGetCString (
     CFStringEncoding encoding
 ) ;
 
+FUNCTION: CFIndex CFStringGetBytes (
+   CFStringRef theString,
+   CFRange range,
+   CFStringEncoding encoding,
+   UInt8 lossByte,
+   Boolean isExternalRepresentation,
+   UInt8* buffer,
+   CFIndex maxBufLen,
+   CFIndex* usedBufLen
+) ;
+
 FUNCTION: CFStringRef CFStringCreateWithCString (
     CFAllocatorRef alloc,
     char* cStr,
     CFStringEncoding encoding
 ) ;
 
+: prepare-CFString ( string -- byte-array )
+    [
+        dup HEX: 10ffff >
+        [ drop CHAR: replacement-character ] when
+    ] map utf8 encode ;
+
 : <CFString> ( string -- alien )
-    f swap utf8 string>alien kCFStringEncodingUTF8 CFStringCreateWithCString
-    [ "CFStringCreateWithCString failed" throw ] unless* ;
+    [ f ] dip
+    prepare-CFString dup length
+    kCFStringEncodingUTF8 f
+    CFStringCreateWithBytes
+    [ "CFStringCreateWithBytes failed" throw ] unless* ;
 
 : CF>string ( alien -- string )
-    dup CFStringGetLength 4 * 1 + <byte-array> [
-        dup length
-        kCFStringEncodingUTF8
-        CFStringGetCString
-        [ "CFStringGetCString failed" throw ] unless
-    ] keep utf8 alien>string ;
+    dup CFStringGetLength
+    [ 0 swap <CFRange> kCFStringEncodingUTF8 0 f ] keep
+    4 * 1 + <byte-array> [ dup length 0 <CFIndex> [ CFStringGetBytes drop ] keep ] keep
+    swap *CFIndex head-slice utf8 decode ;
 
 : CF>string-array ( alien -- seq )
     CF>array [ CF>string ] map ;
 
 : <CFStringArray> ( seq -- alien )
-    [ <CFString> ] map [ <CFArray> ] [ [ CFRelease ] each ] bi ;
+    [ [ <CFString> &CFRelease ] map <CFArray> ] with-destructors ;
index c5f2d1b5453beddb50ca9613d80350702cc9197f..4adcc10e48820f2357fe7aaf445a135d0c27a4c3 100644 (file)
@@ -1 +1 @@
-Mac OS X CoreFoundation binding
+Binding to Mac OS X CoreFoundation library
diff --git a/basis/core-foundation/utilities/authors.txt b/basis/core-foundation/utilities/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/core-foundation/utilities/tags.txt b/basis/core-foundation/utilities/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
diff --git a/basis/core-foundation/utilities/utilities-tests.factor b/basis/core-foundation/utilities/utilities-tests.factor
new file mode 100644 (file)
index 0000000..fb3deb2
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test core-foundation.utilities ;
+IN: core-foundation.utilities.tests
diff --git a/basis/core-foundation/utilities/utilities.factor b/basis/core-foundation/utilities/utilities.factor
new file mode 100644 (file)
index 0000000..3dd760f
--- /dev/null
@@ -0,0 +1,21 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: math assocs kernel sequences byte-arrays strings
+hashtables alien destructors
+core-foundation.numbers core-foundation.strings
+core-foundation.arrays core-foundation.dictionaries
+core-foundation.data core-foundation ;
+IN: core-foundation.utilities
+
+GENERIC: (>cf) ( obj -- cf )
+
+M: number (>cf) <CFNumber> ;
+M: t (>cf) <CFNumber> ;
+M: f (>cf) <CFNumber> ;
+M: string (>cf) <CFString> ;
+M: byte-array (>cf) <CFData> ;
+M: hashtable (>cf) [ [ (>cf) &CFRelease ] bi@ ] assoc-map <CFDictionary> ;
+M: sequence (>cf) [ (>cf) &CFRelease ] map <CFArray> ;
+M: alien (>cf) CFRetain ;
+
+: >cf ( obj -- cf ) [ (>cf) ] with-destructors ;
\ No newline at end of file
diff --git a/basis/core-graphics/authors.txt b/basis/core-graphics/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/basis/core-graphics/core-graphics-docs.factor b/basis/core-graphics/core-graphics-docs.factor
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/basis/core-graphics/core-graphics-tests.factor b/basis/core-graphics/core-graphics-tests.factor
new file mode 100644 (file)
index 0000000..b032a77
--- /dev/null
@@ -0,0 +1,8 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test core-graphics kernel images ;
+IN: core-graphics.tests
+
+[ t ] [ { 100 200 } [ drop ] make-bitmap-image image? ] unit-test
+
+[ ] [ dummy-context drop ] unit-test
\ No newline at end of file
diff --git a/basis/core-graphics/core-graphics.factor b/basis/core-graphics/core-graphics.factor
new file mode 100644 (file)
index 0000000..5e95e2e
--- /dev/null
@@ -0,0 +1,130 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: alien alien.c-types alien.destructors alien.syntax accessors
+destructors fry kernel math math.bitwise sequences libc colors
+images images.memory core-graphics.types core-foundation.utilities ;
+IN: core-graphics
+
+! CGImageAlphaInfo
+C-ENUM:
+kCGImageAlphaNone
+kCGImageAlphaPremultipliedLast
+kCGImageAlphaPremultipliedFirst
+kCGImageAlphaLast
+kCGImageAlphaFirst
+kCGImageAlphaNoneSkipLast
+kCGImageAlphaNoneSkipFirst ;
+
+: kCGBitmapAlphaInfoMask ( -- n ) HEX: 1f ; inline
+: kCGBitmapFloatComponents ( -- n ) 1 8 shift ; inline
+
+: kCGBitmapByteOrderMask ( -- n ) HEX: 7000 ; inline
+: kCGBitmapByteOrderDefault ( -- n ) 0 12 shift ; inline
+: kCGBitmapByteOrder16Little ( -- n ) 1 12 shift ; inline
+: kCGBitmapByteOrder32Little ( -- n ) 2 12 shift ; inline
+: kCGBitmapByteOrder16Big ( -- n ) 3 12 shift ; inline
+: kCGBitmapByteOrder32Big ( -- n ) 4 12 shift ; inline
+
+: kCGBitmapByteOrder16Host ( -- n )
+    little-endian?
+    kCGBitmapByteOrder16Little
+    kCGBitmapByteOrder16Big ? ; foldable
+
+: kCGBitmapByteOrder32Host ( -- n )
+    little-endian?
+    kCGBitmapByteOrder32Little
+    kCGBitmapByteOrder32Big ? ; foldable
+
+FUNCTION: CGColorRef CGColorCreateGenericRGB (
+   CGFloat red,
+   CGFloat green,
+   CGFloat blue,
+   CGFloat alpha
+) ;
+
+: <CGColor> ( color -- CGColor )
+    >rgba-components CGColorCreateGenericRGB ;
+
+M: color (>cf) <CGColor> ;
+
+FUNCTION: CGColorSpaceRef CGColorSpaceCreateDeviceRGB ( ) ;
+
+FUNCTION: CGContextRef CGBitmapContextCreate (
+   void* data,
+   size_t width,
+   size_t height,
+   size_t bitsPerComponent,
+   size_t bytesPerRow,
+   CGColorSpaceRef colorspace,
+   CGBitmapInfo bitmapInfo
+) ;
+
+FUNCTION: void CGColorSpaceRelease ( CGColorSpaceRef ref ) ;
+
+DESTRUCTOR: CGColorSpaceRelease
+
+FUNCTION: void CGContextRelease ( CGContextRef ref ) ;
+
+DESTRUCTOR: CGContextRelease
+
+FUNCTION: void CGContextSetRGBStrokeColor (
+   CGContextRef c,
+   CGFloat red,
+   CGFloat green,
+   CGFloat blue,
+   CGFloat alpha
+) ;
+  
+FUNCTION: void CGContextSetRGBFillColor (
+   CGContextRef c,
+   CGFloat red,
+   CGFloat green,
+   CGFloat blue,
+   CGFloat alpha
+) ;
+
+FUNCTION: void CGContextSetTextPosition (
+   CGContextRef c,
+   CGFloat x,
+   CGFloat y
+) ;
+
+FUNCTION: void CGContextFillRect (
+   CGContextRef c,
+   CGRect rect
+) ;
+
+FUNCTION: void CGContextSetShouldSmoothFonts (
+   CGContextRef c,
+   bool shouldSmoothFonts
+) ;
+
+FUNCTION: void* CGBitmapContextGetData ( CGContextRef c ) ;
+
+CONSTANT: kCGLRendererGenericFloatID HEX: 00020400
+
+FUNCTION: CGLError CGLSetParameter ( CGLContextObj ctx, CGLContextParameter pname, GLint* params ) ;
+
+<PRIVATE
+
+: bitmap-flags ( -- flags )
+    { kCGImageAlphaPremultipliedFirst kCGBitmapByteOrder32Host } flags ;
+
+: bitmap-color-space ( -- color-space )
+    CGColorSpaceCreateDeviceRGB &CGColorSpaceRelease ;
+
+: <CGBitmapContext> ( data dim -- context )
+    [ first2 8 ] [ first 4 * ] bi
+    bitmap-color-space bitmap-flags CGBitmapContextCreate
+    [ "CGBitmapContextCreate failed" throw ] unless* ;
+
+PRIVATE>
+
+: dummy-context ( -- context )
+    \ dummy-context [
+        [ 4 malloc { 1 1 } <CGBitmapContext> ] with-destructors
+    ] initialize-alien ;
+
+: make-bitmap-image ( dim quot -- image )
+    '[ <CGBitmapContext> &CGContextRelease @ ] make-memory-bitmap
+    ARGB >>component-order ; inline
diff --git a/basis/core-graphics/summary.txt b/basis/core-graphics/summary.txt
new file mode 100644 (file)
index 0000000..f0529e3
--- /dev/null
@@ -0,0 +1 @@
+Binding to Mac OS X Core Graphics library
diff --git a/basis/core-graphics/tags.txt b/basis/core-graphics/tags.txt
new file mode 100644 (file)
index 0000000..2320bdd
--- /dev/null
@@ -0,0 +1,2 @@
+unportable
+bindings
diff --git a/basis/core-graphics/types/authors.txt b/basis/core-graphics/types/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/core-graphics/types/types-docs.factor b/basis/core-graphics/types/types-docs.factor
new file mode 100644 (file)
index 0000000..e35c81d
--- /dev/null
@@ -0,0 +1,29 @@
+USING: math help.markup help.syntax ;
+IN: core-graphics.types
+
+HELP: <CGRect>
+{ $values { "x" real } { "y" real } { "w" real } { "h" real } { "rect" "an " { $snippet "CGRect" } } }
+{ $description "Allocates a new " { $snippet "CGRect" } " in the Factor heap." } ;
+
+HELP: <CGPoint>
+{ $values { "x" real } { "y" real } { "point" "an " { $snippet "CGPoint" } } }
+{ $description "Allocates a new " { $snippet "CGPoint" } " in the Factor heap." } ;
+
+HELP: <CGSize>
+{ $values { "w" real } { "h" real } { "size" "an " { $snippet "CGSize" } } }
+{ $description "Allocates a new " { $snippet "CGSize" } " in the Factor heap." } ;
+
+ARTICLE: "core-graphics.types" "Core Graphics types"
+"The Core Graphics binding defines some common C structs:"
+{ $code
+    "CGRect"
+    "CGPoint"
+    "CGSize"
+}
+"Some words for working with the above:"
+{ $subsection <CGRect> }
+{ $subsection <CGPoint> }
+{ $subsection <CGSize> } ;
+
+IN: core-graphics.types
+ABOUT: "core-graphics.types"
diff --git a/basis/core-graphics/types/types-tests.factor b/basis/core-graphics/types/types-tests.factor
new file mode 100644 (file)
index 0000000..d3b081f
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test core-graphics.types ;
+IN: core-graphics.types.tests
diff --git a/basis/core-graphics/types/types.factor b/basis/core-graphics/types/types.factor
new file mode 100644 (file)
index 0000000..13e4285
--- /dev/null
@@ -0,0 +1,94 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: alien.c-types alien.syntax kernel layouts
+math math.rectangles arrays ;
+IN: core-graphics.types
+
+<< cell 4 = "float" "double" ? "CGFloat" typedef >>
+
+: <CGFloat> ( x -- alien )
+    cell 4 = [ <float> ] [ <double> ] if ; inline
+
+: *CGFloat ( alien -- x )
+    cell 4 = [ *float ] [ *double ] if ; inline
+
+C-STRUCT: CGPoint
+    { "CGFloat" "x" }
+    { "CGFloat" "y" } ;
+
+: <CGPoint> ( x y -- point )
+    "CGPoint" <c-object>
+    [ set-CGPoint-y ] keep
+    [ set-CGPoint-x ] keep ;
+
+C-STRUCT: CGSize
+    { "CGFloat" "w" }
+    { "CGFloat" "h" } ;
+
+: <CGSize> ( w h -- size )
+    "CGSize" <c-object>
+    [ set-CGSize-h ] keep
+    [ set-CGSize-w ] keep ;
+
+C-STRUCT: CGRect
+    { "CGPoint" "origin" }
+    { "CGSize"  "size"   } ;
+
+: CGPoint>loc ( CGPoint -- loc )
+    [ CGPoint-x ] [ CGPoint-y ] bi 2array ;
+
+: CGSize>dim ( CGSize -- dim )
+    [ CGSize-w ] [ CGSize-h ] bi 2array ;
+
+: CGRect>rect ( CGRect -- rect )
+    [ CGRect-origin CGPoint>loc ]
+    [ CGRect-size CGSize>dim ]
+    bi <rect> ; inline
+
+: CGRect-x ( CGRect -- x )
+    CGRect-origin CGPoint-x ; inline
+: CGRect-y ( CGRect -- y )
+    CGRect-origin CGPoint-y ; inline
+: CGRect-w ( CGRect -- w )
+    CGRect-size CGSize-w ; inline
+: CGRect-h ( CGRect -- h )
+    CGRect-size CGSize-h ; inline
+
+: set-CGRect-x ( x CGRect -- )
+    CGRect-origin set-CGPoint-x ; inline
+: set-CGRect-y ( y CGRect -- )
+    CGRect-origin set-CGPoint-y ; inline
+: set-CGRect-w ( w CGRect -- )
+    CGRect-size set-CGSize-w ; inline
+: set-CGRect-h ( h CGRect -- )
+    CGRect-size set-CGSize-h ; inline
+
+: <CGRect> ( x y w h -- rect )
+    "CGRect" <c-object>
+    [ set-CGRect-h ] keep
+    [ set-CGRect-w ] keep
+    [ set-CGRect-y ] keep
+    [ set-CGRect-x ] keep ;
+
+: CGRect-x-y ( alien -- origin-x origin-y )
+    [ CGRect-x ] [ CGRect-y ] bi ;
+
+: CGRect-top-left ( alien -- x y )
+    [ CGRect-x ] [ [ CGRect-y ] [ CGRect-h ] bi + ] bi ;
+
+C-STRUCT: CGAffineTransform
+    { "CGFloat" "a" }
+    { "CGFloat" "b" }
+    { "CGFloat" "c" }
+    { "CGFloat" "d" }
+    { "CGFloat" "tx" }
+    { "CGFloat" "ty" } ;
+
+TYPEDEF: void* CGColorRef
+TYPEDEF: void* CGColorSpaceRef
+TYPEDEF: void* CGContextRef
+TYPEDEF: uint CGBitmapInfo
+
+TYPEDEF: int CGLError
+TYPEDEF: void* CGLContextObj
+TYPEDEF: int CGLContextParameter
\ No newline at end of file
diff --git a/basis/core-text/authors.txt b/basis/core-text/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/core-text/core-text-tests.factor b/basis/core-text/core-text-tests.factor
new file mode 100644 (file)
index 0000000..93f9239
--- /dev/null
@@ -0,0 +1,37 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test core-text core-foundation
+core-foundation.dictionaries destructors
+arrays kernel generalizations math accessors
+core-foundation.utilities
+combinators hashtables colors ;
+IN: core-text.tests
+
+: test-font ( name -- font )
+    [ >cf &CFRelease 0.0 f CTFontCreateWithName ] with-destructors ;
+
+[ ] [ "Helvetica" test-font CFRelease ] unit-test
+
+[ ] [
+    [
+        kCTFontAttributeName "Helvetica" test-font &CFRelease 2array 1array
+        <CFDictionary> &CFRelease drop
+    ] with-destructors
+] unit-test
+
+: test-typographic-bounds ( string font -- ? )
+    [
+        test-font &CFRelease white <CTLine> &CFRelease
+        line-typographic-bounds {
+            [ width>> float? ]
+            [ ascent>> float? ]
+            [ descent>> float? ]
+            [ leading>> float? ]
+        } cleave and and and
+    ] with-destructors ;
+
+[ t ] [ "Hello world" "Helvetica" test-typographic-bounds ] unit-test
+
+[ t ] [ "Hello world" "Chicago" test-typographic-bounds ] unit-test
+
+[ t ] [ "日本語" "Helvetica" test-typographic-bounds ] unit-test
\ No newline at end of file
diff --git a/basis/core-text/core-text.factor b/basis/core-text/core-text.factor
new file mode 100644 (file)
index 0000000..de3b5ac
--- /dev/null
@@ -0,0 +1,145 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays alien alien.c-types alien.syntax kernel destructors
+accessors fry words hashtables strings sequences memoize assocs math
+math.vectors math.rectangles math.functions locals init namespaces
+combinators fonts colors cache core-foundation core-foundation.strings
+core-foundation.attributed-strings core-foundation.utilities
+core-graphics core-graphics.types core-text.fonts core-text.utilities ;
+IN: core-text
+
+TYPEDEF: void* CTLineRef
+
+C-GLOBAL: kCTFontAttributeName
+C-GLOBAL: kCTKernAttributeName
+C-GLOBAL: kCTLigatureAttributeName
+C-GLOBAL: kCTForegroundColorAttributeName
+C-GLOBAL: kCTParagraphStyleAttributeName
+C-GLOBAL: kCTUnderlineStyleAttributeName
+C-GLOBAL: kCTVerticalFormsAttributeName
+C-GLOBAL: kCTGlyphInfoAttributeName
+
+FUNCTION: CTLineRef CTLineCreateWithAttributedString ( CFAttributedStringRef string ) ;
+
+FUNCTION: void CTLineDraw ( CTLineRef line, CGContextRef context ) ;
+
+FUNCTION: CGFloat CTLineGetOffsetForStringIndex ( CTLineRef line, CFIndex charIndex, CGFloat* secondaryOffset ) ;
+
+FUNCTION: CFIndex CTLineGetStringIndexForPosition ( CTLineRef line, CGPoint position ) ;
+
+FUNCTION: double CTLineGetTypographicBounds ( CTLineRef line, CGFloat* ascent, CGFloat* descent, CGFloat* leading ) ;
+
+FUNCTION: CGRect CTLineGetImageBounds ( CTLineRef line, CGContextRef context ) ;
+
+ERROR: not-a-string object ;
+
+: <CTLine> ( string open-font color -- line )
+    [
+        [
+            dup selection? [ string>> ] when
+            dup string? [ not-a-string ] unless
+        ] 2dip
+        [
+            kCTForegroundColorAttributeName set
+            kCTFontAttributeName set
+        ] H{ } make-assoc <CFAttributedString> &CFRelease
+        CTLineCreateWithAttributedString
+    ] with-destructors ;
+
+TUPLE: line line metrics image loc dim disposed ;
+
+: typographic-bounds ( line -- width ascent descent leading )
+    0 <CGFloat> 0 <CGFloat> 0 <CGFloat>
+    [ CTLineGetTypographicBounds ] 3keep [ *CGFloat ] tri@ ; inline
+
+: store-typographic-bounds ( metrics width ascent descent leading -- metrics )
+    {
+        [ >>width ]
+        [ >>ascent ]
+        [ >>descent ]
+        [ >>leading ]
+    } spread ; inline
+
+: compute-font-metrics ( metrics font -- metrics )
+    [ CTFontGetCapHeight >>cap-height ]
+    [ CTFontGetXHeight >>x-height ]
+    bi ; inline
+
+: compute-line-metrics ( open-font line -- line-metrics )
+    [ metrics new ] 2dip
+    [ compute-font-metrics ]
+    [ typographic-bounds store-typographic-bounds ] bi*
+    compute-height ;
+
+: metrics>dim ( bounds -- dim )
+    [ width>> ] [ [ ascent>> ] [ descent>> ] bi + ] bi
+    [ ceiling >integer ]
+    bi@ 2array ;
+
+: fill-background ( context font dim -- )
+    [ background>> >rgba-components CGContextSetRGBFillColor ]
+    [ [ 0 0 ] dip first2 <CGRect> CGContextFillRect ]
+    bi-curry* bi ;
+
+: selection-rect ( dim line selection -- rect )
+    [ start>> ] [ end>> ] bi
+    [ f CTLineGetOffsetForStringIndex round ] bi-curry@ bi
+    [ drop nip 0 ] [ swap - swap second ] 3bi <CGRect> ;
+
+: CGRect-translate-x ( CGRect x -- CGRect' )
+    [ dup CGRect-x ] dip - over set-CGRect-x ;
+
+:: fill-selection-background ( context loc dim line string -- )
+    string selection? [
+        context string color>> >rgba-components CGContextSetRGBFillColor
+        context dim line string selection-rect
+        loc first CGRect-translate-x
+        CGContextFillRect
+    ] when ;
+
+: line-rect ( line -- rect )
+    dummy-context CTLineGetImageBounds ;
+
+: set-text-position ( context loc -- )
+    first2 [ neg ] bi@ CGContextSetTextPosition ;
+
+:: line-loc ( metrics loc dim -- loc )
+    loc first
+    metrics ascent>> ceiling dim second loc second + - 2array ;
+
+:: <line> ( font string -- line )
+    [
+        [let* | open-font [ font cache-font ]
+                line [ string open-font font foreground>> <CTLine> |CFRelease ]
+
+                rect [ line line-rect ]
+                (loc) [ rect CGRect-origin CGPoint>loc ]
+                (dim) [ rect CGRect-size CGSize>dim ]
+                (ext) [ (loc) (dim) v+ ]
+                loc [ (loc) [ floor ] map ]
+                ext [ (loc) (dim) [ + ceiling ] 2map ]
+                dim [ ext loc [ - >integer ] 2map ]
+                metrics [ open-font line compute-line-metrics ] |
+            line metrics
+            dim [
+                {
+                    [ font dim fill-background ]
+                    [ loc dim line string fill-selection-background ]
+                    [ loc set-text-position ]
+                    [ [ line ] dip CTLineDraw ]
+                } cleave
+            ] make-bitmap-image
+            metrics loc dim line-loc
+            metrics metrics>dim
+        ]
+        f line boa
+    ] with-destructors ;
+
+M: line dispose* line>> CFRelease ;
+
+SYMBOL: cached-lines
+
+: cached-line ( font string -- line )
+    cached-lines get [ <line> ] 2cache ;
+
+[ <cache-assoc> cached-lines set-global ] "core-text" add-init-hook
\ No newline at end of file
diff --git a/basis/core-text/fonts/authors.txt b/basis/core-text/fonts/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/core-text/fonts/fonts-tests.factor b/basis/core-text/fonts/fonts-tests.factor
new file mode 100644 (file)
index 0000000..45fa2bc
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test core-text.fonts ;
+IN: core-text.fonts.tests
diff --git a/basis/core-text/fonts/fonts.factor b/basis/core-text/fonts/fonts.factor
new file mode 100644 (file)
index 0000000..4525509
--- /dev/null
@@ -0,0 +1,129 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors alien.syntax assocs core-foundation
+core-foundation.strings core-text.utilities destructors init
+kernel math memoize fonts combinators ;
+IN: core-text.fonts
+
+TYPEDEF: void* CTFontRef
+TYPEDEF: void* CTFontDescriptorRef
+
+! CTFontSymbolicTraits
+: kCTFontItalicTrait ( -- n ) 0 2^ ; inline
+: kCTFontBoldTrait ( -- n ) 1 2^ ; inline
+: kCTFontExpandedTrait ( -- n ) 5 2^ ; inline
+: kCTFontCondensedTrait ( -- n ) 6 2^ ; inline
+: kCTFontMonoSpaceTrait ( -- n ) 10 2^ ; inline
+: kCTFontVerticalTrait ( -- n ) 11 2^ ; inline
+: kCTFontUIOptimizedTrait ( -- n ) 12 2^ ; inline
+
+C-GLOBAL: kCTFontSymbolicTrait
+C-GLOBAL: kCTFontWeightTrait
+C-GLOBAL: kCTFontWidthTrait
+C-GLOBAL: kCTFontSlantTrait
+
+C-GLOBAL: kCTFontNameAttribute
+C-GLOBAL: kCTFontDisplayNameAttribute
+C-GLOBAL: kCTFontFamilyNameAttribute
+C-GLOBAL: kCTFontStyleNameAttribute
+C-GLOBAL: kCTFontTraitsAttribute
+C-GLOBAL: kCTFontVariationAttribute
+C-GLOBAL: kCTFontSizeAttribute
+C-GLOBAL: kCTFontMatrixAttribute
+C-GLOBAL: kCTFontCascadeListAttribute
+C-GLOBAL: kCTFontCharacterSetAttribute
+C-GLOBAL: kCTFontLanguagesAttribute
+C-GLOBAL: kCTFontBaselineAdjustAttribute
+C-GLOBAL: kCTFontMacintoshEncodingsAttribute
+C-GLOBAL: kCTFontFeaturesAttribute
+C-GLOBAL: kCTFontFeatureSettingsAttribute
+C-GLOBAL: kCTFontFixedAdvanceAttribute
+C-GLOBAL: kCTFontOrientationAttribute
+
+FUNCTION: CTFontDescriptorRef CTFontDescriptorCreateWithAttributes (
+   CFDictionaryRef attributes
+) ;
+
+FUNCTION: CTFontRef CTFontCreateWithName (
+   CFStringRef name,
+   CGFloat size,
+   CGAffineTransform* matrix
+) ;
+
+FUNCTION: CTFontRef CTFontCreateWithFontDescriptor (
+   CTFontDescriptorRef descriptor,
+   CGFloat size,
+   CGAffineTransform* matrix
+) ;
+
+FUNCTION: CTFontRef CTFontCreateCopyWithSymbolicTraits (
+   CTFontRef font,
+   CGFloat size,
+   CGAffineTransform* matrix,
+   uint32_t symTraitValue,
+   uint32_t symTraitMask
+) ;
+
+FUNCTION: CGFloat CTFontGetAscent ( CTFontRef font ) ;
+
+FUNCTION: CGFloat CTFontGetDescent ( CTFontRef font ) ;
+
+FUNCTION: CGFloat CTFontGetLeading ( CTFontRef font ) ;
+
+FUNCTION: CGFloat CTFontGetCapHeight ( CTFontRef font ) ;
+
+FUNCTION: CGFloat CTFontGetXHeight ( CTFontRef font ) ;
+
+CONSTANT: font-names
+    H{
+        { "monospace" "Monaco" }
+        { "sans-serif" "Lucida Grande" }
+        { "serif" "Times" }
+    }
+
+: font-name ( string -- string' )
+    font-names at-default ;
+
+: (bold) ( x -- y ) kCTFontBoldTrait bitor ; inline
+
+: (italic) ( x -- y ) kCTFontItalicTrait bitor ; inline
+
+: font-traits ( font -- n )
+    [ 0 ] dip
+    [ bold?>> [ (bold) ] when ]
+    [ italic?>> [ (italic) ] when ] bi ;
+
+: apply-font-traits ( font style -- font' )
+    [ drop ] [ [ 0.0 f ] dip font-traits dup ] 2bi
+    CTFontCreateCopyWithSymbolicTraits
+    dup [ [ CFRelease ] dip ] [ drop ] if ;
+
+MEMO: (cache-font) ( font -- open-font )
+    [
+        [
+            [ name>> font-name <CFString> &CFRelease ] [ size>> ] bi
+            f CTFontCreateWithName
+        ] keep apply-font-traits
+    ] with-destructors ;
+
+: cache-font ( font -- open-font )
+    strip-font-colors (cache-font) ;
+
+MEMO: (cache-font-metrics) ( font -- metrics )
+    [ metrics new ] dip
+    (cache-font) {
+        [ CTFontGetAscent >>ascent ]
+        [ CTFontGetDescent >>descent ]
+        [ CTFontGetLeading >>leading ]
+        [ CTFontGetCapHeight >>cap-height ]
+        [ CTFontGetXHeight >>x-height ]
+    } cleave
+    compute-height ;
+
+: cache-font-metrics ( font -- metrics )
+    strip-font-colors (cache-font-metrics) ;
+
+[
+    \ (cache-font) reset-memoized
+    \ (cache-font-metrics) reset-memoized
+] "core-text.fonts" add-init-hook
diff --git a/basis/core-text/summary.txt b/basis/core-text/summary.txt
new file mode 100644 (file)
index 0000000..f6baca1
--- /dev/null
@@ -0,0 +1 @@
+Binding for Mac OS X Core Text library
diff --git a/basis/core-text/tags.txt b/basis/core-text/tags.txt
new file mode 100644 (file)
index 0000000..2320bdd
--- /dev/null
@@ -0,0 +1,2 @@
+unportable
+bindings
diff --git a/basis/core-text/utilities/authors.txt b/basis/core-text/utilities/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/core-text/utilities/utilities-tests.factor b/basis/core-text/utilities/utilities-tests.factor
new file mode 100644 (file)
index 0000000..65914a3
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test core-text.utilities ;
+IN: core-text.utilities.tests
diff --git a/basis/core-text/utilities/utilities.factor b/basis/core-text/utilities/utilities.factor
new file mode 100644 (file)
index 0000000..8c085d4
--- /dev/null
@@ -0,0 +1,9 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: words parser alien alien.c-types kernel fry accessors ;
+IN: core-text.utilities
+
+: C-GLOBAL:
+    CREATE-WORD
+    dup name>> '[ _ f dlsym *void* ]
+    (( -- value )) define-declared ; parsing
index 5f7431ecf33d0393c7f41b762b13a11ed343710a..45bc5bf50aa2b2d2b2884e57039a77a098694cb8 100644 (file)
@@ -252,8 +252,8 @@ M: already-disposed summary drop "Attempting to operate on disposed object" ;
 M: no-current-vocab summary
     drop "Not in a vocabulary; IN: form required" ;
 
-M: no-word-error summary
-    drop "Word not found in current vocabulary search path" ;
+M: no-word-error error.
+    "No word named ``" write name>> write "'' found in current vocabulary search path" print ;
 
 M: staging-violation summary
     drop
diff --git a/basis/definitions/icons/authors.txt b/basis/definitions/icons/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/definitions/icons/class-predicate-word.tiff b/basis/definitions/icons/class-predicate-word.tiff
new file mode 100644 (file)
index 0000000..f2a5df9
Binary files /dev/null and b/basis/definitions/icons/class-predicate-word.tiff differ
diff --git a/basis/definitions/icons/class-word.tiff b/basis/definitions/icons/class-word.tiff
new file mode 100644 (file)
index 0000000..16e94f7
Binary files /dev/null and b/basis/definitions/icons/class-word.tiff differ
diff --git a/basis/definitions/icons/constant-word.tiff b/basis/definitions/icons/constant-word.tiff
new file mode 100644 (file)
index 0000000..69ee5fa
Binary files /dev/null and b/basis/definitions/icons/constant-word.tiff differ
diff --git a/basis/definitions/icons/generic-word.tiff b/basis/definitions/icons/generic-word.tiff
new file mode 100644 (file)
index 0000000..17741d0
Binary files /dev/null and b/basis/definitions/icons/generic-word.tiff differ
diff --git a/basis/definitions/icons/help-article.tiff b/basis/definitions/icons/help-article.tiff
new file mode 100644 (file)
index 0000000..5fb3375
Binary files /dev/null and b/basis/definitions/icons/help-article.tiff differ
diff --git a/basis/definitions/icons/icons-tests.factor b/basis/definitions/icons/icons-tests.factor
new file mode 100644 (file)
index 0000000..47e106f
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test definitions.icons ;
+IN: definitions.icons.tests
diff --git a/basis/definitions/icons/icons.factor b/basis/definitions/icons/icons.factor
new file mode 100644 (file)
index 0000000..fb25ccf
--- /dev/null
@@ -0,0 +1,40 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: assocs classes.predicate fry generic io.pathnames kernel
+macros sequences vocabs words words.symbol words.constant
+lexer parser help.topics ;
+IN: definitions.icons
+
+GENERIC: definition-icon ( definition -- path )
+
+<PRIVATE
+
+: definition-icon-path ( string -- string' )
+    "resource:basis/definitions/icons/" prepend-path ".tiff" append ;
+
+<<
+
+: ICON:
+    scan-word \ definition-icon create-method
+    scan '[ drop _ definition-icon-path ]
+    define ; parsing
+
+>>
+
+ICON: predicate-class class-predicate-word
+ICON: generic generic-word
+ICON: macro macro-word
+ICON: parsing-word parsing-word
+ICON: primitive primitive-word
+ICON: symbol symbol-word
+ICON: constant constant-word
+ICON: word normal-word
+ICON: vocab-link unopen-vocab
+ICON: word-link word-help-article
+ICON: link help-article
+
+PRIVATE>
+
+M: vocab definition-icon
+    vocab-main "runnable-vocab" "open-vocab" ? definition-icon-path ;
+    
\ No newline at end of file
diff --git a/basis/definitions/icons/macro-word.tiff b/basis/definitions/icons/macro-word.tiff
new file mode 100644 (file)
index 0000000..040a243
Binary files /dev/null and b/basis/definitions/icons/macro-word.tiff differ
diff --git a/basis/definitions/icons/normal-word.tiff b/basis/definitions/icons/normal-word.tiff
new file mode 100644 (file)
index 0000000..ad837eb
Binary files /dev/null and b/basis/definitions/icons/normal-word.tiff differ
diff --git a/basis/definitions/icons/open-vocab.tiff b/basis/definitions/icons/open-vocab.tiff
new file mode 100644 (file)
index 0000000..e12a8e8
Binary files /dev/null and b/basis/definitions/icons/open-vocab.tiff differ
diff --git a/basis/definitions/icons/parsing-word.tiff b/basis/definitions/icons/parsing-word.tiff
new file mode 100644 (file)
index 0000000..220ad1b
Binary files /dev/null and b/basis/definitions/icons/parsing-word.tiff differ
diff --git a/basis/definitions/icons/primitive-word.tiff b/basis/definitions/icons/primitive-word.tiff
new file mode 100644 (file)
index 0000000..ade5195
Binary files /dev/null and b/basis/definitions/icons/primitive-word.tiff differ
diff --git a/basis/definitions/icons/runnable-vocab.tiff b/basis/definitions/icons/runnable-vocab.tiff
new file mode 100644 (file)
index 0000000..eef52e3
Binary files /dev/null and b/basis/definitions/icons/runnable-vocab.tiff differ
diff --git a/basis/definitions/icons/symbol-word.tiff b/basis/definitions/icons/symbol-word.tiff
new file mode 100644 (file)
index 0000000..a00f84e
Binary files /dev/null and b/basis/definitions/icons/symbol-word.tiff differ
diff --git a/basis/definitions/icons/unopen-vocab.tiff b/basis/definitions/icons/unopen-vocab.tiff
new file mode 100644 (file)
index 0000000..892e64b
Binary files /dev/null and b/basis/definitions/icons/unopen-vocab.tiff differ
diff --git a/basis/definitions/icons/word-help-article.tiff b/basis/definitions/icons/word-help-article.tiff
new file mode 100644 (file)
index 0000000..8ec1bf7
Binary files /dev/null and b/basis/definitions/icons/word-help-article.tiff differ
index 7d297af1ed1dd75b7e0d8ae39dd23726869b445f..4b024077354d29a24eae100d68ee9050e8eb6502 100644 (file)
@@ -1,6 +1,6 @@
 USING: delegate kernel arrays tools.test words math definitions
 compiler.units parser generic prettyprint io.streams.string
-accessors eval ;
+accessors eval multiline ;
 IN: delegate.tests
 
 TUPLE: hello this that ;
@@ -38,7 +38,7 @@ M: hello bing hello-test ;
 [ H{ { goodbye [ these>> ] } } ] [ baz protocol-consult ] unit-test
 [ H{ } ] [ bee protocol-consult ] unit-test
 
-[ "USING: delegate ;\nIN: delegate.tests\nPROTOCOL: baz foo bar { whoa 1 } ;\n" ] [ [ baz see ] with-string-writer ] unit-test
+[ "USING: delegate ;\nIN: delegate.tests\nPROTOCOL: baz foo bar { whoa 1 } ; inline\n" ] [ [ baz see ] with-string-writer ] unit-test
 
 GENERIC: one
 M: integer one ;
@@ -91,3 +91,56 @@ CONSULT: slot-protocol-test-2 slot-protocol-test-3 d>> ;
     T{ slot-protocol-test-3 f T{ slot-protocol-test-2 f "a" "b" 5 } }
     [ a>> ] [ b>> ] [ c>> ] tri
 ] unit-test
+
+GENERIC: do-me ( x -- )
+
+M: f do-me drop ;
+
+[ ] [ f do-me ] unit-test
+
+TUPLE: a-tuple ;
+
+PROTOCOL: silly-protocol do-me ;
+
+! Replacing a method definition with a consultation would cause problems
+[ [ ] ] [
+    <" IN: delegate.tests
+    USE: kernel
+
+    M: a-tuple do-me drop ; "> <string-reader> "delegate-test" parse-stream
+] unit-test
+
+[ ] [ T{ a-tuple } do-me ] unit-test
+
+[ [ ] ] [
+    <" IN: delegate.tests
+    USE: kernel
+    USE: delegate
+    CONSULT: silly-protocol a-tuple drop f ; "> <string-reader> "delegate-test" parse-stream
+] unit-test
+
+[ ] [ T{ a-tuple } do-me ] unit-test
+
+! A slot protocol issue
+DEFER: slot-protocol-test-3
+SLOT: y
+
+[ f ] [ \ y>> \ slot-protocol-test-3 method >boolean ] unit-test
+
+[ [ ] ] [
+    <" IN: delegate.tests
+USING: accessors delegate ;
+TUPLE: slot-protocol-test-3 x ;
+CONSULT: y>> slot-protocol-test-3 x>> ;">
+    <string-reader> "delegate-test-1" parse-stream
+] unit-test
+
+[ t ] [ \ y>> \ slot-protocol-test-3 method >boolean ] unit-test
+
+[ [ ] ] [
+    <" IN: delegate.tests
+TUPLE: slot-protocol-test-3 x y ;">
+    <string-reader> "delegate-test-1" parse-stream
+] unit-test
+
+[ t ] [ \ y>> \ slot-protocol-test-3 method >boolean ] unit-test
\ No newline at end of file
index 4da22441143e5a3a0766b83a0b420b74f8bf6285..a4eef54907fd078dcc1478f17b1249ec94fcfebc 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2007, 2008 Daniel Ehrenberg
+! Portions copyright (C) 2009 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors parser generic kernel classes classes.tuple
-words slots assocs sequences arrays vectors definitions
-math hashtables sets generalizations namespaces make
-words.symbol ;
+USING: accessors arrays assocs classes.tuple definitions generic
+generic.standard hashtables kernel lexer make math parser
+generic.parser sequences sets slots words words.symbol fry ;
 IN: delegate
 
 : protocol-words ( protocol -- words )
@@ -14,6 +14,9 @@ IN: delegate
 
 GENERIC: group-words ( group -- words )
 
+M: standard-generic group-words
+    dup "combination" word-prop #>> 2array 1array ;
+
 M: tuple-class group-words
     all-slots [
         name>>
@@ -25,19 +28,20 @@ M: tuple-class group-words
 ! Consultation
 
 : consult-method ( word class quot -- )
-    [ drop swap first create-method ]
-    [ nip [ , dup second , \ ndip , first , ] [ ] make ] 3bi
+    [ drop swap first create-method-in ]
+    [ nip [ swap [ second [ [ dip ] curry ] times % ] [ first , ] bi ] [ ] make ] 3bi
     define ;
 
 : change-word-prop ( word prop quot -- )
-    rot props>> swap change-at ; inline
+    [ swap props>> ] dip change-at ; inline
 
 : register-protocol ( group class quot -- )
-    rot \ protocol-consult [ swapd ?set-at ] change-word-prop ;
+    [ \ protocol-consult ] 2dip
+    '[ [ _ _ swap ] dip ?set-at ] change-word-prop ;
 
 : define-consult ( group class quot -- )
     [ register-protocol ]
-    [ [ group-words ] 2dip [ consult-method ] 2curry each ]
+    [ [ group-words ] 2dip '[ _ _ consult-method ] each ]
     3bi ;
 
 : CONSULT:
@@ -78,16 +82,15 @@ M: tuple-class group-words
     [ dup word? [ 0 2array ] when ] map ;
 
 : define-protocol ( protocol wordlist -- )
-    fill-in-depth
-    [ forget-old-definitions ]
-    [ add-new-definitions ]
-    [ initialize-protocol-props ] 2tri ;
+    [ drop define-symbol ] [
+        fill-in-depth
+        [ forget-old-definitions ]
+        [ add-new-definitions ]
+        [ initialize-protocol-props ] 2tri
+    ] 2bi ;
 
 : PROTOCOL:
-    CREATE-WORD
-    [ define-symbol ]
-    [ f "inline" set-word-prop ]
-    [ parse-definition define-protocol ] tri ; parsing
+    CREATE-WORD parse-definition define-protocol ; parsing
 
 PREDICATE: protocol < word protocol-words ; ! Subclass of symbol?
 
@@ -102,3 +105,8 @@ M: protocol definition protocol-words show-words ;
 M: protocol definer drop \ PROTOCOL: \ ; ;
 
 M: protocol group-words protocol-words ;
+
+: SLOT-PROTOCOL:
+    CREATE-WORD ";" parse-tokens
+    [ [ reader-word ] [ writer-word ] bi 2array ] map concat
+    define-protocol ; parsing
\ No newline at end of file
index edbec804c1cbd7c1a496cefc7a6160104f0a3bb1..f568a3e3885b09285c3a02c7b16dc895348d6fd8 100644 (file)
@@ -1,27 +1,25 @@
 ! Copyright (C) 2007 Daniel Ehrenberg
 ! See http://factorcode.org/license.txt for BSD license.
 USING: delegate sequences.private sequences assocs
-io io.styles definitions kernel continuations ;
+io definitions kernel continuations ;
 IN: delegate.protocols
 
 PROTOCOL: sequence-protocol
-    clone clone-like like new-sequence new-resizable nth
-    nth-unsafe set-nth set-nth-unsafe length set-length
-    lengthen ;
+like new-sequence new-resizable nth nth-unsafe
+set-nth set-nth-unsafe length set-length
+lengthen ;
 
 PROTOCOL: assoc-protocol
-    at* assoc-size >alist set-at assoc-clone-like
-    delete-at clear-assoc new-assoc assoc-like ;
+at* assoc-size >alist set-at assoc-clone-like
+delete-at clear-assoc new-assoc assoc-like ;
 
 PROTOCOL: input-stream-protocol
-    stream-read1 stream-read stream-read-partial stream-readln
-    stream-read-until ;
+stream-read1 stream-read stream-read-partial stream-readln
+stream-read-until ;
 
 PROTOCOL: output-stream-protocol
-    stream-flush stream-write1 stream-write stream-format
-    stream-nl make-span-stream make-block-stream
-    make-cell-stream stream-write-table ;
+stream-flush stream-write1 stream-write stream-nl ;
 
 PROTOCOL: definition-protocol
-    where set-where forget uses
-    synopsis* definer definition ;
+where set-where forget uses
+synopsis* definer definition ;
index 974645b2841d88d533d9dc859afa37d92725b44e..a0b1eeb118ff2cd693a8b14d885c744c80023655 100644 (file)
@@ -91,39 +91,8 @@ HELP: clear-doc
 { $description "Removes all text from the document." }
 { $side-effects "document" } ;
 
-HELP: prev-elt
-{ $values { "loc" "a pair of integers" } { "document" document } { "elt" "an element" } { "newloc" "a pair of integers" } }
-{ $contract "Outputs the location of the first occurrence of the element prior to " { $snippet "loc" } "." } ;
-
-{ prev-elt next-elt } related-words
-
-HELP: next-elt
-{ $values { "loc" "a pair of integers" } { "document" document } { "elt" "an element" } { "newloc" "a pair of integers" } }
-{ $contract "Outputs the location of the first occurrence of the element following " { $snippet "loc" } "." } ;
-
-HELP: char-elt
-{ $class-description "An element representing a single character." } ;
-
-HELP: one-word-elt
-{ $class-description "An element representing a single word. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the beginning and the end of the word at the current location." } ;
-
-{ one-word-elt word-elt } related-words
-
-HELP: word-elt
-{ $class-description "An element representing a single word. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the previous and next word from the current location." } ;
-
-HELP: one-line-elt
-{ $class-description "An element representing a single line. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the beginning and the end of the line at the current location." } ;
-
-{ one-line-elt line-elt } related-words
-
-HELP: line-elt
-{ $class-description "An element representing a single line. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the previous and next line from the current location." } ;
-
-HELP: doc-elt
-{ $class-description "An element representing the entire document. The " { $link prev-elt } " word outputs the start of the document and the " { $link next-elt } " word outputs the end of the document." } ;
-
 ARTICLE: "documents" "Documents"
+"The " { $vocab-link "documents" } " vocabulary implements " { $emphasis "documents" } ", which are models storing a passage of text as a sequence of lines. Operations are defined for operating on subranges of the text, and " { $link "ui.gadgets.editors" } " can display these models."
 { $subsection document }
 { $subsection <document> }
 "Getting and setting the contents of the entire document:"
@@ -138,24 +107,18 @@ ARTICLE: "documents" "Documents"
 { $subsection remove-doc-range }
 "A combinator:"
 { $subsection each-line }
-{ $see-also "gadgets-editors" } ;
+{ $subsection "document-locs" }
+{ $subsection "documents.elements" }
+{ $see-also "ui.gadgets.editors" } ;
 
-ARTICLE: "document-locs-elts" "Locations and elements"
+ARTICLE: "document-locs" "Document locations"
 "Locations in the document are represented as a line/column number pair, with both indices being zero-based. There are some words for manipulating locations:"
 { $subsection +col }
 { $subsection +line }
 { $subsection =col }
 { $subsection =line }
-"New locations can be created out of existing ones by finding the start or end of a document element nearest to a given location."
-{ $subsection prev-elt }
-{ $subsection next-elt }
-"The different types of document elements correspond to the standard editing taxonomy:"
-{ $subsection char-elt }
-{ $subsection one-word-elt }
-{ $subsection word-elt }
-{ $subsection one-line-elt }
-{ $subsection line-elt }
-{ $subsection doc-elt }
 "Miscellaneous words for working with locations:"
 { $subsection lines-equal? }
 { $subsection validate-loc } ;
+
+ABOUT: "documents"
index 88e471cce1eca37b1b77de6a8a451b40dc2ba3e7..b0ff3bc8d8876a6e22501045949f0a2184ab535e 100644 (file)
@@ -1,5 +1,6 @@
 IN: documents.tests
-USING: documents namespaces tools.test make arrays kernel fry ;
+USING: documents documents.private accessors sequences
+namespaces tools.test make arrays kernel fry ;
 
 ! Tests
 
@@ -88,19 +89,65 @@ USING: documents namespaces tools.test make arrays kernel fry ;
     "doc" get doc-string
 ] unit-test
 
-<document> "doc" set
-"Hello world" "doc" get set-doc-string
-[ { 0 0 } ] [ { 0 0 } "doc" get T{ one-word-elt } prev-elt ] unit-test
-[ { 0 0 } ] [ { 0 2 } "doc" get T{ one-word-elt } prev-elt ] unit-test
-[ { 0 0 } ] [ { 0 5 } "doc" get T{ one-word-elt } prev-elt ] unit-test
-[ { 0 5 } ] [ { 0 2 } "doc" get T{ one-word-elt } next-elt ] unit-test
-[ { 0 5 } ] [ { 0 5 } "doc" get T{ one-word-elt } next-elt ] unit-test
-
 <document> "doc" set
 "Hello\nworld, how are\nyou?" "doc" get set-doc-string
 
 [ { 2 4 } ] [ "doc" get doc-end ] unit-test
 
-[ { 0 0 } ] [ { 0 3 } "doc" get T{ line-elt } prev-elt ] unit-test
-[ { 0 3 } ] [ { 1 3 } "doc" get T{ line-elt } prev-elt ] unit-test
-[ { 2 4 } ] [ { 2 1 } "doc" get T{ line-elt } next-elt ] unit-test
+! Undo/redo
+[ ] [ <document> "d" set ] unit-test
+
+[ ] [ "Hello, world." "d" get set-doc-string ] unit-test
+
+[
+    T{ edit
+       { old-string "" }
+       { new-string "Hello, world." }
+       { from { 0 0 } }
+       { old-to { 0 0 } }
+       { new-to { 0 13 } }
+    }
+] [ "d" get undos>> first ] unit-test
+
+[ ] [ "Goodbye" { 0 0 } { 0 5 } "d" get set-doc-range ] unit-test
+
+[ "Goodbye, world." ] [ "d" get doc-string ] unit-test
+
+[ ] [ "cruel " { 0 9 } { 0 9 } "d" get set-doc-range ] unit-test
+
+[ 3 ] [ "d" get undos>> length ] unit-test
+
+[ "Goodbye, cruel world." ] [ "d" get doc-string ] unit-test
+
+[ "" { 0 9 } { 0 15 } ] [
+    "d" get undos>> peek
+    [ old-string>> ] [ from>> ] [ new-to>> ] tri
+] unit-test
+
+[ ] [ "d" get undo ] unit-test
+
+[ "Goodbye, world." ] [ "d" get doc-string ] unit-test
+
+[ ] [ "d" get undo ] unit-test
+
+[ "Hello, world." ] [ "d" get doc-string ] unit-test
+
+[ ] [ "d" get redo ] unit-test
+
+[ "Goodbye, world." ] [ "d" get doc-string ] unit-test
+
+[ ] [ <document> "d" set ] unit-test
+
+[ ] [ "d" get clear-doc ] unit-test
+
+[ ] [ "d" get clear-doc ] unit-test
+
+[ 0 ] [ "d" get undos>> length ] unit-test
+
+[ ] [ <document> "d" set ] unit-test
+
+[ ] [ "d" get value>> "value" set ] unit-test
+
+[ ] [ "Hello world" "d" get set-doc-string ] unit-test
+
+[ { "" } ] [ "value" get ] unit-test
\ No newline at end of file
index 29f865cf3c7673d7603ded2cbf062c4b1f94a2a3..451c91277974fec8bcbd5813d79b5aadc4a202d9 100644 (file)
@@ -1,8 +1,8 @@
-! Copyright (C) 2006, 2008 Slava Pestov
+! Copyright (C) 2006, 2009 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays io kernel math models namespaces make
 sequences strings splitting combinators unicode.categories
-math.order math.ranges ;
+math.order math.ranges fry locals ;
 IN: documents
 
 : +col ( loc n -- newloc ) [ first2 ] dip + 2array ;
@@ -15,11 +15,21 @@ IN: documents
 
 : lines-equal? ( loc1 loc2 -- ? ) [ first ] bi@ number= ;
 
-TUPLE: document < model locs ;
+TUPLE: edit old-string new-string from old-to new-to ;
+
+C: <edit> edit
+
+TUPLE: document < model locs undos redos inside-undo? ;
+
+: clear-undo ( document -- )
+    V{ } clone >>undos
+    V{ } clone >>redos
+    drop ;
 
 : <document> ( -- document )
-    V{ "" } clone document new-model
-    V{ } clone >>locs ;
+    { "" } document new-model
+    V{ } clone >>locs
+    dup clear-undo ;
 
 : add-loc ( loc document -- ) locs>> push ;
 
@@ -30,41 +40,43 @@ TUPLE: document < model locs ;
 
 : doc-line ( n document -- string ) value>> nth ;
 
+: line-end ( line# document -- loc )
+    [ drop ] [ doc-line length ] 2bi 2array ;
+
 : doc-lines ( from to document -- slice )
-    [ 1+ ] dip value>> <slice> ;
+    [ 1+ ] [ value>> ] bi* <slice> ;
 
-: start-on-line ( document from line# -- n1 )
-    [ dup first ] dip = [ nip second ] [ 2drop 0 ] if ;
+: start-on-line ( from line# document -- n1 )
+    drop over first =
+    [ second ] [ drop 0 ] if ;
 
-: end-on-line ( document to line# -- n2 )
-    over first over = [
-        drop second nip
-    ] [
-        nip swap doc-line length
-    ] if ;
+:: end-on-line ( to line# document -- n2 )
+    to first line# =
+    [ to second ] [ line# document doc-line length ] if ;
 
 : each-line ( from to quot -- )
-    2over = [
-        3drop
-    ] [
+    2over = [ 3drop ] [
         [ [ first ] bi@ [a,b] ] dip each
     ] if ; inline
 
-: start/end-on-line ( from to line# -- n1 n2 )
-    tuck
-    [ [ document get ] 2dip start-on-line ]
-    [ [ document get ] 2dip end-on-line ]
-    2bi* ;
+: map-lines ( from to quot -- results )
+    accumulator [ each-line ] dip ; inline
 
-: (doc-range) ( from to line# -- )
-    [ start/end-on-line ] keep document get doc-line <slice> , ;
+: start/end-on-line ( from to line# document -- n1 n2 )
+    [ start-on-line ] [ end-on-line ] bi-curry bi-curry bi* ;
 
-: doc-range ( from to document -- string )
-    [
-        document set 2dup [
-            [ 2dup ] dip (doc-range)
-        ] each-line 2drop
-    ] { } make "\n" join ;
+: last-line# ( document -- line )
+    value>> length 1- ;
+
+CONSTANT: doc-start { 0 0 }
+
+: doc-end ( document -- loc )
+    [ last-line# ] keep line-end ;
+
+<PRIVATE
+
+: (doc-range) ( from to line# document -- slice )
+    [ start/end-on-line ] 2keep doc-line <slice> ;
 
 : text+loc ( lines loc -- loc )
     over [
@@ -84,158 +96,98 @@ TUPLE: document < model locs ;
 : loc-col/str ( loc document -- str col )
     [ first2 swap ] dip nth swap ;
 
-: prepare-insert ( newinput from to lines -- newinput )
-    tuck [ loc-col/str head-slice ] [ loc-col/str tail-slice ] 2bi*
+: prepare-insert ( new-lines from to lines -- new-lines )
+    [ loc-col/str head-slice ] [ loc-col/str tail-slice ] bi-curry bi*
     pick append-last over prepend-first ;
 
-: (set-doc-range) ( newlines from to lines -- )
+: (set-doc-range) ( doc-lines from to lines -- changed-lines )
     [ prepare-insert ] 3keep
     [ [ first ] bi@ 1+ ] dip
     replace-slice ;
 
-: set-doc-range ( string from to document -- )
-    [
-        [ [ string-lines ] dip [ text+loc ] 2keep ] 2dip
-        [ [ (set-doc-range) ] keep ] change-model
-    ] keep update-locs ;
+: entire-doc ( document -- start end document )
+    [ [ doc-start ] dip doc-end ] keep ;
+
+: with-undo ( document quot: ( document -- ) -- )
+    [ t >>inside-undo? ] dip keep f >>inside-undo? drop ; inline
+
+PRIVATE>
+
+: doc-range ( from to document -- string )
+    [ 2dup ] dip
+    '[ [ 2dup ] dip _ (doc-range) ] map-lines
+    2nip "\n" join ;
+
+: add-undo ( edit document -- )
+    dup inside-undo?>> [ 2drop ] [
+        [ undos>> push ] keep
+        redos>> delete-all
+    ] if ;
+
+:: set-doc-range ( string from to document -- )
+    from to = string empty? and [
+        string string-lines :> new-lines
+        new-lines from text+loc :> new-to
+        from to document doc-range :> old-string
+        old-string string from to new-to <edit> document add-undo
+        new-lines from to document [ (set-doc-range) ] change-model
+        new-to document update-locs
+    ] unless ;
+
+: change-doc-range ( from to document quot -- )
+    '[ doc-range @ ] 3keep set-doc-range ; inline
 
 : remove-doc-range ( from to document -- )
     [ "" ] 3dip set-doc-range ;
 
-: last-line# ( document -- line )
-    value>> length 1- ;
-
 : validate-line ( line document -- line )
     last-line# min 0 max ;
 
 : validate-col ( col line document -- col )
     doc-line length min 0 max ;
 
-: line-end ( line# document -- loc )
-    dupd doc-line length 2array ;
-
 : line-end? ( loc document -- ? )
     [ first2 swap ] dip doc-line length = ;
 
-: doc-end ( document -- loc )
-    [ last-line# ] keep line-end ;
-
 : validate-loc ( loc document -- newloc )
-    over first over value>> length >= [
+    2dup [ first ] [ value>> length ] bi* >= [
         nip doc-end
     ] [
         over first 0 < [
             2drop { 0 0 }
         ] [
-            [ first2 swap tuck ] dip validate-col 2array
+            [ first2 over ] dip validate-col 2array
         ] if
     ] if ;
 
 : doc-string ( document -- str )
-    value>> "\n" join ;
+    entire-doc doc-range ;
 
 : set-doc-string ( string document -- )
-    [ string-lines V{ } like ] dip [ set-model ] keep
-    [ doc-end ] [ update-locs ] bi ;
+    entire-doc set-doc-range ;
 
 : clear-doc ( document -- )
-    "" swap set-doc-string ;
-
-GENERIC: prev-elt ( loc document elt -- newloc )
-GENERIC: next-elt ( loc document elt -- newloc )
-
-: prev/next-elt ( loc document elt -- start end )
-    [ prev-elt ] [ next-elt ] 3bi ;
-
-: elt-string ( loc document elt -- string )
-    [ prev/next-elt ] [ drop ] 2bi doc-range ;
-
-TUPLE: char-elt ;
-
-: (prev-char) ( loc document quot -- loc )
-    {
-        { [ pick { 0 0 } = ] [ 2drop ] }
-        { [ pick second zero? ] [ drop [ first 1- ] dip line-end ] }
-        [ call ]
-    } cond ; inline
-
-: (next-char) ( loc document quot -- loc )
-    {
-        { [ 2over doc-end = ] [ 2drop ] }
-        { [ 2over line-end? ] [ 2drop first 1+ 0 2array ] }
-        [ call ]
-    } cond ; inline
-
-M: char-elt prev-elt
-    drop [ drop -1 +col ] (prev-char) ;
-
-M: char-elt next-elt
-    drop [ drop 1 +col ] (next-char) ;
-
-TUPLE: one-char-elt ;
-
-M: one-char-elt prev-elt 2drop ;
-
-M: one-char-elt next-elt 2drop ;
-
-: (word-elt) ( loc document quot -- loc )
-    pick [
-        [ [ first2 swap ] dip doc-line ] dip call
-    ] dip =col ; inline
-
-: ((word-elt)) ( n seq -- ? n seq ) [ ?nth blank? ] 2keep ;
-
-: break-detector ( ? -- quot )
-    [ [ blank? ] dip xor ] curry ; inline
-
-: (prev-word) ( ? col str -- col )
-    rot break-detector find-last-from drop ?1+ ;
-
-: (next-word) ( ? col str -- col )
-    [ rot break-detector find-from drop ] keep
-    over not [ nip length ] [ drop ] if ;
-
-TUPLE: one-word-elt ;
-
-M: one-word-elt prev-elt
-    drop
-    [ [ [ f ] dip 1- ] dip (prev-word) ] (word-elt) ;
-
-M: one-word-elt next-elt
-    drop
-    [ [ f ] 2dip (next-word) ] (word-elt) ;
-
-TUPLE: word-elt ;
-
-M: word-elt prev-elt
-    drop
-    [ [ [ 1- ] dip ((word-elt)) (prev-word) ] (word-elt) ]
-    (prev-char) ;
-
-M: word-elt next-elt
-    drop
-    [ [ ((word-elt)) (next-word) ] (word-elt) ]
-    (next-char) ;
-
-TUPLE: one-line-elt ;
+    [ "" ] dip set-doc-string ;
 
-M: one-line-elt prev-elt
-    2drop first 0 2array ;
+<PRIVATE
 
-M: one-line-elt next-elt
-    drop [ first dup ] dip doc-line length 2array ;
+: undo/redo-edit ( edit document string-quot to-quot -- )
+    '[ [ _ [ from>> ] _ tri ] dip set-doc-range ] with-undo ; inline
 
-TUPLE: line-elt ;
+: undo-edit ( edit document -- )
+    [ old-string>> ] [ new-to>> ] undo/redo-edit ;
 
-M: line-elt prev-elt
-    2drop dup first zero? [ drop { 0 0 } ] [ -1 +line ] if ;
+: redo-edit ( edit document -- )
+    [ new-string>> ] [ old-to>> ] undo/redo-edit ;
 
-M: line-elt next-elt
-    drop over first over last-line# number=
-    [ nip doc-end ] [ drop 1 +line ] if ;
+: undo/redo ( document source-quot dest-quot do-quot -- )
+    [ dupd call [ drop ] ] 2dip
+    '[ pop swap [ @ push ] _ 2bi ] if-empty ; inline
 
-TUPLE: doc-elt ;
+PRIVATE>
 
-M: doc-elt prev-elt 3drop { 0 0 } ;
+: undo ( document -- )
+    [ undos>> ] [ redos>> ] [ undo-edit ] undo/redo ;
 
-M: doc-elt next-elt drop nip doc-end ;
+: redo ( document -- )
+    [ redos>> ] [ undos>> ] [ redo-edit ] undo/redo ;
\ No newline at end of file
diff --git a/basis/documents/elements/authors.txt b/basis/documents/elements/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/documents/elements/elements-docs.factor b/basis/documents/elements/elements-docs.factor
new file mode 100644 (file)
index 0000000..935f927
--- /dev/null
@@ -0,0 +1,50 @@
+USING: help.markup help.syntax documents ;
+IN: documents.elements
+
+HELP: prev-elt
+{ $values { "loc" "a pair of integers" } { "document" document } { "elt" "an element" } { "newloc" "a pair of integers" } }
+{ $contract "Outputs the location of the first occurrence of the element prior to " { $snippet "loc" } "." } ;
+
+{ prev-elt next-elt } related-words
+
+HELP: next-elt
+{ $values { "loc" "a pair of integers" } { "document" document } { "elt" "an element" } { "newloc" "a pair of integers" } }
+{ $contract "Outputs the location of the first occurrence of the element following " { $snippet "loc" } "." } ;
+
+HELP: char-elt
+{ $class-description "An element representing a single character." } ;
+
+HELP: one-word-elt
+{ $class-description "An element representing a single word. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the beginning and the end of the word at the current location." } ;
+
+{ one-word-elt word-elt } related-words
+
+HELP: word-elt
+{ $class-description "An element representing a single word. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the previous and next word from the current location." } ;
+
+HELP: one-line-elt
+{ $class-description "An element representing a single line. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the beginning and the end of the line at the current location." } ;
+
+{ one-line-elt line-elt } related-words
+
+HELP: line-elt
+{ $class-description "An element representing a single line. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the previous and next line from the current location." } ;
+
+HELP: doc-elt
+{ $class-description "An element representing the entire document. The " { $link prev-elt } " word outputs the start of the document and the " { $link next-elt } " word outputs the end of the document." } ;
+
+ARTICLE: "documents.elements" "Document elements"
+"Document elements, defined in the " { $vocab-link "documents.elements" } " vocabulary, overlay a hierarchy of structure on top of the flat sequence of characters presented by the document."
+$nl
+"The different types of document elements correspond to the standard editing taxonomy:"
+{ $subsection char-elt }
+{ $subsection one-word-elt }
+{ $subsection word-elt }
+{ $subsection one-line-elt }
+{ $subsection line-elt }
+{ $subsection doc-elt }
+"New locations can be created out of existing ones by finding the start or end of a document element nearest to a given location."
+{ $subsection prev-elt }
+{ $subsection next-elt } ;
+
+ABOUT: "documents.elements"
\ No newline at end of file
diff --git a/basis/documents/elements/elements-tests.factor b/basis/documents/elements/elements-tests.factor
new file mode 100644 (file)
index 0000000..a3f05d7
--- /dev/null
@@ -0,0 +1,70 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test namespaces documents documents.elements multiline ;
+IN: document.elements.tests
+
+<document> "doc" set
+"123\nabc" "doc" get set-doc-string
+
+! char-elt
+[ { 0 0 } ] [ { 0 0 } "doc" get char-elt prev-elt ] unit-test
+[ { 0 0 } ] [ { 0 1 } "doc" get char-elt prev-elt ] unit-test
+[ { 0 3 } ] [ { 1 0 } "doc" get char-elt prev-elt ] unit-test
+
+[ { 1 3 } ] [ { 1 3 } "doc" get char-elt next-elt ] unit-test
+[ { 0 2 } ] [ { 0 1 } "doc" get char-elt next-elt ] unit-test
+[ { 1 0 } ] [ { 0 3 } "doc" get char-elt next-elt ] unit-test
+
+! word-elt
+<document> "doc" set
+"Hello world\nanother line" "doc" get set-doc-string
+
+[ { 0 0 } ] [ { 0 0 } "doc" get word-elt prev-elt ] unit-test
+[ { 0 0 } ] [ { 0 2 } "doc" get word-elt prev-elt ] unit-test
+[ { 0 0 } ] [ { 0 5 } "doc" get word-elt prev-elt ] unit-test
+[ { 0 5 } ] [ { 0 6 } "doc" get word-elt prev-elt ] unit-test
+[ { 0 6 } ] [ { 0 8 } "doc" get word-elt prev-elt ] unit-test
+[ { 0 11 } ] [ { 1 0 } "doc" get word-elt prev-elt ] unit-test
+
+[ { 0 5 } ] [ { 0 0 } "doc" get word-elt next-elt ] unit-test
+[ { 0 6 } ] [ { 0 5 } "doc" get word-elt next-elt ] unit-test
+[ { 0 11 } ] [ { 0 6 } "doc" get word-elt next-elt ] unit-test
+[ { 1 0 } ] [ { 0 11 } "doc" get word-elt next-elt ] unit-test
+
+! one-word-elt
+[ { 0 0 } ] [ { 0 0 } "doc" get one-word-elt prev-elt ] unit-test
+[ { 0 0 } ] [ { 0 2 } "doc" get one-word-elt prev-elt ] unit-test
+[ { 0 0 } ] [ { 0 5 } "doc" get one-word-elt prev-elt ] unit-test
+[ { 0 5 } ] [ { 0 2 } "doc" get one-word-elt next-elt ] unit-test
+[ { 0 5 } ] [ { 0 5 } "doc" get one-word-elt next-elt ] unit-test
+
+! line-elt
+<document> "doc" set
+"Hello\nworld, how are\nyou?" "doc" get set-doc-string
+
+[ { 0 0 } ] [ { 0 3 } "doc" get line-elt prev-elt ] unit-test
+[ { 0 3 } ] [ { 1 3 } "doc" get line-elt prev-elt ] unit-test
+[ { 2 4 } ] [ { 2 1 } "doc" get line-elt next-elt ] unit-test
+
+! one-line-elt
+[ { 1 0 } ] [ { 1 3 } "doc" get one-line-elt prev-elt ] unit-test
+[ { 1 14 } ] [ { 1 3 } "doc" get one-line-elt next-elt ] unit-test
+
+! page-elt
+<document> "doc" set
+<" First line
+Second line
+Third line
+Fourth line
+Fifth line
+Sixth line"> "doc" get set-doc-string
+
+[ { 0 0 } ] [ { 3 3 } "doc" get 4 <page-elt> prev-elt ] unit-test
+[ { 1 2 } ] [ { 5 2 } "doc" get 4 <page-elt> prev-elt ] unit-test
+
+[ { 4 3 } ] [ { 0 3 } "doc" get 4 <page-elt> next-elt ] unit-test
+[ { 5 10 } ] [ { 4 2 } "doc" get 4 <page-elt> next-elt ] unit-test
+
+! doc-elt
+[ { 0 0 } ] [ { 3 4 } "doc" get doc-elt prev-elt ] unit-test
+[ { 5 10 } ] [ { 3 4 } "doc" get doc-elt next-elt ] unit-test
\ No newline at end of file
diff --git a/basis/documents/elements/elements.factor b/basis/documents/elements/elements.factor
new file mode 100644 (file)
index 0000000..adb498d
--- /dev/null
@@ -0,0 +1,121 @@
+! Copyright (C) 2006, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays combinators documents fry kernel math sequences
+unicode.categories accessors ;
+IN: documents.elements
+
+GENERIC: prev-elt ( loc document elt -- newloc )
+GENERIC: next-elt ( loc document elt -- newloc )
+
+: prev/next-elt ( loc document elt -- start end )
+    [ prev-elt ] [ next-elt ] 3bi ;
+
+: elt-string ( loc document elt -- string )
+    [ prev/next-elt ] [ drop ] 2bi doc-range ;
+
+: set-elt-string ( string loc document elt -- )
+    [ prev/next-elt ] [ drop ] 2bi set-doc-range ;
+
+SINGLETON: char-elt
+
+<PRIVATE
+
+: (prev-char) ( loc document quot -- loc )
+    {
+        { [ pick { 0 0 } = ] [ 2drop ] }
+        { [ pick second zero? ] [ drop [ first 1- ] dip line-end ] }
+        [ call ]
+    } cond ; inline
+
+: (next-char) ( loc document quot -- loc )
+    {
+        { [ 2over doc-end = ] [ 2drop ] }
+        { [ 2over line-end? ] [ 2drop first 1+ 0 2array ] }
+        [ call ]
+    } cond ; inline
+
+PRIVATE>
+
+M: char-elt prev-elt
+    drop [ drop -1 +col ] (prev-char) ;
+
+M: char-elt next-elt
+    drop [ drop 1 +col ] (next-char) ;
+
+SINGLETON: one-char-elt
+
+M: one-char-elt prev-elt 2drop ;
+
+M: one-char-elt next-elt 2drop ;
+
+<PRIVATE
+
+: (word-elt) ( loc document quot -- loc )
+    pick [
+        [ [ first2 swap ] dip doc-line ] dip call
+    ] dip =col ; inline
+
+: ((word-elt)) ( n seq -- n seq ? )
+    2dup ?nth blank? ;
+
+: break-detector ( ? -- quot )
+    '[ blank? _ xor ] ; inline
+
+: (prev-word) ( col str ? -- col )
+    break-detector find-last-from drop ?1+ ;
+
+: (next-word) ( col str ? -- col )
+    [ break-detector find-from drop ] [ drop length ] 2bi or ;
+
+PRIVATE>
+
+SINGLETON: one-word-elt
+
+M: one-word-elt prev-elt
+    drop
+    [ [ 1- ] dip f (prev-word) ] (word-elt) ;
+
+M: one-word-elt next-elt
+    drop
+    [ f (next-word) ] (word-elt) ;
+
+SINGLETON: word-elt
+
+M: word-elt prev-elt
+    drop
+    [ [ [ 1- ] dip ((word-elt)) (prev-word) ] (word-elt) ]
+    (prev-char) ;
+
+M: word-elt next-elt
+    drop
+    [ [ ((word-elt)) (next-word) ] (word-elt) ]
+    (next-char) ;
+
+SINGLETON: one-line-elt
+
+M: one-line-elt prev-elt
+    2drop first 0 2array ;
+
+M: one-line-elt next-elt
+    drop [ first dup ] dip doc-line length 2array ;
+
+TUPLE: page-elt { lines read-only } ;
+
+C: <page-elt> page-elt
+
+M: page-elt prev-elt
+    nip
+    2dup [ first ] [ lines>> ] bi* <
+    [ 2drop { 0 0 } ] [ lines>> neg +line ] if ;
+
+M: page-elt next-elt
+    3dup [ first ] [ last-line# ] [ lines>> ] tri* - >
+    [ drop nip doc-end ] [ nip lines>> +line ] if ;
+
+CONSTANT: line-elt T{ page-elt f 1 }
+
+SINGLETON: doc-elt
+
+M: doc-elt prev-elt 3drop { 0 0 } ;
+
+M: doc-elt next-elt drop nip doc-end ;
\ No newline at end of file
diff --git a/basis/fonts/authors.txt b/basis/fonts/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/fonts/fonts-docs.factor b/basis/fonts/fonts-docs.factor
new file mode 100644 (file)
index 0000000..c529efc
--- /dev/null
@@ -0,0 +1,41 @@
+! 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."
+{ $subsection font }
+{ $subsection <font> }
+"Modifying fonts:"
+{ $subsection font-with-foreground }
+{ $subsection font-with-background }
+"Useful constants:"
+{ $subsection monospace-font }
+{ $subsection sans-serif-font }
+{ $subsection 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:"
+{ $subsection metrics } ;
+
+ABOUT: "fonts"
diff --git a/basis/fonts/fonts-tests.factor b/basis/fonts/fonts-tests.factor
new file mode 100644 (file)
index 0000000..25856e0
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test fonts ;
+IN: fonts.tests
diff --git a/basis/fonts/fonts.factor b/basis/fonts/fonts.factor
new file mode 100644 (file)
index 0000000..fb89bdb
--- /dev/null
@@ -0,0 +1,68 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel colors colors.constants accessors combinators math ;
+IN: fonts
+
+TUPLE: font
+name
+size
+bold?
+italic?
+{ foreground initial: COLOR: black }
+{ background initial: COLOR: white } ;
+
+: <font> ( -- font )
+    font new ; inline
+
+: font-with-foreground ( font color -- font' )
+    [ clone ] dip >>foreground ; inline
+
+: font-with-background ( font color -- font' )
+    [ clone ] dip >>background ; inline
+
+: font-with-size ( font size -- font' )
+    [ clone ] dip >>size ; inline
+
+: reverse-video-font ( font -- font )
+    clone dup
+    [ foreground>> ] [ background>> ] bi
+    [ >>background ] [ >>foreground ] bi* ;
+
+: derive-font ( base font -- font' )
+    [
+        [ clone ] dip over {
+            [ [ name>> ] either? >>name ]
+            [ [ size>> ] either? >>size ]
+            [ [ bold?>> ] either? >>bold? ]
+            [ [ italic?>> ] either? >>italic? ]
+            [ [ foreground>> ] either? >>foreground ]
+            [ [ background>> ] either? >>background ]
+        } 2cleave
+    ] when* ;
+
+: serif-font ( -- font )
+    <font>
+        "serif" >>name
+        12 >>size ;
+
+: sans-serif-font ( -- font )
+    <font>
+        "sans-serif" >>name
+        12 >>size ;
+
+: monospace-font ( -- font )
+    <font>
+        "monospace" >>name
+        12 >>size ;
+
+: strip-font-colors ( font -- font' )
+    clone f >>background f >>foreground ;
+
+TUPLE: metrics width ascent descent height leading cap-height x-height ;
+
+: compute-height ( metrics -- metrics )
+    dup [ ascent>> ] [ descent>> ] bi + >>height ; inline
+
+TUPLE: selection string start end color ;
+
+C: <selection> selection
\ No newline at end of file
diff --git a/basis/fonts/summary.txt b/basis/fonts/summary.txt
new file mode 100644 (file)
index 0000000..c2cf825
--- /dev/null
@@ -0,0 +1 @@
+Fonts as a first-class data type
diff --git a/basis/freetype/authors.txt b/basis/freetype/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/freetype/freetype.factor b/basis/freetype/freetype.factor
deleted file mode 100644 (file)
index 683169e..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-! Copyright (C) 2005, 2007 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.syntax kernel system combinators ;
-IN: freetype
-
-<< "freetype" {
-    { [ os macosx? ] [ "@executable_path/../Frameworks/libfreetype.6.dylib" "cdecl" add-library ] }
-    { [ os windows? ] [ "freetype6.dll" "cdecl" add-library ] }
-    { [ t ] [ drop ] }
-} cond >>
-
-LIBRARY: freetype
-
-TYPEDEF: uchar FT_Byte
-TYPEDEF: void* FT_Bytes
-TYPEDEF: char FT_Char
-TYPEDEF: int FT_Int
-TYPEDEF: int FT_Int32
-TYPEDEF: uint FT_UInt
-TYPEDEF: short FT_Short
-TYPEDEF: ushort FT_UShort
-TYPEDEF: long FT_Long
-TYPEDEF: ulong FT_ULong
-TYPEDEF: uchar FT_Bool
-TYPEDEF: cell FT_Offset
-TYPEDEF: int FT_PtrDist
-TYPEDEF: char FT_String
-TYPEDEF: int FT_Tag
-TYPEDEF: int FT_Error
-TYPEDEF: long FT_Fixed
-TYPEDEF: void* FT_Pointer
-TYPEDEF: long FT_Pos
-TYPEDEF: ushort FT_UFWord
-TYPEDEF: short FT_F2Dot14
-TYPEDEF: long FT_F26Dot6
-
-FUNCTION: FT_Error FT_Init_FreeType ( void* library ) ;
-
-! circular reference between glyph and face
-TYPEDEF: void face
-TYPEDEF: void glyph
-
-C-STRUCT: glyph
-    { "void*" "library" }
-    { "face*" "face" }
-    { "glyph*" "next" }
-    { "FT_UInt" "reserved" }
-    { "void*" "generic" }
-    { "void*" "generic" }
-
-    { "FT_Pos" "width" }
-    { "FT_Pos" "height" }
-
-    { "FT_Pos" "hori-bearing-x" }
-    { "FT_Pos" "hori-bearing-y" }
-    { "FT_Pos" "hori-advance" }
-
-    { "FT_Pos" "vert-bearing-x" }
-    { "FT_Pos" "vert-bearing-y" }
-    { "FT_Pos" "vert-advance" }
-
-    { "FT_Fixed" "linear-hori-advance" }
-    { "FT_Fixed" "linear-vert-advance" }
-    { "FT_Pos" "advance-x" }
-    { "FT_Pos" "advance-y" }
-
-    { "intptr_t" "format" }
-
-    { "int" "bitmap-rows" }
-    { "int" "bitmap-width" }
-    { "int" "bitmap-pitch" }
-    { "void*" "bitmap-buffer" }
-    { "short" "bitmap-num-grays" }
-    { "char" "bitmap-pixel-mode" }
-    { "char" "bitmap-palette-mode" }
-    { "void*" "bitmap-palette" }
-
-    { "FT_Int" "bitmap-left" }
-    { "FT_Int" "bitmap-top" }
-
-    { "short" "n-contours" }
-    { "short" "n-points" }
-
-    { "void*" "points" }
-    { "char*" "tags" }
-    { "short*" "contours" }
-
-    { "int" "outline-flags" }
-
-    { "FT_UInt" "num_subglyphs" }
-    { "void*" "subglyphs" }
-
-    { "void*" "control-data" }
-    { "long" "control-len" }
-
-    { "FT_Pos" "lsb-delta" }
-    { "FT_Pos" "rsb-delta" }
-
-    { "void*" "other" } ;
-
-C-STRUCT: face-size
-    { "face*" "face" }
-    { "void*" "generic" }
-    { "void*" "generic" }
-
-    { "FT_UShort" "x-ppem" }
-    { "FT_UShort" "y-ppem" }
-
-    { "FT_Fixed" "x-scale" }
-    { "FT_Fixed" "y-scale" }
-
-    { "FT_Pos" "ascender" }
-    { "FT_Pos" "descender" }
-    { "FT_Pos" "height" }
-    { "FT_Pos" "max-advance" } ;
-
-C-STRUCT: face
-    { "FT_Long" "num-faces" }
-    { "FT_Long" "index" }
-
-    { "FT_Long" "flags" }
-    { "FT_Long" "style-flags" }
-
-    { "FT_Long" "num-glyphs" }
-
-    { "FT_Char*" "family-name" }
-    { "FT_Char*" "style-name" }
-
-    { "FT_Int" "num-fixed-sizes" }
-    { "void*" "available-sizes" }
-
-    { "FT_Int" "num-charmaps" }
-    { "void*" "charmaps" }
-
-    { "void*" "generic" }
-    { "void*" "generic" }
-
-    { "FT_Pos" "x-min" }
-    { "FT_Pos" "y-min" }
-    { "FT_Pos" "x-max" }
-    { "FT_Pos" "y-max" }
-
-    { "FT_UShort" "units-per-em" }
-    { "FT_Short" "ascender" }
-    { "FT_Short" "descender" }
-    { "FT_Short" "height" }
-
-    { "FT_Short" "max-advance-width" }
-    { "FT_Short" "max-advance-height" }
-
-    { "FT_Short" "underline-position" }
-    { "FT_Short" "underline-thickness" }
-
-    { "glyph*" "glyph" }
-    { "face-size*" "size" }
-    { "void*" "charmap" } ;
-
-C-STRUCT: FT_Bitmap
-    { "int" "rows" }
-    { "int" "width" }
-    { "int" "pitch" }
-    { "void*" "buffer" }
-    { "short" "num_grays" }
-    { "char" "pixel_mode" }
-    { "char" "palette_mode" }
-    { "void*" "palette" } ;
-
-FUNCTION: FT_Error FT_New_Face ( void* library, FT_Char* font, FT_Long index, face* face ) ;
-
-FUNCTION: FT_Error FT_New_Memory_Face ( void* library, FT_Byte* file_base, FT_Long file_size, FT_Long face_index, FT_Face* aface ) ;
-
-FUNCTION: FT_Error FT_Set_Char_Size ( face* face, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt horizontal_dpi, FT_UInt vertical_dpi ) ;
-
-FUNCTION: FT_Error FT_Load_Char ( face* face, FT_ULong charcode, FT_Int32 load_flags ) ;
-
-C-ENUM:
-    FT_RENDER_MODE_NORMAL
-    FT_RENDER_MODE_LIGHT
-    FT_RENDER_MODE_MONO
-    FT_RENDER_MODE_LCD
-    FT_RENDER_MODE_LCD_V ;
-
-C-ENUM:
-    FT_PIXEL_MODE_NONE
-    FT_PIXEL_MODE_MONO
-    FT_PIXEL_MODE_GRAY
-    FT_PIXEL_MODE_GRAY2
-    FT_PIXEL_MODE_GRAY4
-    FT_PIXEL_MODE_LCD
-    FT_PIXEL_MODE_LCD_V ;
-
-FUNCTION: int FT_Render_Glyph ( glyph* slot, int render_mode ) ;
-
-FUNCTION: void FT_Done_Face ( face* face ) ;
-
-FUNCTION: void FT_Done_FreeType ( void* library ) ;
-
-FUNCTION: FT_Long FT_MulFix ( FT_Long a, FT_Long b ) ;
-
diff --git a/basis/freetype/summary.txt b/basis/freetype/summary.txt
deleted file mode 100644 (file)
index 48506b0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-FreeType text rendering library binding
diff --git a/basis/freetype/tags.txt b/basis/freetype/tags.txt
deleted file mode 100644 (file)
index bb863cf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-bindings
index 9b2b2456c25e1ae661effa02d74a66225251165d..0aa042d4f2e7056159d3d1775c8fd31853fc5808 100644 (file)
@@ -2,7 +2,7 @@
 ! Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel sequences sequences.private math combinators
-macros quotations fry ;
+macros quotations fry effects ;
 IN: generalizations
 
 <<
@@ -94,4 +94,4 @@ MACRO: nweave ( n -- )
 : nappend-as ( n exemplar -- seq )
     [ narray concat ] dip like ; inline
 
-: nappend ( n -- seq ) narray concat ; inline
+: nappend ( n -- seq ) narray concat ; inline
\ No newline at end of file
diff --git a/basis/glib/authors.txt b/basis/glib/authors.txt
new file mode 100644 (file)
index 0000000..367ba74
--- /dev/null
@@ -0,0 +1,2 @@
+Matthew Willis
+Slava Pestov
diff --git a/basis/glib/glib.factor b/basis/glib/glib.factor
new file mode 100755 (executable)
index 0000000..1805f4b
--- /dev/null
@@ -0,0 +1,37 @@
+! Copyright (C) 2008 Matthew Willis.
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license
+USING: alien alien.syntax alien.destructors combinators system ;
+IN: glib
+
+<<
+
+{
+    { [ os winnt? ] [ "glib" "libglib-2.0-0.dll" "cdecl" add-library ] }
+    { [ os macosx? ] [ "glib" "/opt/local/lib/libglib-2.0.0.dylib" "cdecl" add-library ] }
+    { [ os unix? ] [ ] }
+} cond
+
+{
+    { [ os winnt? ] [ "gobject" "libgobject-2.0-0.dll" "cdecl" add-library ] }
+    { [ os macosx? ] [ "gobject" "/opt/local/lib/libgobject-2.0.0.dylib" "cdecl" add-library ] }
+    { [ os unix? ] [ ] }
+} cond
+
+>>
+
+LIBRARY: glib
+
+TYPEDEF: void* gpointer
+TYPEDEF: int gint
+TYPEDEF: bool gboolean
+
+FUNCTION: void
+g_free ( gpointer mem ) ;
+
+LIBRARY: gobject
+
+FUNCTION: void
+g_object_unref ( gpointer object ) ;
+
+DESTRUCTOR: g_object_unref
diff --git a/basis/glib/summary.txt b/basis/glib/summary.txt
new file mode 100644 (file)
index 0000000..a4b5d80
--- /dev/null
@@ -0,0 +1 @@
+Binding for GLib
diff --git a/basis/glib/tags.txt b/basis/glib/tags.txt
new file mode 100644 (file)
index 0000000..bb863cf
--- /dev/null
@@ -0,0 +1 @@
+bindings
index f3c17bb04bc333b80f36d0301837d61e8f3ff019..5f1f07273615c311fb2f2100810148216e875681 100644 (file)
@@ -1,6 +1,9 @@
 USING: tools.test hash2 kernel ;
 IN: hash2.tests
 
+[ t ] [ 1 2 { 1 2 } 2= ] unit-test
+[ f ] [ 1 3 { 1 2 } 2= ] unit-test
+
 : sample-hash
     5 <hash2>
     dup 2 3 "foo" roll set-hash2
index 6e8c7ee63a7e9fa6d32fa5e43542420b942b3240..ffe6926130bc6dbfba7817b77217a3e55cf57868 100644 (file)
@@ -14,7 +14,7 @@ IN: hash2
 : <hash2> ( size -- hash2 ) f <array> ;
 
 : 2= ( a b pair -- ? )
-    first2 swapd [ = ] 2bi@ and ; inline
+    first2 [ = ] bi-curry@ bi* and ; inline
 
 : (assoc2) ( a b alist -- {a,b,val} )
     [ 2= ] with with find nip ; inline
index 564d7db17f73bf30f6c43ec8e7b024eb3b05871a..65cb6541f422a4e84880869959242e95355f3c3e 100644 (file)
@@ -82,8 +82,8 @@ M: heap heap-size ( heap -- n )
     data>> first ; inline
 
 : data-exchange ( m n heap -- )
-    [ tuck data-nth [ data-nth ] dip ] 3keep
-    tuck [ data-set-nth ] 2dip data-set-nth ; inline
+    [ [ data-nth ] curry bi@ ]
+    [ [ data-set-nth ] curry bi@ ] 3bi ; inline
 
 GENERIC: heap-compare ( pair1 pair2 heap -- ? )
 
index 3fe09de263b33460680e52fb19daee9668e5c037..b2b65c39132ff1267640b7fea58a8a9f68d73605 100644 (file)
@@ -343,7 +343,7 @@ ARTICLE: "cookbook-pitfalls" "Pitfalls to avoid"
     { "When a source file uses two vocabularies which define words with the same name, the order of the vocabularies in the " { $link POSTPONE: USE: } " or " { $link POSTPONE: USING: } " forms is important. The " { $link POSTPONE: QUALIFIED: } " word implements qualified naming, which can be used to resolve ambiguities." }
     { "If a literal object appears in a word definition, the object itself is pushed on the stack when the word executes, not a copy. If you intend to mutate this object, you must " { $link clone } " it first. See " { $link "syntax-literals" } "." }
     { "For a discussion of potential issues surrounding the " { $link f } " object, see " { $link "booleans" } "." }
-    { "Factor's object system is quite flexible. Careless usage of union, mixin and predicate classes can lead to similar problems to those caused by ``multiple inheritance'' in other languages. In particular, it is possible to have two classes such that they have a non-empty intersection and yet neither is a subclass of the other. If a generic word defines methods on two such classes, various disambiguation rules are applied to ensure method dispatch remains deterministic, however they may not be what you expect. See " { $link "method-order" } " for details." }
+    { "Factor's object system is quite flexible. Careless usage of union, mixin and predicate classes can lead to similar problems to those caused by “multiple inheritance” in other languages. In particular, it is possible to have two classes such that they have a non-empty intersection and yet neither is a subclass of the other. If a generic word defines methods on two such classes, various disambiguation rules are applied to ensure method dispatch remains deterministic, however they may not be what you expect. See " { $link "method-order" } " for details." }
     { "Performance-sensitive code should have a static stack effect so that it can be compiled by the optimizing word compiler, which generates more efficient code than the non-optimizing quotation compiler. See " { $link "inference" } " and " { $link "compiler" } "."
     $nl
     "This means that methods defined on performance sensitive, frequently-called core generic words such as " { $link nth } " should have static stack effects which are consistent with each other, since a generic word will only have a static stack effect if all methods do."
index 2e8c17394421986424030a5902d5b9577548c6ca..47c3105436c7a00e06e5a43c5267332f247077f8 100644 (file)
@@ -13,7 +13,7 @@ io.streams.string continuations debugger compiler.units eval ;
 
 [ t ] [
     "foo" article-children
-    "foo" "help.crossref.tests" lookup 1array sequence=
+    "foo" "help.crossref.tests" lookup >link 1array sequence=
 ] unit-test
 
 [ "foo" ] [ "foo" "help.crossref.tests" lookup article-parent ] unit-test
index 9eec5b859ed07edc2b6c9542ce2be8f685827a56..b791a4b124760645638118a1ed2f2d5fd29d4236 100644 (file)
@@ -1,17 +1,19 @@
-! Copyright (C) 2005, 2007 Slava Pestov.
+! Copyright (C) 2005, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays definitions generic assocs
+USING: arrays definitions generic assocs math fry
 io kernel namespaces prettyprint prettyprint.sections
 sequences words summary classes help.topics help.markup ;
 IN: help.crossref
 
+: article-links ( topic elements -- seq )
+    [ article-content ] dip
+    collect-elements [ >link ] map ;
+
 : article-children ( topic -- seq )
-    article-content { $subsection } collect-elements ;
+    { $subsection } article-links ;
 
 M: link uses
-    article-content
-    { $subsection $link $see-also }
-    collect-elements [ \ f or ] map ;
+    { $subsection $link $see-also } article-links ;
 
 : help-path ( topic -- seq )
     [ article-parent ] follow rest ;
@@ -24,3 +26,15 @@ M: link uses
 
 : unxref-article ( topic -- )
     >link unxref ;
+
+: prev/next ( obj seq n -- obj' )
+    [ [ index dup ] keep ] dip swap
+    '[ _ + _ ?nth ] when ;
+
+: prev/next-article ( article n -- article' )
+    [ dup article-parent dup ] dip
+    '[ article-children _ prev/next ] [ 2drop f ] if ;
+
+: prev-article ( article -- prev ) -1 prev/next-article ;
+
+: next-article ( article -- next ) 1 prev/next-article ;
\ No newline at end of file
index 36496ac5c4aed9fcf113e2bf29502d1ecd9c3497..331fafbbd121b3b37dd5519ea139e2ca11fa083f 100644 (file)
@@ -288,6 +288,7 @@ $nl
 { $subsection "first-program" }
 { $subsection "handbook-language-reference" }
 { $subsection "handbook-environment-reference" }
+{ $subsection "ui" }
 { $subsection "handbook-library-reference" }
 "The below indices only include articles from loaded vocabularies. To explore more vocabularies, see " { $link "vocab-index" } "."
 { $subsection "article-index" }
index 6b77f656c0d4235a07fefa0ec947ae1b34bd148e..8384799dbda6e3ae72604ba56291ef2420472027 100644 (file)
@@ -340,7 +340,7 @@ HELP: $values
 HELP: $instance
 { $values { "element" "an array with shape " { $snippet "{ class }" } } }
 { $description
-    "Produces the text ``a " { $emphasis "class" } "'' or ``an " { $emphasis "class" } "'', depending on the first letter of " { $emphasis "class" } "."
+    "Produces the text “a " { $emphasis "class" } "” or “an " { $emphasis "class" } "”, depending on the first letter of " { $emphasis "class" } "."
 }
 { $examples
     { $markup-example { $instance string } }
@@ -351,7 +351,7 @@ HELP: $instance
 HELP: $maybe
 { $values { "element" "an array with shape " { $snippet "{ class }" } } }
 { $description
-    "Produces the text ``a " { $emphasis "class" } " or f'' or ``an " { $emphasis "class" } " or f'', depending on the first letter of " { $emphasis "class" } "."
+    "Produces the text “a " { $emphasis "class" } " or f” or “an " { $emphasis "class" } " or f”, depending on the first letter of " { $emphasis "class" } "."
 }
 { $examples
     { $markup-example { $maybe string } }
@@ -360,7 +360,7 @@ HELP: $maybe
 HELP: $quotation
 { $values { "element" "an array with shape " { $snippet "{ effect }" } } }
 { $description
-    "Produces the text ``a quotation with stack effect " { $emphasis "effect" } "''."
+    "Produces the text “a quotation with stack effect " { $emphasis "effect" } "”."
 }
 { $examples
     { $markup-example { $quotation "( obj -- )" } }
index f980032a8b756c1b71293a157283624043195699..27a81f9948b1eb50ac1bf05c1cfef40dcdc649d4 100644 (file)
@@ -1,11 +1,11 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays io io.styles kernel namespaces make
 parser prettyprint sequences words words.symbol assocs
 definitions generic quotations effects slots continuations
 classes.tuple debugger combinators vocabs help.stylesheet
 help.topics help.crossref help.markup sorting classes
-vocabs.loader ;
+vocabs.loader call ;
 IN: help
 
 GENERIC: word-help* ( word -- content )
@@ -93,44 +93,44 @@ M: word article-parent "help-parent" word-prop ;
 
 M: word set-article-parent swap "help-parent" set-word-prop ;
 
-: $doc-path ( article -- )
-    help-path [
-        [
-            help-path-style get [
-                "Parent topics: " write $links
-            ] with-style
-        ] ($block)
-    ] unless-empty ;
+: ($title) ( topic -- )
+    [ [ article-title ] [ >link ] bi write-object ] ($block) ;
+
+: $navigation-row ( content element label -- )
+    [ prefix 1array ] dip prefix , ;
+
+: $navigation-table ( topic -- )
+    [
+        [ help-path [ \ $links "Up:" $navigation-row ] unless-empty ]
+        [ prev-article [ 1array \ $long-link "Prev:" $navigation-row ] when* ]
+        [ next-article [ 1array \ $long-link "Next:" $navigation-row ] when* ]
+        tri
+    ] { } make [ $table ] unless-empty ;
 
 : $title ( topic -- )
     title-style get [
         title-style get [
-            dup [
-                dup article-title swap >link write-object
-            ] ($block) $doc-path
+            [ ($title) ]
+            [ help-path-style get [ $navigation-table ] with-style ] bi
         ] with-nesting
     ] with-style nl ;
 
 : print-topic ( topic -- )
     >link
-    last-element off dup $title
-    article-content print-content nl ;
+    last-element off
+    [ $title ] [ article-content print-content nl ] bi ;
 
 SYMBOL: help-hook
 
 help-hook [ [ print-topic ] ] initialize
 
 : help ( topic -- )
-    help-hook get call ;
+    help-hook get call( topic -- ) ;
 
 : about ( vocab -- )
     dup require
-    dup vocab [ ] [
-        "No such vocabulary: " prepend throw
-    ] ?if
-    dup vocab-help [
-        help
-    ] [
+    dup vocab [ ] [ no-vocab ] ?if
+    dup vocab-help [ help ] [
         "The " write vocab-name write
         " vocabulary does not define a main help article." print
         "To define one, refer to \\ ABOUT: help" print
index 0d8aa53d442fe7a549392a9449b8c5d46c5d70f6..74bc45d36c507799a046616119a721c9c7316d93 100644 (file)
@@ -25,3 +25,6 @@ TUPLE: blahblah quux ;
 
 [ "a string, a fixnum, or an integer" ]
 [ [ { $or string fixnum integer } print-element ] with-string-writer ] unit-test
+
+\ print-element must-infer
+\ print-topic must-infer
\ No newline at end of file
index 2fd8d55d10a4976c1404e5e94081df959973459d..d4f664d6ff9f181717d5f7072358e5380055c29f 100644 (file)
@@ -2,9 +2,9 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays definitions generic io kernel assocs
 hashtables namespaces make parser prettyprint sequences strings
-io.styles vectors words math sorting splitting classes slots
-vocabs help.stylesheet help.topics vocabs.loader quotations
-combinators ;
+io.styles vectors words math sorting splitting classes slots fry
+sets vocabs help.stylesheet help.topics vocabs.loader quotations
+combinators call ;
 IN: help.markup
 
 PREDICATE: simple-element < array
@@ -27,8 +27,8 @@ GENERIC: print-element ( element -- )
 
 M: simple-element print-element [ print-element ] each ;
 M: string print-element [ write ] ($span) ;
-M: array print-element unclip execute ;
-M: word print-element { } swap execute ;
+M: array print-element unclip execute( arg -- ) ;
+M: word print-element { } swap execute( arg -- ) ;
 M: f print-element drop ;
 
 : print-element* ( element style -- )
@@ -137,6 +137,10 @@ ALIAS: $slot $snippet
         ] with-nesting
     ] ($heading) ;
 
+! Images
+: $image ( element -- )
+    [ [ "" ] dip first image associate format ] ($span) ;
+
 ! Some links
 : write-link ( string object -- )
     link-style get [ write-object ] with-style ;
@@ -147,9 +151,18 @@ ALIAS: $slot $snippet
 : $link ( element -- )
     first ($link) ;
 
+: ($definition-link) ( word -- )
+    [ article-name ] keep write-link ;
+
+: $definition-link ( element -- )
+    first ($definition-link) ;
+
 : ($long-link) ( object -- )
     [ article-title ] [ >link ] bi write-link ;
 
+: $long-link ( object -- )
+    first ($long-link) ;
+
 : ($subsection) ( element quot -- )
     [
         subsection-style get [
@@ -194,7 +207,7 @@ ALIAS: $slot $snippet
     "See also" $heading $links ;
 
 : related-words ( seq -- )
-    dup [ "related" set-word-prop ] curry each ;
+    dup '[ _ "related" set-word-prop ] each ;
 
 : $related ( element -- )
     first dup "related" word-prop remove
@@ -341,7 +354,8 @@ M: f ($instance)
 
 GENERIC: elements* ( elt-type element -- )
 
-M: simple-element elements* [ elements* ] with each ;
+M: simple-element elements*
+    [ elements* ] with each ;
 
 M: object elements* 2drop ;
 
@@ -352,13 +366,10 @@ M: array elements*
 : elements ( elt-type element -- seq ) [ elements* ] { } make ;
 
 : collect-elements ( element seq -- elements )
-    [
-        swap [
-            elements [
-                rest [ dup set ] each
-            ] each
-        ] curry each
-    ] H{ } make-assoc keys ;
+    swap '[ _ elements [ rest ] map concat ] map concat prune ;
 
 : <$link> ( topic -- element )
-    \ $link swap 2array ;
+    1array \ $link prefix ;
+
+: <$snippet> ( str -- element )
+    1array \ $snippet prefix ;
index 50357db8cf0c85b1a1b726284b14436496a2d5ec..74d7f6c115f20210546447e25a36360daaae42bb 100644 (file)
@@ -1,11 +1,11 @@
-! Copyright (C) 2005, 2006 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: io.styles namespaces colors ;
+USING: io.styles namespaces colors colors.constants ;
 IN: help.stylesheet
 
 SYMBOL: default-span-style
 H{
-    { font "sans-serif" }
+    { font-name "sans-serif" }
     { font-size 12 }
     { font-style plain }
 } default-span-style set-global
@@ -17,7 +17,7 @@ H{
 
 SYMBOL: link-style
 H{
-    { foreground T{ rgba f 0 0 0.3 1 } }
+    { foreground COLOR: dark-blue }
     { font-style bold }
 } link-style set-global
 
@@ -29,11 +29,11 @@ H{ { font-style bold } } strong-style set-global
 
 SYMBOL: title-style
 H{
-    { font "sans-serif" }
+    { font-name "sans-serif" }
     { font-size 18 }
     { font-style bold }
     { wrap-margin 500 }
-    { page-color T{ rgba f 0.8 0.8 0.8 1 } }
+    { page-color COLOR: light-gray }
     { border-width 5 }
 } title-style set-global
 
@@ -42,28 +42,28 @@ H{ { font-size 10 } } help-path-style set-global
 
 SYMBOL: heading-style
 H{
-    { font "sans-serif" }
+    { font-name "sans-serif" }
     { font-size 16 }
     { font-style bold }
 } heading-style set-global
 
 SYMBOL: subsection-style
 H{
-    { font "sans-serif" }
+    { font-name "sans-serif" }
     { font-size 14 }
     { font-style bold }
 } subsection-style set-global
 
 SYMBOL: snippet-style
 H{
-    { font "monospace" }
+    { font-name "monospace" }
     { font-size 12 }
-    { foreground T{ rgba f 0.1 0.1 0.4 1 } }
+    { foreground COLOR: navy-blue }
 } snippet-style set-global
 
 SYMBOL: code-style
 H{
-    { page-color T{ rgba f 0.8 0.8 0.8 0.5 } }
+    { page-color COLOR: gray80 }
     { border-width 5 }
     { wrap-margin f }
 } code-style set-global
@@ -73,14 +73,14 @@ H{ { font-style bold } } input-style set-global
 
 SYMBOL: url-style
 H{
-    { font "monospace" }
-    { foreground T{ rgba f 0.0 0.0 1.0 1.0 } }
+    { font-name "monospace" }
+    { foreground COLOR: blue }
 } url-style set-global
 
 SYMBOL: warning-style
 H{
-    { page-color T{ rgba f 0.95 0.95 0.95 1 } }
-    { border-color T{ rgba f 1 0 0 1 } }
+    { page-color COLOR: gray90 }
+    { border-color COLOR: red }
     { border-width 5 }
     { wrap-margin 500 }
 } warning-style set-global
@@ -93,11 +93,11 @@ H{
 SYMBOL: table-style
 H{
     { table-gap { 5 5 } }
-    { table-border T{ rgba f 0.8 0.8 0.8 1.0 } }
+    { table-border COLOR: light-gray }
 } table-style set-global
 
 SYMBOL: list-style
 H{ { table-gap { 10 2 } } } list-style set-global
 
 SYMBOL: bullet
-"- " bullet set-global
+" " bullet set-global
index 9fba09913dc808e5798125bf532d830d6f6f2ad0..864b030126947b5f1d1b41441da555169c194359 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2005, 2007 Slava Pestov.
+! Copyright (C) 2005, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.x
 USING: accessors arrays definitions generic assocs
 io kernel namespaces make prettyprint prettyprint.sections
@@ -15,13 +15,14 @@ GENERIC: >link ( obj -- obj )
 M: link >link ;
 M: vocab-spec >link ;
 M: object >link link boa ;
+M: f >link drop \ f >link ;
 
 PREDICATE: word-link < link name>> word? ;
 
 M: link summary
     [
         "Link: " %
-        name>> dup word? [ summary ] [ unparse ] if %
+        name>> dup word? [ summary ] [ unparse-short ] if %
     ] "" make ;
 
 ! Help articles
@@ -73,4 +74,4 @@ M: f article-name drop \ f article-name ;
 M: f article-title drop \ f article-title ;
 M: f article-content drop \ f article-content ;
 M: f article-parent drop \ f article-parent ;
-M: f set-article-parent drop \ f set-article-parent ;
+M: f set-article-parent drop \ f set-article-parent ;
\ No newline at end of file
index efb1e0a0f75c0dfb93ef924488299e2fe0551e02..7ec155881bc5f3a07b632a7a5230744074ab8d96 100644 (file)
@@ -1,7 +1,7 @@
 USING: help.markup help.syntax ui.commands ui.operations
-ui.tools.search ui.tools.workspace editors vocabs.loader
-kernel sequences prettyprint tools.test tools.vocabs strings
-unicode.categories unicode.case ui.tools.browser ;
+editors vocabs.loader kernel sequences prettyprint tools.test
+tools.vocabs strings unicode.categories unicode.case
+ui.tools.browser ui.tools.common ;
 IN: help.tutorial
 
 ARTICLE: "first-program-start" "Creating a vocabulary for your first program"
@@ -11,7 +11,7 @@ $nl
 { $code "USE: tools.scaffold" }
 "Then, ask the scaffold tool to create a new vocabulary named " { $snippet "palindrome" } ":"
 { $code "\"resource:work\" \"palindrome\" scaffold-vocab" }
-"If you look at the output, you will see that a few files were created in your ``work'' directory. The following phrase will print the full path of your work directory:"
+"If you look at the output, you will see that a few files were created in your “work” directory. The following phrase will print the full path of your work directory:"
 { $code "\"work\" resource-path ." }
 "The work directory is one of several " { $link "vocabs.roots" } " where Factor searches for vocabularies. It is possible to define new vocabulary roots; see " { $link "add-vocab-roots" } ". To keep things simple in this tutorial, we'll just use the work directory, though."
 $nl
@@ -36,21 +36,21 @@ $nl
 { $code ": palindrome? ( string -- ? ) dup reverse = ;" }
 "Place this definition at the end of your source file."
 $nl
-"Now we have changed the source file, we must reload it into Factor so that we can test the new definition. To do this, simply go to the Factor workspace and press " { $command workspace "workflow" refresh-all } ". This will find any previously-loaded source files which have changed on disk, and reload them."
+"Now we have changed the source file, we must reload it into Factor so that we can test the new definition. To do this, simply go to the Factor listener and press " { $command tool "common" refresh-all } ". This will find any previously-loaded source files which have changed on disk, and reload them."
 $nl
 "When you do this, you will get an error about the " { $link dup } " word not being found. This is because this word is part of the " { $vocab-link "kernel" } " vocabulary, but this vocabulary is not part of the source file's " { $link "vocabulary-search" } ". You must explicitly list dependencies in source files. This allows Factor to automatically load required vocabularies and makes larger programs easier to maintain."
 $nl
-"To add the word to the search path, first convince yourself that this word is in the " { $vocab-link "kernel" } " vocabulary. Enter " { $snippet "dup" } " in the listener's input area, and press " { $operation com-follow } ". This will open the documentation browser tool, viewing the help for the " { $link dup } " word. One of the subheadings in the help article will mention the word's vocabulary."
+"To add the word to the search path, first convince yourself that this word is in the " { $vocab-link "kernel" } " vocabulary. Enter " { $snippet "dup" } " in the listener's input area, and press " { $operation com-browse } ". This will open the documentation browser tool, viewing the help for the " { $link dup } " word. One of the subheadings in the help article will mention the word's vocabulary."
 $nl
 "So now, add the following at the start of the source file:"
 { $code "USING: kernel ;" }
-"Next, find out what vocabulary " { $link reverse } " lives in; type the word name " { $snippet "reverse" } " in the workspace listener's input area, and press " { $operation com-follow } "."
+"Next, find out what vocabulary " { $link reverse } " lives in; type the word name " { $snippet "reverse" } " in the listener's input area, and press " { $operation com-browse } "."
 $nl
 "It lives in the " { $vocab-link "sequences" } " vocabulary, so we add that to the search path:"
 { $code "USING: kernel sequences ;" }
 "Finally, check what vocabulary " { $link = } " lives in, and confirm that it's in the " { $vocab-link "kernel" } " vocabulary, which we've already added to the search path."
 $nl
-"Now press " { $command workspace "workflow" refresh-all } " again, and the source file should reload without any errors. You can now go on and learn about " { $link "first-program-test" } "." ;
+"Now press " { $command tool "common" refresh-all } " again, and the source file should reload without any errors. You can now go on and learn about " { $link "first-program-test" } "." ;
 
 ARTICLE: "first-program-test" "Testing your first program"
 "Your " { $snippet "palindrome.factor" } " file should look like the following after the previous section:"
@@ -64,9 +64,9 @@ ARTICLE: "first-program-test" "Testing your first program"
 }
 "We will now test our new word in the listener. First, push a string on the stack:"
 { $code "\"hello\"" }
-"Note that the stack display at the top of the workspace now shows this string. Having supplied the input, we call our word:"
+"Note that the stack display in the listener now shows this string. Having supplied the input, we call our word:"
 { $code "palindrome?" }
-"The stack display should now have a boolean false - " { $link f } " - which is the word's output. Since ``hello'' is not a palindrome, this is what we expect. We can get rid of this boolean by calling " { $link drop } ". The stack should be empty after this is done."
+"The stack display should now have a boolean false - " { $link f } " - which is the word's output. Since “hello” is not a palindrome, this is what we expect. We can get rid of this boolean by calling " { $link drop } ". The stack should be empty after this is done."
 $nl
 "Now, let's try it with a palindrome; we will push the string and call the word in the same line of code:"
 { $code "\"racecar\" palindrome?" }
@@ -120,7 +120,7 @@ $nl
 { $code "filter" }
 "Now the stack should contain the following string:"
 { "\"AmanaplanacanalPanama\"" }
-"This is almost what we want; we just need to convert the string to lower case now. This can be done by calling " { $link >lower } "; the " { $snippet ">" } " prefix is a naming convention for conversion operations, and should be read as ``to'':"
+"This is almost what we want; we just need to convert the string to lower case now. This can be done by calling " { $link >lower } "; the " { $snippet ">" } " prefix is a naming convention for conversion operations, and should be read as “to”:"
 { $code ">lower" }
 "Finally, let's print the top of the stack and discard it:"
 { $code "." }
@@ -132,13 +132,13 @@ $nl
 $nl
 "We modify " { $snippet "palindrome?" } " to first apply " { $snippet "normalize" } " to its input:"
 { $code ": palindrome? ( str -- ? ) normalize dup reverse = ;" }
-"Now if you press " { $command workspace "workflow" refresh-all } ", the source file should reload without any errors. You can run unit tests again, and this time, they will all pass:"
+"Now if you press " { $command tool "common" refresh-all } ", the source file should reload without any errors. You can run unit tests again, and this time, they will all pass:"
 { $code "\"palindrome\" test" } ;
 
 ARTICLE: "first-program" "Your first program"
 "In this tutorial, we will write a simple Factor program which prompts the user to enter a word, and tests if it is a palindrome (that is, the word is spelled the same backwards and forwards)."
 $nl
-"In this tutorial, you will learn about basic Factor development tools. You may want to open a second workspace window by pressing " { $command workspace "workflow" workspace-window } "; this will allow you to read this tutorial and browse other documentation at the same time."
+"In this tutorial, you will learn about basic Factor development tools."
 { $subsection "first-program-start" }
 { $subsection "first-program-logic" }
 { $subsection "first-program-test" }
index 18ab17218f32fdc7c00f926e3899670c7b6af3b5..249861b12a8b93e7c6125ec827705219b4a5eb81 100644 (file)
@@ -35,7 +35,7 @@ M: funky url-of "http://www.funky-town.com/" swap town>> append ;
 [
     [
         "car"
-        H{ { font "monospace" } }
+        H{ { font-name "monospace" } }
         format
     ] make-html-string
 ] unit-test
index 28d6e6d5de4f0d589a4a4827470f458a45565808..49a9225402d32b7fa537a984422e2c94479fb5c8 100644 (file)
@@ -75,7 +75,7 @@ MACRO: make-css ( pairs -- str )
     {
         { foreground fg-css, }
         { background bg-css, }
-        { font font-css, }
+        { font-name font-css, }
         { font-style style-css, }
         { font-size size-css, }
     } make-css ;
index 9e7079023d8def8154cf733f74c548d369a330ef..7af37b65929831ace268e9437c31c1dd6d6ff1b8 100644 (file)
@@ -26,8 +26,8 @@ CONSTANT: chloe-ns "http://factorcode.org/chloe/1.0"
 XML-NS: chloe-name http://factorcode.org/chloe/1.0
 
 : required-attr ( tag name -- value )
-    tuck chloe-name attr
-    [ nip ] [ " attribute is required" append throw ] if* ;
+    [ nip ] [ chloe-name attr ] 2bi
+    [ ] [ " attribute is required" append throw ] ?if ;
 
 : optional-attr ( tag name -- value )
     chloe-name attr ;
index 5282ceeab45f1832b7977ba8e3f09eb1f58af36f..82576774f49c58e5b4db7e99d8bf7b698796639e 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel accessors grouping sequences combinators
-math specialized-arrays.direct.uint byte-arrays
+math specialized-arrays.direct.uint byte-arrays fry
 specialized-arrays.direct.ushort specialized-arrays.uint
 specialized-arrays.ushort specialized-arrays.float ;
 IN: images
@@ -34,45 +34,53 @@ TUPLE: image dim component-order bitmap ;
 GENERIC: load-image* ( path tuple -- image )
 
 : add-dummy-alpha ( seq -- seq' )
-    3 <sliced-groups>
-    [ 255 suffix ] map concat ;
+    3 <groups> [ 255 suffix ] map concat ;
 
 : normalize-floats ( byte-array -- byte-array )
     byte-array>float-array [ 255.0 * >integer ] B{ } map-as ;
 
+GENERIC: normalize-component-order* ( image component-order -- image )
+
 : normalize-component-order ( image -- image )
-    dup component-order>>
-    {
-        { RGBA [ ] }
-        { R32G32B32A32 [
-            [ normalize-floats ] change-bitmap
-        ] }
-        { R32G32B32 [
-            [ normalize-floats add-dummy-alpha ] change-bitmap
-        ] }
-        { R16G16B16A16 [
-            [ byte-array>ushort-array [ -8 shift ] B{ } map-as ] change-bitmap
-        ] }
-        { R16G16B16 [
-            [
-                byte-array>ushort-array [ -8 shift ] B{ } map-as add-dummy-alpha
-            ] change-bitmap
-        ] }
-        { BGRA [
-            [
-                4 <sliced-groups> dup [ 3 head-slice reverse-here ] each
-            ] change-bitmap
-        ] }
-        { RGB [ [ add-dummy-alpha ] change-bitmap ] }
-        { BGR [
-            [
-                3 <sliced-groups>
-                [ [ 3 head-slice reverse-here ] each ]
-                [ [ 255 suffix ] map ] bi concat
-            ] change-bitmap
-        ] }
-    } case
-    RGBA >>component-order ;
+    dup component-order>> '[ _ normalize-component-order* ] change-bitmap ;
+
+M: RGBA normalize-component-order* drop ;
+
+M: R32G32B32A32 normalize-component-order*
+    drop normalize-floats ;
+
+M: R32G32B32 normalize-component-order*
+    drop normalize-floats add-dummy-alpha ;
+
+: RGB16>8 ( bitmap -- bitmap' )
+    byte-array>ushort-array [ -8 shift ] B{ } map-as ; inline
+
+M: R16G16B16A16 normalize-component-order*
+    drop RGB16>8 ;
+
+M: R16G16B16 normalize-component-order*
+    drop RGB16>8 add-dummy-alpha ;
+
+: BGR>RGB ( bitmap bytes-per-pixel -- pixels )
+    <groups> [ 3 cut [ reverse ] dip append ] map B{ } join ; inline
+
+M: BGRA normalize-component-order*
+    drop 4 BGR>RGB ;
+
+M: RGB normalize-component-order*
+    drop add-dummy-alpha ;
+
+M: BGR normalize-component-order*
+    drop 3 BGR>RGB add-dummy-alpha ;
+
+: ARGB>RGBA ( bitmap -- bitmap' )
+    4 <groups> [ unclip suffix ] map B{ } join ;
+
+M: ARGB normalize-component-order*
+    drop ARGB>RGBA ;
+
+M: ABGR normalize-component-order*
+    drop ARGB>RGBA 4 BGR>RGB ;
 
 GENERIC: normalize-scan-line-order ( image -- image )
 
diff --git a/basis/images/memory/authors.txt b/basis/images/memory/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/images/memory/memory.factor b/basis/images/memory/memory.factor
new file mode 100644 (file)
index 0000000..1a977b6
--- /dev/null
@@ -0,0 +1,30 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors alien.c-types destructors fry images kernel
+libc math sequences ;
+IN: images.memory
+
+! Some code shared by core-graphics and cairo for constructing
+! images from off-screen graphics contexts. There is probably
+! no reason to call it directly.
+
+<PRIVATE
+
+: bitmap-size ( dim -- n ) product "uint" heap-size * ;
+
+: malloc-bitmap-data ( dim -- alien ) bitmap-size 1 calloc &free ;
+
+: bitmap-data ( alien dim -- data ) bitmap-size memory>byte-array ;
+
+: <bitmap-image> ( alien dim -- image )
+    [ bitmap-data ] keep
+    <image>
+        swap >>dim
+        swap >>bitmap ;
+
+PRIVATE>
+
+: make-memory-bitmap ( dim quot -- image )
+    '[
+        [ malloc-bitmap-data ] keep _ [ <bitmap-image> ] 2bi
+    ] with-destructors ; inline
\ No newline at end of file
index 82e1e104d1fce03991c0b76f7fc1afb6739a26ba..60a1fb274b0ba2e565001c611bafe70d6f25dd5c 100644 (file)
@@ -1,4 +1,5 @@
-USING: help.markup help.syntax kernel classes io io.styles mirrors ;
+USING: help.markup help.syntax kernel classes io io.styles mirrors
+inspector.private ;
 IN: inspector
 
 ARTICLE: "inspector" "The inspector"
@@ -16,23 +17,11 @@ $nl
 { $subsection &delete }
 "A variable holding the current object:"
 { $subsection me }
-"A variable holding inspector history:"
-{ $subsection inspector-stack }
-"A customization hook:"
-{ $subsection inspector-hook }
 "A description of an object can be printed without starting the inspector:"
-{ $subsection describe }
-{ $subsection describe* } ;
+{ $subsection describe } ;
 
 ABOUT: "inspector"
 
-HELP: value-editor
-{ $values { "path" "a sequence of keys" } }
-{ $description "Prettyprints the value at a path, and if the output stream supports it, a graphical gadget for editing the object." }
-{ $notes "To learn about paths, see " { $link "mirrors" } "." } ;
-
-{ presented-path presented-printer value-editor } related-words
-
 HELP: describe
 { $values { "obj" object } }
 { $description "Print a tabular overview of the object."
@@ -40,11 +29,6 @@ $nl
 "For sequences and hashtables, this outputs the entries of the collection. For all other object types, slot names and values are shown." }
 { $examples { $code "global describe" } } ;
 
-HELP: describe*
-{ $values { "obj" object } { "mirror" mirror } { "keys" "a sequence of objects" } }
-{ $description "Print a tabular overview of the object." }
-{ $notes "This word is a factor of " { $link describe } " and " { $link inspect } "." } ;
-
 HELP: inspector-stack
 { $var-description "If the inspector is running, this variable holds previously-inspected objects." } ;
 
@@ -91,8 +75,3 @@ HELP: &back
 
 HELP: me
 { $var-description "The currently inspected object." } ;
-
-HELP: inspector-hook
-{ $var-description "A quotation with stack effect " { $snippet "( obj -- )" } ", called by the inspector to display an overview of an object."
-$nl
-"The default implementation calls " { $link describe } " which outputs on " { $link output-stream } ", but the graphical listener sets this variable so that calling " { $link inspect } " in the UI opens the graphical inspector." } ;
index c2303643423858235bdb6721c23d21218d272c68..4ce549ac83854e9ff6463d63084091e49807abc6 100644 (file)
@@ -10,8 +10,6 @@ H{ } describe
 
 [ "fixnum instance\n" ] [ [ 3 describe ] with-string-writer ] unit-test
 
-[ ] [ inspector-hook get-global inspector-hook set ] unit-test
-
 [ ] [ H{ } clone inspect ] unit-test
 
 [ ] [ "a" "b" &add ] unit-test
index 9c61d092e5622ea66f1bec001fe9620006d2ec52..05c4dc2a946f45d26ce658c296c1cfb965b08302 100644 (file)
@@ -1,96 +1,89 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays generic hashtables io kernel assocs math
-namespaces prettyprint sequences strings io.styles vectors words
-quotations mirrors splitting math.parser classes vocabs refs
-sets sorting summary debugger continuations fry ;
+namespaces prettyprint prettyprint.custom prettyprint.sections
+sequences strings io.styles vectors words quotations mirrors
+splitting math.parser classes vocabs sets sorting summary
+debugger continuations fry combinators ;
 IN: inspector
 
-: value-editor ( path -- )
-    [
-        [ pprint-short ] presented-printer set
-        dup presented-path set
-    ] H{ } make-assoc
-    [ get-ref pprint-short ] with-nesting ;
-
-SYMBOL: +sequence+
 SYMBOL: +number-rows+
-SYMBOL: +editable+
 
-: write-slot-editor ( path -- )
-    [
-        +editable+ get [
-            value-editor
-        ] [
-            get-ref pprint-short
-        ] if
-    ] with-cell ;
+: summary. ( obj -- ) [ summary ] keep write-object nl ;
 
-: write-key ( mirror key -- )
-    +sequence+ get
-    [ 2drop ] [ <key-ref> write-slot-editor ] if ;
+<PRIVATE
 
-: write-value ( mirror key -- )
-    <value-ref> write-slot-editor ;
+: sort-unparsed-keys ( assoc -- alist )
+    >alist dup keys
+    [ unparse-short ] map
+    zip sort-values keys ;
 
-: describe-row ( mirror key n -- )
-    [
-        +number-rows+ get [ pprint-cell ] [ drop ] if
-        [ write-key ] [ write-value ] 2bi
-    ] with-row ;
+GENERIC: add-numbers ( alist -- table' )
 
-: summary. ( obj -- ) [ summary ] keep write-object nl ;
+M: enum add-numbers ;
+
+M: assoc add-numbers
+    +number-rows+ get [
+        dup length [ prefix ] 2map
+    ] when ;
+
+TUPLE: slot-name name ;
+
+M: slot-name pprint* name>> text ;
 
-: sorted-keys ( assoc -- alist )
-    dup hashtable? [
-        keys
-        [ [ unparse-short ] keep ] { } map>assoc
-        sort-keys values
-    ] [ keys ] if ;
-
-: describe* ( obj mirror keys -- )
-    [ summary. ] 2dip
-    [ drop ] [
-        dup enum? [ +sequence+ on ] when
-        standard-table-style [
-            swap '[ [ _ ] 2dip describe-row ] each-index
-        ] tabular-output
-    ] if-empty ;
-
-: describe ( obj -- )
-    dup make-mirror dup sorted-keys describe* ;
+GENERIC: fix-slot-names ( assoc -- assoc )
+
+M: assoc fix-slot-names >alist ;
+
+M: mirror fix-slot-names
+    [ [ slot-name boa ] dip ] { } assoc-map-as ;
+
+: (describe) ( obj assoc -- keys )
+    t pprint-string-cells? [
+        [ summary. ] [
+            dup hashtable? [ sort-unparsed-keys ] when
+            [ fix-slot-names add-numbers simple-table. ] [ keys ] bi
+        ] bi*
+    ] with-variable ;
+
+PRIVATE>
+
+: describe ( obj -- ) dup make-mirror (describe) drop ;
 
 M: tuple error. describe ;
 
-: namestack. ( seq -- )
+: vars-in-scope ( seq -- alist )
     [ [ global eq? not ] filter [ keys ] gather ] keep
-    '[ dup _ assoc-stack ] H{ } map>assoc describe ;
+    '[ dup _ assoc-stack ] H{ } map>assoc ;
 
 : .vars ( -- )
-    namestack namestack. ;
+    namestack vars-in-scope describe ;
 
 : :vars ( -- )
-    error-continuation get name>> namestack. ;
+    error-continuation get name>> vars-in-scope describe ;
 
-SYMBOL: inspector-hook
+SYMBOL: me
 
-[ t +number-rows+ [ describe* ] with-variable ] inspector-hook set-global
+<PRIVATE
 
 SYMBOL: inspector-stack
 
-SYMBOL: me
+SYMBOL: sorted-keys
 
 : reinspect ( obj -- )
     [ me set ]
     [
-        dup make-mirror dup mirror set dup sorted-keys dup \ keys set
-        inspector-hook get call
+        dup make-mirror dup mirror set
+        t +number-rows+ [ (describe) ] with-variable
+        sorted-keys set
     ] bi ;
 
 : (inspect) ( obj -- )
     [ inspector-stack get push ] [ reinspect ] bi ;
 
-: key@ ( n -- key ) \ keys get nth ;
+PRIVATE>
+
+: key@ ( n -- key ) sorted-keys get nth ;
 
 : &push ( -- obj ) me get ;
 
@@ -98,7 +91,7 @@ SYMBOL: me
 
 : &back ( -- )
     inspector-stack get
-    dup length 1 <= [ drop ] [ dup pop* peek reinspect ] if ;
+    dup length 1 <= [ drop ] [ [ pop* ] [ peek reinspect ] bi ] if ;
 
 : &add ( value key -- ) mirror get set-at &push reinspect ;
 
index 4fd4592ee15cae45e85984fdfd19868bfe97a243..63a5740845ef03117df61006a834c27b2f26a40e 100644 (file)
@@ -43,13 +43,13 @@ PRIVATE>
     >intervals ensure-disjoint interval-map boa ;\r
 \r
 : <interval-set> ( specification -- map )\r
-    [ dup 2array ] map <interval-map> ;\r
+    dup zip <interval-map> ;\r
 \r
 :: coalesce ( alist -- specification )\r
     ! Only works with integer keys, because they're discrete\r
     ! Makes 2array keys\r
     [\r
-        alist sort-keys unclip first2 dupd roll\r
+        alist sort-keys unclip swap [ [ first dup ] [ second ] bi ] dip\r
         [| oldkey oldval key val | ! Underneath is start\r
             oldkey 1+ key =\r
             oldval val = and\r
diff --git a/basis/io/encodings/japanese/CP932.TXT b/basis/io/encodings/japanese/CP932.TXT
new file mode 100644 (file)
index 0000000..7ff471b
--- /dev/null
@@ -0,0 +1,7998 @@
+#
+#    Name:     cp932 to Unicode table
+#    Unicode version: 2.0
+#    Table version: 2.01
+#    Table format:  Format A
+#    Date:          04/15/98
+#
+#    Contact:       Shawn.Steele@microsoft.com
+#
+#    General notes: none
+#
+#    Format: Three tab-separated columns
+#        Column #1 is the cp932 code (in hex)
+#        Column #2 is the Unicode (in hex as 0xXXXX)
+#        Column #3 is the Unicode name (follows a comment sign, '#')
+#
+#    The entries are in cp932 order
+#
+0x00   0x0000  #NULL
+0x01   0x0001  #START OF HEADING
+0x02   0x0002  #START OF TEXT
+0x03   0x0003  #END OF TEXT
+0x04   0x0004  #END OF TRANSMISSION
+0x05   0x0005  #ENQUIRY
+0x06   0x0006  #ACKNOWLEDGE
+0x07   0x0007  #BELL
+0x08   0x0008  #BACKSPACE
+0x09   0x0009  #HORIZONTAL TABULATION
+0x0A   0x000A  #LINE FEED
+0x0B   0x000B  #VERTICAL TABULATION
+0x0C   0x000C  #FORM FEED
+0x0D   0x000D  #CARRIAGE RETURN
+0x0E   0x000E  #SHIFT OUT
+0x0F   0x000F  #SHIFT IN
+0x10   0x0010  #DATA LINK ESCAPE
+0x11   0x0011  #DEVICE CONTROL ONE
+0x12   0x0012  #DEVICE CONTROL TWO
+0x13   0x0013  #DEVICE CONTROL THREE
+0x14   0x0014  #DEVICE CONTROL FOUR
+0x15   0x0015  #NEGATIVE ACKNOWLEDGE
+0x16   0x0016  #SYNCHRONOUS IDLE
+0x17   0x0017  #END OF TRANSMISSION BLOCK
+0x18   0x0018  #CANCEL
+0x19   0x0019  #END OF MEDIUM
+0x1A   0x001A  #SUBSTITUTE
+0x1B   0x001B  #ESCAPE
+0x1C   0x001C  #FILE SEPARATOR
+0x1D   0x001D  #GROUP SEPARATOR
+0x1E   0x001E  #RECORD SEPARATOR
+0x1F   0x001F  #UNIT SEPARATOR
+0x20   0x0020  #SPACE
+0x21   0x0021  #EXCLAMATION MARK
+0x22   0x0022  #QUOTATION MARK
+0x23   0x0023  #NUMBER SIGN
+0x24   0x0024  #DOLLAR SIGN
+0x25   0x0025  #PERCENT SIGN
+0x26   0x0026  #AMPERSAND
+0x27   0x0027  #APOSTROPHE
+0x28   0x0028  #LEFT PARENTHESIS
+0x29   0x0029  #RIGHT PARENTHESIS
+0x2A   0x002A  #ASTERISK
+0x2B   0x002B  #PLUS SIGN
+0x2C   0x002C  #COMMA
+0x2D   0x002D  #HYPHEN-MINUS
+0x2E   0x002E  #FULL STOP
+0x2F   0x002F  #SOLIDUS
+0x30   0x0030  #DIGIT ZERO
+0x31   0x0031  #DIGIT ONE
+0x32   0x0032  #DIGIT TWO
+0x33   0x0033  #DIGIT THREE
+0x34   0x0034  #DIGIT FOUR
+0x35   0x0035  #DIGIT FIVE
+0x36   0x0036  #DIGIT SIX
+0x37   0x0037  #DIGIT SEVEN
+0x38   0x0038  #DIGIT EIGHT
+0x39   0x0039  #DIGIT NINE
+0x3A   0x003A  #COLON
+0x3B   0x003B  #SEMICOLON
+0x3C   0x003C  #LESS-THAN SIGN
+0x3D   0x003D  #EQUALS SIGN
+0x3E   0x003E  #GREATER-THAN SIGN
+0x3F   0x003F  #QUESTION MARK
+0x40   0x0040  #COMMERCIAL AT
+0x41   0x0041  #LATIN CAPITAL LETTER A
+0x42   0x0042  #LATIN CAPITAL LETTER B
+0x43   0x0043  #LATIN CAPITAL LETTER C
+0x44   0x0044  #LATIN CAPITAL LETTER D
+0x45   0x0045  #LATIN CAPITAL LETTER E
+0x46   0x0046  #LATIN CAPITAL LETTER F
+0x47   0x0047  #LATIN CAPITAL LETTER G
+0x48   0x0048  #LATIN CAPITAL LETTER H
+0x49   0x0049  #LATIN CAPITAL LETTER I
+0x4A   0x004A  #LATIN CAPITAL LETTER J
+0x4B   0x004B  #LATIN CAPITAL LETTER K
+0x4C   0x004C  #LATIN CAPITAL LETTER L
+0x4D   0x004D  #LATIN CAPITAL LETTER M
+0x4E   0x004E  #LATIN CAPITAL LETTER N
+0x4F   0x004F  #LATIN CAPITAL LETTER O
+0x50   0x0050  #LATIN CAPITAL LETTER P
+0x51   0x0051  #LATIN CAPITAL LETTER Q
+0x52   0x0052  #LATIN CAPITAL LETTER R
+0x53   0x0053  #LATIN CAPITAL LETTER S
+0x54   0x0054  #LATIN CAPITAL LETTER T
+0x55   0x0055  #LATIN CAPITAL LETTER U
+0x56   0x0056  #LATIN CAPITAL LETTER V
+0x57   0x0057  #LATIN CAPITAL LETTER W
+0x58   0x0058  #LATIN CAPITAL LETTER X
+0x59   0x0059  #LATIN CAPITAL LETTER Y
+0x5A   0x005A  #LATIN CAPITAL LETTER Z
+0x5B   0x005B  #LEFT SQUARE BRACKET
+0x5C   0x005C  #REVERSE SOLIDUS
+0x5D   0x005D  #RIGHT SQUARE BRACKET
+0x5E   0x005E  #CIRCUMFLEX ACCENT
+0x5F   0x005F  #LOW LINE
+0x60   0x0060  #GRAVE ACCENT
+0x61   0x0061  #LATIN SMALL LETTER A
+0x62   0x0062  #LATIN SMALL LETTER B
+0x63   0x0063  #LATIN SMALL LETTER C
+0x64   0x0064  #LATIN SMALL LETTER D
+0x65   0x0065  #LATIN SMALL LETTER E
+0x66   0x0066  #LATIN SMALL LETTER F
+0x67   0x0067  #LATIN SMALL LETTER G
+0x68   0x0068  #LATIN SMALL LETTER H
+0x69   0x0069  #LATIN SMALL LETTER I
+0x6A   0x006A  #LATIN SMALL LETTER J
+0x6B   0x006B  #LATIN SMALL LETTER K
+0x6C   0x006C  #LATIN SMALL LETTER L
+0x6D   0x006D  #LATIN SMALL LETTER M
+0x6E   0x006E  #LATIN SMALL LETTER N
+0x6F   0x006F  #LATIN SMALL LETTER O
+0x70   0x0070  #LATIN SMALL LETTER P
+0x71   0x0071  #LATIN SMALL LETTER Q
+0x72   0x0072  #LATIN SMALL LETTER R
+0x73   0x0073  #LATIN SMALL LETTER S
+0x74   0x0074  #LATIN SMALL LETTER T
+0x75   0x0075  #LATIN SMALL LETTER U
+0x76   0x0076  #LATIN SMALL LETTER V
+0x77   0x0077  #LATIN SMALL LETTER W
+0x78   0x0078  #LATIN SMALL LETTER X
+0x79   0x0079  #LATIN SMALL LETTER Y
+0x7A   0x007A  #LATIN SMALL LETTER Z
+0x7B   0x007B  #LEFT CURLY BRACKET
+0x7C   0x007C  #VERTICAL LINE
+0x7D   0x007D  #RIGHT CURLY BRACKET
+0x7E   0x007E  #TILDE
+0x7F   0x007F  #DELETE
+0x80           #UNDEFINED
+0x81           #DBCS LEAD BYTE
+0x82           #DBCS LEAD BYTE
+0x83           #DBCS LEAD BYTE
+0x84           #DBCS LEAD BYTE
+0x85           #DBCS LEAD BYTE
+0x86           #DBCS LEAD BYTE
+0x87           #DBCS LEAD BYTE
+0x88           #DBCS LEAD BYTE
+0x89           #DBCS LEAD BYTE
+0x8A           #DBCS LEAD BYTE
+0x8B           #DBCS LEAD BYTE
+0x8C           #DBCS LEAD BYTE
+0x8D           #DBCS LEAD BYTE
+0x8E           #DBCS LEAD BYTE
+0x8F           #DBCS LEAD BYTE
+0x90           #DBCS LEAD BYTE
+0x91           #DBCS LEAD BYTE
+0x92           #DBCS LEAD BYTE
+0x93           #DBCS LEAD BYTE
+0x94           #DBCS LEAD BYTE
+0x95           #DBCS LEAD BYTE
+0x96           #DBCS LEAD BYTE
+0x97           #DBCS LEAD BYTE
+0x98           #DBCS LEAD BYTE
+0x99           #DBCS LEAD BYTE
+0x9A           #DBCS LEAD BYTE
+0x9B           #DBCS LEAD BYTE
+0x9C           #DBCS LEAD BYTE
+0x9D           #DBCS LEAD BYTE
+0x9E           #DBCS LEAD BYTE
+0x9F           #DBCS LEAD BYTE
+0xA0           #UNDEFINED
+0xA1   0xFF61  #HALFWIDTH IDEOGRAPHIC FULL STOP
+0xA2   0xFF62  #HALFWIDTH LEFT CORNER BRACKET
+0xA3   0xFF63  #HALFWIDTH RIGHT CORNER BRACKET
+0xA4   0xFF64  #HALFWIDTH IDEOGRAPHIC COMMA
+0xA5   0xFF65  #HALFWIDTH KATAKANA MIDDLE DOT
+0xA6   0xFF66  #HALFWIDTH KATAKANA LETTER WO
+0xA7   0xFF67  #HALFWIDTH KATAKANA LETTER SMALL A
+0xA8   0xFF68  #HALFWIDTH KATAKANA LETTER SMALL I
+0xA9   0xFF69  #HALFWIDTH KATAKANA LETTER SMALL U
+0xAA   0xFF6A  #HALFWIDTH KATAKANA LETTER SMALL E
+0xAB   0xFF6B  #HALFWIDTH KATAKANA LETTER SMALL O
+0xAC   0xFF6C  #HALFWIDTH KATAKANA LETTER SMALL YA
+0xAD   0xFF6D  #HALFWIDTH KATAKANA LETTER SMALL YU
+0xAE   0xFF6E  #HALFWIDTH KATAKANA LETTER SMALL YO
+0xAF   0xFF6F  #HALFWIDTH KATAKANA LETTER SMALL TU
+0xB0   0xFF70  #HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK
+0xB1   0xFF71  #HALFWIDTH KATAKANA LETTER A
+0xB2   0xFF72  #HALFWIDTH KATAKANA LETTER I
+0xB3   0xFF73  #HALFWIDTH KATAKANA LETTER U
+0xB4   0xFF74  #HALFWIDTH KATAKANA LETTER E
+0xB5   0xFF75  #HALFWIDTH KATAKANA LETTER O
+0xB6   0xFF76  #HALFWIDTH KATAKANA LETTER KA
+0xB7   0xFF77  #HALFWIDTH KATAKANA LETTER KI
+0xB8   0xFF78  #HALFWIDTH KATAKANA LETTER KU
+0xB9   0xFF79  #HALFWIDTH KATAKANA LETTER KE
+0xBA   0xFF7A  #HALFWIDTH KATAKANA LETTER KO
+0xBB   0xFF7B  #HALFWIDTH KATAKANA LETTER SA
+0xBC   0xFF7C  #HALFWIDTH KATAKANA LETTER SI
+0xBD   0xFF7D  #HALFWIDTH KATAKANA LETTER SU
+0xBE   0xFF7E  #HALFWIDTH KATAKANA LETTER SE
+0xBF   0xFF7F  #HALFWIDTH KATAKANA LETTER SO
+0xC0   0xFF80  #HALFWIDTH KATAKANA LETTER TA
+0xC1   0xFF81  #HALFWIDTH KATAKANA LETTER TI
+0xC2   0xFF82  #HALFWIDTH KATAKANA LETTER TU
+0xC3   0xFF83  #HALFWIDTH KATAKANA LETTER TE
+0xC4   0xFF84  #HALFWIDTH KATAKANA LETTER TO
+0xC5   0xFF85  #HALFWIDTH KATAKANA LETTER NA
+0xC6   0xFF86  #HALFWIDTH KATAKANA LETTER NI
+0xC7   0xFF87  #HALFWIDTH KATAKANA LETTER NU
+0xC8   0xFF88  #HALFWIDTH KATAKANA LETTER NE
+0xC9   0xFF89  #HALFWIDTH KATAKANA LETTER NO
+0xCA   0xFF8A  #HALFWIDTH KATAKANA LETTER HA
+0xCB   0xFF8B  #HALFWIDTH KATAKANA LETTER HI
+0xCC   0xFF8C  #HALFWIDTH KATAKANA LETTER HU
+0xCD   0xFF8D  #HALFWIDTH KATAKANA LETTER HE
+0xCE   0xFF8E  #HALFWIDTH KATAKANA LETTER HO
+0xCF   0xFF8F  #HALFWIDTH KATAKANA LETTER MA
+0xD0   0xFF90  #HALFWIDTH KATAKANA LETTER MI
+0xD1   0xFF91  #HALFWIDTH KATAKANA LETTER MU
+0xD2   0xFF92  #HALFWIDTH KATAKANA LETTER ME
+0xD3   0xFF93  #HALFWIDTH KATAKANA LETTER MO
+0xD4   0xFF94  #HALFWIDTH KATAKANA LETTER YA
+0xD5   0xFF95  #HALFWIDTH KATAKANA LETTER YU
+0xD6   0xFF96  #HALFWIDTH KATAKANA LETTER YO
+0xD7   0xFF97  #HALFWIDTH KATAKANA LETTER RA
+0xD8   0xFF98  #HALFWIDTH KATAKANA LETTER RI
+0xD9   0xFF99  #HALFWIDTH KATAKANA LETTER RU
+0xDA   0xFF9A  #HALFWIDTH KATAKANA LETTER RE
+0xDB   0xFF9B  #HALFWIDTH KATAKANA LETTER RO
+0xDC   0xFF9C  #HALFWIDTH KATAKANA LETTER WA
+0xDD   0xFF9D  #HALFWIDTH KATAKANA LETTER N
+0xDE   0xFF9E  #HALFWIDTH KATAKANA VOICED SOUND MARK
+0xDF   0xFF9F  #HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+0xE0           #DBCS LEAD BYTE
+0xE1           #DBCS LEAD BYTE
+0xE2           #DBCS LEAD BYTE
+0xE3           #DBCS LEAD BYTE
+0xE4           #DBCS LEAD BYTE
+0xE5           #DBCS LEAD BYTE
+0xE6           #DBCS LEAD BYTE
+0xE7           #DBCS LEAD BYTE
+0xE8           #DBCS LEAD BYTE
+0xE9           #DBCS LEAD BYTE
+0xEA           #DBCS LEAD BYTE
+0xEB           #DBCS LEAD BYTE
+0xEC           #DBCS LEAD BYTE
+0xED           #DBCS LEAD BYTE
+0xEE           #DBCS LEAD BYTE
+0xEF           #DBCS LEAD BYTE
+0xF0           #DBCS LEAD BYTE
+0xF1           #DBCS LEAD BYTE
+0xF2           #DBCS LEAD BYTE
+0xF3           #DBCS LEAD BYTE
+0xF4           #DBCS LEAD BYTE
+0xF5           #DBCS LEAD BYTE
+0xF6           #DBCS LEAD BYTE
+0xF7           #DBCS LEAD BYTE
+0xF8           #DBCS LEAD BYTE
+0xF9           #DBCS LEAD BYTE
+0xFA           #DBCS LEAD BYTE
+0xFB           #DBCS LEAD BYTE
+0xFC           #DBCS LEAD BYTE
+0xFD           #UNDEFINED
+0xFE           #UNDEFINED
+0xFF           #UNDEFINED
+0x8140 0x3000  #IDEOGRAPHIC SPACE
+0x8141 0x3001  #IDEOGRAPHIC COMMA
+0x8142 0x3002  #IDEOGRAPHIC FULL STOP
+0x8143 0xFF0C  #FULLWIDTH COMMA
+0x8144 0xFF0E  #FULLWIDTH FULL STOP
+0x8145 0x30FB  #KATAKANA MIDDLE DOT
+0x8146 0xFF1A  #FULLWIDTH COLON
+0x8147 0xFF1B  #FULLWIDTH SEMICOLON
+0x8148 0xFF1F  #FULLWIDTH QUESTION MARK
+0x8149 0xFF01  #FULLWIDTH EXCLAMATION MARK
+0x814A 0x309B  #KATAKANA-HIRAGANA VOICED SOUND MARK
+0x814B 0x309C  #KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+0x814C 0x00B4  #ACUTE ACCENT
+0x814D 0xFF40  #FULLWIDTH GRAVE ACCENT
+0x814E 0x00A8  #DIAERESIS
+0x814F 0xFF3E  #FULLWIDTH CIRCUMFLEX ACCENT
+0x8150 0xFFE3  #FULLWIDTH MACRON
+0x8151 0xFF3F  #FULLWIDTH LOW LINE
+0x8152 0x30FD  #KATAKANA ITERATION MARK
+0x8153 0x30FE  #KATAKANA VOICED ITERATION MARK
+0x8154 0x309D  #HIRAGANA ITERATION MARK
+0x8155 0x309E  #HIRAGANA VOICED ITERATION MARK
+0x8156 0x3003  #DITTO MARK
+0x8157 0x4EDD  #CJK UNIFIED IDEOGRAPH
+0x8158 0x3005  #IDEOGRAPHIC ITERATION MARK
+0x8159 0x3006  #IDEOGRAPHIC CLOSING MARK
+0x815A 0x3007  #IDEOGRAPHIC NUMBER ZERO
+0x815B 0x30FC  #KATAKANA-HIRAGANA PROLONGED SOUND MARK
+0x815C 0x2015  #HORIZONTAL BAR
+0x815D 0x2010  #HYPHEN
+0x815E 0xFF0F  #FULLWIDTH SOLIDUS
+0x815F 0xFF3C  #FULLWIDTH REVERSE SOLIDUS
+0x8160 0xFF5E  #FULLWIDTH TILDE
+0x8161 0x2225  #PARALLEL TO
+0x8162 0xFF5C  #FULLWIDTH VERTICAL LINE
+0x8163 0x2026  #HORIZONTAL ELLIPSIS
+0x8164 0x2025  #TWO DOT LEADER
+0x8165 0x2018  #LEFT SINGLE QUOTATION MARK
+0x8166 0x2019  #RIGHT SINGLE QUOTATION MARK
+0x8167 0x201C  #LEFT DOUBLE QUOTATION MARK
+0x8168 0x201D  #RIGHT DOUBLE QUOTATION MARK
+0x8169 0xFF08  #FULLWIDTH LEFT PARENTHESIS
+0x816A 0xFF09  #FULLWIDTH RIGHT PARENTHESIS
+0x816B 0x3014  #LEFT TORTOISE SHELL BRACKET
+0x816C 0x3015  #RIGHT TORTOISE SHELL BRACKET
+0x816D 0xFF3B  #FULLWIDTH LEFT SQUARE BRACKET
+0x816E 0xFF3D  #FULLWIDTH RIGHT SQUARE BRACKET
+0x816F 0xFF5B  #FULLWIDTH LEFT CURLY BRACKET
+0x8170 0xFF5D  #FULLWIDTH RIGHT CURLY BRACKET
+0x8171 0x3008  #LEFT ANGLE BRACKET
+0x8172 0x3009  #RIGHT ANGLE BRACKET
+0x8173 0x300A  #LEFT DOUBLE ANGLE BRACKET
+0x8174 0x300B  #RIGHT DOUBLE ANGLE BRACKET
+0x8175 0x300C  #LEFT CORNER BRACKET
+0x8176 0x300D  #RIGHT CORNER BRACKET
+0x8177 0x300E  #LEFT WHITE CORNER BRACKET
+0x8178 0x300F  #RIGHT WHITE CORNER BRACKET
+0x8179 0x3010  #LEFT BLACK LENTICULAR BRACKET
+0x817A 0x3011  #RIGHT BLACK LENTICULAR BRACKET
+0x817B 0xFF0B  #FULLWIDTH PLUS SIGN
+0x817C 0xFF0D  #FULLWIDTH HYPHEN-MINUS
+0x817D 0x00B1  #PLUS-MINUS SIGN
+0x817E 0x00D7  #MULTIPLICATION SIGN
+0x8180 0x00F7  #DIVISION SIGN
+0x8181 0xFF1D  #FULLWIDTH EQUALS SIGN
+0x8182 0x2260  #NOT EQUAL TO
+0x8183 0xFF1C  #FULLWIDTH LESS-THAN SIGN
+0x8184 0xFF1E  #FULLWIDTH GREATER-THAN SIGN
+0x8185 0x2266  #LESS-THAN OVER EQUAL TO
+0x8186 0x2267  #GREATER-THAN OVER EQUAL TO
+0x8187 0x221E  #INFINITY
+0x8188 0x2234  #THEREFORE
+0x8189 0x2642  #MALE SIGN
+0x818A 0x2640  #FEMALE SIGN
+0x818B 0x00B0  #DEGREE SIGN
+0x818C 0x2032  #PRIME
+0x818D 0x2033  #DOUBLE PRIME
+0x818E 0x2103  #DEGREE CELSIUS
+0x818F 0xFFE5  #FULLWIDTH YEN SIGN
+0x8190 0xFF04  #FULLWIDTH DOLLAR SIGN
+0x8191 0xFFE0  #FULLWIDTH CENT SIGN
+0x8192 0xFFE1  #FULLWIDTH POUND SIGN
+0x8193 0xFF05  #FULLWIDTH PERCENT SIGN
+0x8194 0xFF03  #FULLWIDTH NUMBER SIGN
+0x8195 0xFF06  #FULLWIDTH AMPERSAND
+0x8196 0xFF0A  #FULLWIDTH ASTERISK
+0x8197 0xFF20  #FULLWIDTH COMMERCIAL AT
+0x8198 0x00A7  #SECTION SIGN
+0x8199 0x2606  #WHITE STAR
+0x819A 0x2605  #BLACK STAR
+0x819B 0x25CB  #WHITE CIRCLE
+0x819C 0x25CF  #BLACK CIRCLE
+0x819D 0x25CE  #BULLSEYE
+0x819E 0x25C7  #WHITE DIAMOND
+0x819F 0x25C6  #BLACK DIAMOND
+0x81A0 0x25A1  #WHITE SQUARE
+0x81A1 0x25A0  #BLACK SQUARE
+0x81A2 0x25B3  #WHITE UP-POINTING TRIANGLE
+0x81A3 0x25B2  #BLACK UP-POINTING TRIANGLE
+0x81A4 0x25BD  #WHITE DOWN-POINTING TRIANGLE
+0x81A5 0x25BC  #BLACK DOWN-POINTING TRIANGLE
+0x81A6 0x203B  #REFERENCE MARK
+0x81A7 0x3012  #POSTAL MARK
+0x81A8 0x2192  #RIGHTWARDS ARROW
+0x81A9 0x2190  #LEFTWARDS ARROW
+0x81AA 0x2191  #UPWARDS ARROW
+0x81AB 0x2193  #DOWNWARDS ARROW
+0x81AC 0x3013  #GETA MARK
+0x81B8 0x2208  #ELEMENT OF
+0x81B9 0x220B  #CONTAINS AS MEMBER
+0x81BA 0x2286  #SUBSET OF OR EQUAL TO
+0x81BB 0x2287  #SUPERSET OF OR EQUAL TO
+0x81BC 0x2282  #SUBSET OF
+0x81BD 0x2283  #SUPERSET OF
+0x81BE 0x222A  #UNION
+0x81BF 0x2229  #INTERSECTION
+0x81C8 0x2227  #LOGICAL AND
+0x81C9 0x2228  #LOGICAL OR
+0x81CA 0xFFE2  #FULLWIDTH NOT SIGN
+0x81CB 0x21D2  #RIGHTWARDS DOUBLE ARROW
+0x81CC 0x21D4  #LEFT RIGHT DOUBLE ARROW
+0x81CD 0x2200  #FOR ALL
+0x81CE 0x2203  #THERE EXISTS
+0x81DA 0x2220  #ANGLE
+0x81DB 0x22A5  #UP TACK
+0x81DC 0x2312  #ARC
+0x81DD 0x2202  #PARTIAL DIFFERENTIAL
+0x81DE 0x2207  #NABLA
+0x81DF 0x2261  #IDENTICAL TO
+0x81E0 0x2252  #APPROXIMATELY EQUAL TO OR THE IMAGE OF
+0x81E1 0x226A  #MUCH LESS-THAN
+0x81E2 0x226B  #MUCH GREATER-THAN
+0x81E3 0x221A  #SQUARE ROOT
+0x81E4 0x223D  #REVERSED TILDE
+0x81E5 0x221D  #PROPORTIONAL TO
+0x81E6 0x2235  #BECAUSE
+0x81E7 0x222B  #INTEGRAL
+0x81E8 0x222C  #DOUBLE INTEGRAL
+0x81F0 0x212B  #ANGSTROM SIGN
+0x81F1 0x2030  #PER MILLE SIGN
+0x81F2 0x266F  #MUSIC SHARP SIGN
+0x81F3 0x266D  #MUSIC FLAT SIGN
+0x81F4 0x266A  #EIGHTH NOTE
+0x81F5 0x2020  #DAGGER
+0x81F6 0x2021  #DOUBLE DAGGER
+0x81F7 0x00B6  #PILCROW SIGN
+0x81FC 0x25EF  #LARGE CIRCLE
+0x824F 0xFF10  #FULLWIDTH DIGIT ZERO
+0x8250 0xFF11  #FULLWIDTH DIGIT ONE
+0x8251 0xFF12  #FULLWIDTH DIGIT TWO
+0x8252 0xFF13  #FULLWIDTH DIGIT THREE
+0x8253 0xFF14  #FULLWIDTH DIGIT FOUR
+0x8254 0xFF15  #FULLWIDTH DIGIT FIVE
+0x8255 0xFF16  #FULLWIDTH DIGIT SIX
+0x8256 0xFF17  #FULLWIDTH DIGIT SEVEN
+0x8257 0xFF18  #FULLWIDTH DIGIT EIGHT
+0x8258 0xFF19  #FULLWIDTH DIGIT NINE
+0x8260 0xFF21  #FULLWIDTH LATIN CAPITAL LETTER A
+0x8261 0xFF22  #FULLWIDTH LATIN CAPITAL LETTER B
+0x8262 0xFF23  #FULLWIDTH LATIN CAPITAL LETTER C
+0x8263 0xFF24  #FULLWIDTH LATIN CAPITAL LETTER D
+0x8264 0xFF25  #FULLWIDTH LATIN CAPITAL LETTER E
+0x8265 0xFF26  #FULLWIDTH LATIN CAPITAL LETTER F
+0x8266 0xFF27  #FULLWIDTH LATIN CAPITAL LETTER G
+0x8267 0xFF28  #FULLWIDTH LATIN CAPITAL LETTER H
+0x8268 0xFF29  #FULLWIDTH LATIN CAPITAL LETTER I
+0x8269 0xFF2A  #FULLWIDTH LATIN CAPITAL LETTER J
+0x826A 0xFF2B  #FULLWIDTH LATIN CAPITAL LETTER K
+0x826B 0xFF2C  #FULLWIDTH LATIN CAPITAL LETTER L
+0x826C 0xFF2D  #FULLWIDTH LATIN CAPITAL LETTER M
+0x826D 0xFF2E  #FULLWIDTH LATIN CAPITAL LETTER N
+0x826E 0xFF2F  #FULLWIDTH LATIN CAPITAL LETTER O
+0x826F 0xFF30  #FULLWIDTH LATIN CAPITAL LETTER P
+0x8270 0xFF31  #FULLWIDTH LATIN CAPITAL LETTER Q
+0x8271 0xFF32  #FULLWIDTH LATIN CAPITAL LETTER R
+0x8272 0xFF33  #FULLWIDTH LATIN CAPITAL LETTER S
+0x8273 0xFF34  #FULLWIDTH LATIN CAPITAL LETTER T
+0x8274 0xFF35  #FULLWIDTH LATIN CAPITAL LETTER U
+0x8275 0xFF36  #FULLWIDTH LATIN CAPITAL LETTER V
+0x8276 0xFF37  #FULLWIDTH LATIN CAPITAL LETTER W
+0x8277 0xFF38  #FULLWIDTH LATIN CAPITAL LETTER X
+0x8278 0xFF39  #FULLWIDTH LATIN CAPITAL LETTER Y
+0x8279 0xFF3A  #FULLWIDTH LATIN CAPITAL LETTER Z
+0x8281 0xFF41  #FULLWIDTH LATIN SMALL LETTER A
+0x8282 0xFF42  #FULLWIDTH LATIN SMALL LETTER B
+0x8283 0xFF43  #FULLWIDTH LATIN SMALL LETTER C
+0x8284 0xFF44  #FULLWIDTH LATIN SMALL LETTER D
+0x8285 0xFF45  #FULLWIDTH LATIN SMALL LETTER E
+0x8286 0xFF46  #FULLWIDTH LATIN SMALL LETTER F
+0x8287 0xFF47  #FULLWIDTH LATIN SMALL LETTER G
+0x8288 0xFF48  #FULLWIDTH LATIN SMALL LETTER H
+0x8289 0xFF49  #FULLWIDTH LATIN SMALL LETTER I
+0x828A 0xFF4A  #FULLWIDTH LATIN SMALL LETTER J
+0x828B 0xFF4B  #FULLWIDTH LATIN SMALL LETTER K
+0x828C 0xFF4C  #FULLWIDTH LATIN SMALL LETTER L
+0x828D 0xFF4D  #FULLWIDTH LATIN SMALL LETTER M
+0x828E 0xFF4E  #FULLWIDTH LATIN SMALL LETTER N
+0x828F 0xFF4F  #FULLWIDTH LATIN SMALL LETTER O
+0x8290 0xFF50  #FULLWIDTH LATIN SMALL LETTER P
+0x8291 0xFF51  #FULLWIDTH LATIN SMALL LETTER Q
+0x8292 0xFF52  #FULLWIDTH LATIN SMALL LETTER R
+0x8293 0xFF53  #FULLWIDTH LATIN SMALL LETTER S
+0x8294 0xFF54  #FULLWIDTH LATIN SMALL LETTER T
+0x8295 0xFF55  #FULLWIDTH LATIN SMALL LETTER U
+0x8296 0xFF56  #FULLWIDTH LATIN SMALL LETTER V
+0x8297 0xFF57  #FULLWIDTH LATIN SMALL LETTER W
+0x8298 0xFF58  #FULLWIDTH LATIN SMALL LETTER X
+0x8299 0xFF59  #FULLWIDTH LATIN SMALL LETTER Y
+0x829A 0xFF5A  #FULLWIDTH LATIN SMALL LETTER Z
+0x829F 0x3041  #HIRAGANA LETTER SMALL A
+0x82A0 0x3042  #HIRAGANA LETTER A
+0x82A1 0x3043  #HIRAGANA LETTER SMALL I
+0x82A2 0x3044  #HIRAGANA LETTER I
+0x82A3 0x3045  #HIRAGANA LETTER SMALL U
+0x82A4 0x3046  #HIRAGANA LETTER U
+0x82A5 0x3047  #HIRAGANA LETTER SMALL E
+0x82A6 0x3048  #HIRAGANA LETTER E
+0x82A7 0x3049  #HIRAGANA LETTER SMALL O
+0x82A8 0x304A  #HIRAGANA LETTER O
+0x82A9 0x304B  #HIRAGANA LETTER KA
+0x82AA 0x304C  #HIRAGANA LETTER GA
+0x82AB 0x304D  #HIRAGANA LETTER KI
+0x82AC 0x304E  #HIRAGANA LETTER GI
+0x82AD 0x304F  #HIRAGANA LETTER KU
+0x82AE 0x3050  #HIRAGANA LETTER GU
+0x82AF 0x3051  #HIRAGANA LETTER KE
+0x82B0 0x3052  #HIRAGANA LETTER GE
+0x82B1 0x3053  #HIRAGANA LETTER KO
+0x82B2 0x3054  #HIRAGANA LETTER GO
+0x82B3 0x3055  #HIRAGANA LETTER SA
+0x82B4 0x3056  #HIRAGANA LETTER ZA
+0x82B5 0x3057  #HIRAGANA LETTER SI
+0x82B6 0x3058  #HIRAGANA LETTER ZI
+0x82B7 0x3059  #HIRAGANA LETTER SU
+0x82B8 0x305A  #HIRAGANA LETTER ZU
+0x82B9 0x305B  #HIRAGANA LETTER SE
+0x82BA 0x305C  #HIRAGANA LETTER ZE
+0x82BB 0x305D  #HIRAGANA LETTER SO
+0x82BC 0x305E  #HIRAGANA LETTER ZO
+0x82BD 0x305F  #HIRAGANA LETTER TA
+0x82BE 0x3060  #HIRAGANA LETTER DA
+0x82BF 0x3061  #HIRAGANA LETTER TI
+0x82C0 0x3062  #HIRAGANA LETTER DI
+0x82C1 0x3063  #HIRAGANA LETTER SMALL TU
+0x82C2 0x3064  #HIRAGANA LETTER TU
+0x82C3 0x3065  #HIRAGANA LETTER DU
+0x82C4 0x3066  #HIRAGANA LETTER TE
+0x82C5 0x3067  #HIRAGANA LETTER DE
+0x82C6 0x3068  #HIRAGANA LETTER TO
+0x82C7 0x3069  #HIRAGANA LETTER DO
+0x82C8 0x306A  #HIRAGANA LETTER NA
+0x82C9 0x306B  #HIRAGANA LETTER NI
+0x82CA 0x306C  #HIRAGANA LETTER NU
+0x82CB 0x306D  #HIRAGANA LETTER NE
+0x82CC 0x306E  #HIRAGANA LETTER NO
+0x82CD 0x306F  #HIRAGANA LETTER HA
+0x82CE 0x3070  #HIRAGANA LETTER BA
+0x82CF 0x3071  #HIRAGANA LETTER PA
+0x82D0 0x3072  #HIRAGANA LETTER HI
+0x82D1 0x3073  #HIRAGANA LETTER BI
+0x82D2 0x3074  #HIRAGANA LETTER PI
+0x82D3 0x3075  #HIRAGANA LETTER HU
+0x82D4 0x3076  #HIRAGANA LETTER BU
+0x82D5 0x3077  #HIRAGANA LETTER PU
+0x82D6 0x3078  #HIRAGANA LETTER HE
+0x82D7 0x3079  #HIRAGANA LETTER BE
+0x82D8 0x307A  #HIRAGANA LETTER PE
+0x82D9 0x307B  #HIRAGANA LETTER HO
+0x82DA 0x307C  #HIRAGANA LETTER BO
+0x82DB 0x307D  #HIRAGANA LETTER PO
+0x82DC 0x307E  #HIRAGANA LETTER MA
+0x82DD 0x307F  #HIRAGANA LETTER MI
+0x82DE 0x3080  #HIRAGANA LETTER MU
+0x82DF 0x3081  #HIRAGANA LETTER ME
+0x82E0 0x3082  #HIRAGANA LETTER MO
+0x82E1 0x3083  #HIRAGANA LETTER SMALL YA
+0x82E2 0x3084  #HIRAGANA LETTER YA
+0x82E3 0x3085  #HIRAGANA LETTER SMALL YU
+0x82E4 0x3086  #HIRAGANA LETTER YU
+0x82E5 0x3087  #HIRAGANA LETTER SMALL YO
+0x82E6 0x3088  #HIRAGANA LETTER YO
+0x82E7 0x3089  #HIRAGANA LETTER RA
+0x82E8 0x308A  #HIRAGANA LETTER RI
+0x82E9 0x308B  #HIRAGANA LETTER RU
+0x82EA 0x308C  #HIRAGANA LETTER RE
+0x82EB 0x308D  #HIRAGANA LETTER RO
+0x82EC 0x308E  #HIRAGANA LETTER SMALL WA
+0x82ED 0x308F  #HIRAGANA LETTER WA
+0x82EE 0x3090  #HIRAGANA LETTER WI
+0x82EF 0x3091  #HIRAGANA LETTER WE
+0x82F0 0x3092  #HIRAGANA LETTER WO
+0x82F1 0x3093  #HIRAGANA LETTER N
+0x8340 0x30A1  #KATAKANA LETTER SMALL A
+0x8341 0x30A2  #KATAKANA LETTER A
+0x8342 0x30A3  #KATAKANA LETTER SMALL I
+0x8343 0x30A4  #KATAKANA LETTER I
+0x8344 0x30A5  #KATAKANA LETTER SMALL U
+0x8345 0x30A6  #KATAKANA LETTER U
+0x8346 0x30A7  #KATAKANA LETTER SMALL E
+0x8347 0x30A8  #KATAKANA LETTER E
+0x8348 0x30A9  #KATAKANA LETTER SMALL O
+0x8349 0x30AA  #KATAKANA LETTER O
+0x834A 0x30AB  #KATAKANA LETTER KA
+0x834B 0x30AC  #KATAKANA LETTER GA
+0x834C 0x30AD  #KATAKANA LETTER KI
+0x834D 0x30AE  #KATAKANA LETTER GI
+0x834E 0x30AF  #KATAKANA LETTER KU
+0x834F 0x30B0  #KATAKANA LETTER GU
+0x8350 0x30B1  #KATAKANA LETTER KE
+0x8351 0x30B2  #KATAKANA LETTER GE
+0x8352 0x30B3  #KATAKANA LETTER KO
+0x8353 0x30B4  #KATAKANA LETTER GO
+0x8354 0x30B5  #KATAKANA LETTER SA
+0x8355 0x30B6  #KATAKANA LETTER ZA
+0x8356 0x30B7  #KATAKANA LETTER SI
+0x8357 0x30B8  #KATAKANA LETTER ZI
+0x8358 0x30B9  #KATAKANA LETTER SU
+0x8359 0x30BA  #KATAKANA LETTER ZU
+0x835A 0x30BB  #KATAKANA LETTER SE
+0x835B 0x30BC  #KATAKANA LETTER ZE
+0x835C 0x30BD  #KATAKANA LETTER SO
+0x835D 0x30BE  #KATAKANA LETTER ZO
+0x835E 0x30BF  #KATAKANA LETTER TA
+0x835F 0x30C0  #KATAKANA LETTER DA
+0x8360 0x30C1  #KATAKANA LETTER TI
+0x8361 0x30C2  #KATAKANA LETTER DI
+0x8362 0x30C3  #KATAKANA LETTER SMALL TU
+0x8363 0x30C4  #KATAKANA LETTER TU
+0x8364 0x30C5  #KATAKANA LETTER DU
+0x8365 0x30C6  #KATAKANA LETTER TE
+0x8366 0x30C7  #KATAKANA LETTER DE
+0x8367 0x30C8  #KATAKANA LETTER TO
+0x8368 0x30C9  #KATAKANA LETTER DO
+0x8369 0x30CA  #KATAKANA LETTER NA
+0x836A 0x30CB  #KATAKANA LETTER NI
+0x836B 0x30CC  #KATAKANA LETTER NU
+0x836C 0x30CD  #KATAKANA LETTER NE
+0x836D 0x30CE  #KATAKANA LETTER NO
+0x836E 0x30CF  #KATAKANA LETTER HA
+0x836F 0x30D0  #KATAKANA LETTER BA
+0x8370 0x30D1  #KATAKANA LETTER PA
+0x8371 0x30D2  #KATAKANA LETTER HI
+0x8372 0x30D3  #KATAKANA LETTER BI
+0x8373 0x30D4  #KATAKANA LETTER PI
+0x8374 0x30D5  #KATAKANA LETTER HU
+0x8375 0x30D6  #KATAKANA LETTER BU
+0x8376 0x30D7  #KATAKANA LETTER PU
+0x8377 0x30D8  #KATAKANA LETTER HE
+0x8378 0x30D9  #KATAKANA LETTER BE
+0x8379 0x30DA  #KATAKANA LETTER PE
+0x837A 0x30DB  #KATAKANA LETTER HO
+0x837B 0x30DC  #KATAKANA LETTER BO
+0x837C 0x30DD  #KATAKANA LETTER PO
+0x837D 0x30DE  #KATAKANA LETTER MA
+0x837E 0x30DF  #KATAKANA LETTER MI
+0x8380 0x30E0  #KATAKANA LETTER MU
+0x8381 0x30E1  #KATAKANA LETTER ME
+0x8382 0x30E2  #KATAKANA LETTER MO
+0x8383 0x30E3  #KATAKANA LETTER SMALL YA
+0x8384 0x30E4  #KATAKANA LETTER YA
+0x8385 0x30E5  #KATAKANA LETTER SMALL YU
+0x8386 0x30E6  #KATAKANA LETTER YU
+0x8387 0x30E7  #KATAKANA LETTER SMALL YO
+0x8388 0x30E8  #KATAKANA LETTER YO
+0x8389 0x30E9  #KATAKANA LETTER RA
+0x838A 0x30EA  #KATAKANA LETTER RI
+0x838B 0x30EB  #KATAKANA LETTER RU
+0x838C 0x30EC  #KATAKANA LETTER RE
+0x838D 0x30ED  #KATAKANA LETTER RO
+0x838E 0x30EE  #KATAKANA LETTER SMALL WA
+0x838F 0x30EF  #KATAKANA LETTER WA
+0x8390 0x30F0  #KATAKANA LETTER WI
+0x8391 0x30F1  #KATAKANA LETTER WE
+0x8392 0x30F2  #KATAKANA LETTER WO
+0x8393 0x30F3  #KATAKANA LETTER N
+0x8394 0x30F4  #KATAKANA LETTER VU
+0x8395 0x30F5  #KATAKANA LETTER SMALL KA
+0x8396 0x30F6  #KATAKANA LETTER SMALL KE
+0x839F 0x0391  #GREEK CAPITAL LETTER ALPHA
+0x83A0 0x0392  #GREEK CAPITAL LETTER BETA
+0x83A1 0x0393  #GREEK CAPITAL LETTER GAMMA
+0x83A2 0x0394  #GREEK CAPITAL LETTER DELTA
+0x83A3 0x0395  #GREEK CAPITAL LETTER EPSILON
+0x83A4 0x0396  #GREEK CAPITAL LETTER ZETA
+0x83A5 0x0397  #GREEK CAPITAL LETTER ETA
+0x83A6 0x0398  #GREEK CAPITAL LETTER THETA
+0x83A7 0x0399  #GREEK CAPITAL LETTER IOTA
+0x83A8 0x039A  #GREEK CAPITAL LETTER KAPPA
+0x83A9 0x039B  #GREEK CAPITAL LETTER LAMDA
+0x83AA 0x039C  #GREEK CAPITAL LETTER MU
+0x83AB 0x039D  #GREEK CAPITAL LETTER NU
+0x83AC 0x039E  #GREEK CAPITAL LETTER XI
+0x83AD 0x039F  #GREEK CAPITAL LETTER OMICRON
+0x83AE 0x03A0  #GREEK CAPITAL LETTER PI
+0x83AF 0x03A1  #GREEK CAPITAL LETTER RHO
+0x83B0 0x03A3  #GREEK CAPITAL LETTER SIGMA
+0x83B1 0x03A4  #GREEK CAPITAL LETTER TAU
+0x83B2 0x03A5  #GREEK CAPITAL LETTER UPSILON
+0x83B3 0x03A6  #GREEK CAPITAL LETTER PHI
+0x83B4 0x03A7  #GREEK CAPITAL LETTER CHI
+0x83B5 0x03A8  #GREEK CAPITAL LETTER PSI
+0x83B6 0x03A9  #GREEK CAPITAL LETTER OMEGA
+0x83BF 0x03B1  #GREEK SMALL LETTER ALPHA
+0x83C0 0x03B2  #GREEK SMALL LETTER BETA
+0x83C1 0x03B3  #GREEK SMALL LETTER GAMMA
+0x83C2 0x03B4  #GREEK SMALL LETTER DELTA
+0x83C3 0x03B5  #GREEK SMALL LETTER EPSILON
+0x83C4 0x03B6  #GREEK SMALL LETTER ZETA
+0x83C5 0x03B7  #GREEK SMALL LETTER ETA
+0x83C6 0x03B8  #GREEK SMALL LETTER THETA
+0x83C7 0x03B9  #GREEK SMALL LETTER IOTA
+0x83C8 0x03BA  #GREEK SMALL LETTER KAPPA
+0x83C9 0x03BB  #GREEK SMALL LETTER LAMDA
+0x83CA 0x03BC  #GREEK SMALL LETTER MU
+0x83CB 0x03BD  #GREEK SMALL LETTER NU
+0x83CC 0x03BE  #GREEK SMALL LETTER XI
+0x83CD 0x03BF  #GREEK SMALL LETTER OMICRON
+0x83CE 0x03C0  #GREEK SMALL LETTER PI
+0x83CF 0x03C1  #GREEK SMALL LETTER RHO
+0x83D0 0x03C3  #GREEK SMALL LETTER SIGMA
+0x83D1 0x03C4  #GREEK SMALL LETTER TAU
+0x83D2 0x03C5  #GREEK SMALL LETTER UPSILON
+0x83D3 0x03C6  #GREEK SMALL LETTER PHI
+0x83D4 0x03C7  #GREEK SMALL LETTER CHI
+0x83D5 0x03C8  #GREEK SMALL LETTER PSI
+0x83D6 0x03C9  #GREEK SMALL LETTER OMEGA
+0x8440 0x0410  #CYRILLIC CAPITAL LETTER A
+0x8441 0x0411  #CYRILLIC CAPITAL LETTER BE
+0x8442 0x0412  #CYRILLIC CAPITAL LETTER VE
+0x8443 0x0413  #CYRILLIC CAPITAL LETTER GHE
+0x8444 0x0414  #CYRILLIC CAPITAL LETTER DE
+0x8445 0x0415  #CYRILLIC CAPITAL LETTER IE
+0x8446 0x0401  #CYRILLIC CAPITAL LETTER IO
+0x8447 0x0416  #CYRILLIC CAPITAL LETTER ZHE
+0x8448 0x0417  #CYRILLIC CAPITAL LETTER ZE
+0x8449 0x0418  #CYRILLIC CAPITAL LETTER I
+0x844A 0x0419  #CYRILLIC CAPITAL LETTER SHORT I
+0x844B 0x041A  #CYRILLIC CAPITAL LETTER KA
+0x844C 0x041B  #CYRILLIC CAPITAL LETTER EL
+0x844D 0x041C  #CYRILLIC CAPITAL LETTER EM
+0x844E 0x041D  #CYRILLIC CAPITAL LETTER EN
+0x844F 0x041E  #CYRILLIC CAPITAL LETTER O
+0x8450 0x041F  #CYRILLIC CAPITAL LETTER PE
+0x8451 0x0420  #CYRILLIC CAPITAL LETTER ER
+0x8452 0x0421  #CYRILLIC CAPITAL LETTER ES
+0x8453 0x0422  #CYRILLIC CAPITAL LETTER TE
+0x8454 0x0423  #CYRILLIC CAPITAL LETTER U
+0x8455 0x0424  #CYRILLIC CAPITAL LETTER EF
+0x8456 0x0425  #CYRILLIC CAPITAL LETTER HA
+0x8457 0x0426  #CYRILLIC CAPITAL LETTER TSE
+0x8458 0x0427  #CYRILLIC CAPITAL LETTER CHE
+0x8459 0x0428  #CYRILLIC CAPITAL LETTER SHA
+0x845A 0x0429  #CYRILLIC CAPITAL LETTER SHCHA
+0x845B 0x042A  #CYRILLIC CAPITAL LETTER HARD SIGN
+0x845C 0x042B  #CYRILLIC CAPITAL LETTER YERU
+0x845D 0x042C  #CYRILLIC CAPITAL LETTER SOFT SIGN
+0x845E 0x042D  #CYRILLIC CAPITAL LETTER E
+0x845F 0x042E  #CYRILLIC CAPITAL LETTER YU
+0x8460 0x042F  #CYRILLIC CAPITAL LETTER YA
+0x8470 0x0430  #CYRILLIC SMALL LETTER A
+0x8471 0x0431  #CYRILLIC SMALL LETTER BE
+0x8472 0x0432  #CYRILLIC SMALL LETTER VE
+0x8473 0x0433  #CYRILLIC SMALL LETTER GHE
+0x8474 0x0434  #CYRILLIC SMALL LETTER DE
+0x8475 0x0435  #CYRILLIC SMALL LETTER IE
+0x8476 0x0451  #CYRILLIC SMALL LETTER IO
+0x8477 0x0436  #CYRILLIC SMALL LETTER ZHE
+0x8478 0x0437  #CYRILLIC SMALL LETTER ZE
+0x8479 0x0438  #CYRILLIC SMALL LETTER I
+0x847A 0x0439  #CYRILLIC SMALL LETTER SHORT I
+0x847B 0x043A  #CYRILLIC SMALL LETTER KA
+0x847C 0x043B  #CYRILLIC SMALL LETTER EL
+0x847D 0x043C  #CYRILLIC SMALL LETTER EM
+0x847E 0x043D  #CYRILLIC SMALL LETTER EN
+0x8480 0x043E  #CYRILLIC SMALL LETTER O
+0x8481 0x043F  #CYRILLIC SMALL LETTER PE
+0x8482 0x0440  #CYRILLIC SMALL LETTER ER
+0x8483 0x0441  #CYRILLIC SMALL LETTER ES
+0x8484 0x0442  #CYRILLIC SMALL LETTER TE
+0x8485 0x0443  #CYRILLIC SMALL LETTER U
+0x8486 0x0444  #CYRILLIC SMALL LETTER EF
+0x8487 0x0445  #CYRILLIC SMALL LETTER HA
+0x8488 0x0446  #CYRILLIC SMALL LETTER TSE
+0x8489 0x0447  #CYRILLIC SMALL LETTER CHE
+0x848A 0x0448  #CYRILLIC SMALL LETTER SHA
+0x848B 0x0449  #CYRILLIC SMALL LETTER SHCHA
+0x848C 0x044A  #CYRILLIC SMALL LETTER HARD SIGN
+0x848D 0x044B  #CYRILLIC SMALL LETTER YERU
+0x848E 0x044C  #CYRILLIC SMALL LETTER SOFT SIGN
+0x848F 0x044D  #CYRILLIC SMALL LETTER E
+0x8490 0x044E  #CYRILLIC SMALL LETTER YU
+0x8491 0x044F  #CYRILLIC SMALL LETTER YA
+0x849F 0x2500  #BOX DRAWINGS LIGHT HORIZONTAL
+0x84A0 0x2502  #BOX DRAWINGS LIGHT VERTICAL
+0x84A1 0x250C  #BOX DRAWINGS LIGHT DOWN AND RIGHT
+0x84A2 0x2510  #BOX DRAWINGS LIGHT DOWN AND LEFT
+0x84A3 0x2518  #BOX DRAWINGS LIGHT UP AND LEFT
+0x84A4 0x2514  #BOX DRAWINGS LIGHT UP AND RIGHT
+0x84A5 0x251C  #BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+0x84A6 0x252C  #BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+0x84A7 0x2524  #BOX DRAWINGS LIGHT VERTICAL AND LEFT
+0x84A8 0x2534  #BOX DRAWINGS LIGHT UP AND HORIZONTAL
+0x84A9 0x253C  #BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+0x84AA 0x2501  #BOX DRAWINGS HEAVY HORIZONTAL
+0x84AB 0x2503  #BOX DRAWINGS HEAVY VERTICAL
+0x84AC 0x250F  #BOX DRAWINGS HEAVY DOWN AND RIGHT
+0x84AD 0x2513  #BOX DRAWINGS HEAVY DOWN AND LEFT
+0x84AE 0x251B  #BOX DRAWINGS HEAVY UP AND LEFT
+0x84AF 0x2517  #BOX DRAWINGS HEAVY UP AND RIGHT
+0x84B0 0x2523  #BOX DRAWINGS HEAVY VERTICAL AND RIGHT
+0x84B1 0x2533  #BOX DRAWINGS HEAVY DOWN AND HORIZONTAL
+0x84B2 0x252B  #BOX DRAWINGS HEAVY VERTICAL AND LEFT
+0x84B3 0x253B  #BOX DRAWINGS HEAVY UP AND HORIZONTAL
+0x84B4 0x254B  #BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL
+0x84B5 0x2520  #BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT
+0x84B6 0x252F  #BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY
+0x84B7 0x2528  #BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT
+0x84B8 0x2537  #BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY
+0x84B9 0x253F  #BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY
+0x84BA 0x251D  #BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY
+0x84BB 0x2530  #BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT
+0x84BC 0x2525  #BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY
+0x84BD 0x2538  #BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT
+0x84BE 0x2542  #BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT
+0x8740 0x2460  #CIRCLED DIGIT ONE
+0x8741 0x2461  #CIRCLED DIGIT TWO
+0x8742 0x2462  #CIRCLED DIGIT THREE
+0x8743 0x2463  #CIRCLED DIGIT FOUR
+0x8744 0x2464  #CIRCLED DIGIT FIVE
+0x8745 0x2465  #CIRCLED DIGIT SIX
+0x8746 0x2466  #CIRCLED DIGIT SEVEN
+0x8747 0x2467  #CIRCLED DIGIT EIGHT
+0x8748 0x2468  #CIRCLED DIGIT NINE
+0x8749 0x2469  #CIRCLED NUMBER TEN
+0x874A 0x246A  #CIRCLED NUMBER ELEVEN
+0x874B 0x246B  #CIRCLED NUMBER TWELVE
+0x874C 0x246C  #CIRCLED NUMBER THIRTEEN
+0x874D 0x246D  #CIRCLED NUMBER FOURTEEN
+0x874E 0x246E  #CIRCLED NUMBER FIFTEEN
+0x874F 0x246F  #CIRCLED NUMBER SIXTEEN
+0x8750 0x2470  #CIRCLED NUMBER SEVENTEEN
+0x8751 0x2471  #CIRCLED NUMBER EIGHTEEN
+0x8752 0x2472  #CIRCLED NUMBER NINETEEN
+0x8753 0x2473  #CIRCLED NUMBER TWENTY
+0x8754 0x2160  #ROMAN NUMERAL ONE
+0x8755 0x2161  #ROMAN NUMERAL TWO
+0x8756 0x2162  #ROMAN NUMERAL THREE
+0x8757 0x2163  #ROMAN NUMERAL FOUR
+0x8758 0x2164  #ROMAN NUMERAL FIVE
+0x8759 0x2165  #ROMAN NUMERAL SIX
+0x875A 0x2166  #ROMAN NUMERAL SEVEN
+0x875B 0x2167  #ROMAN NUMERAL EIGHT
+0x875C 0x2168  #ROMAN NUMERAL NINE
+0x875D 0x2169  #ROMAN NUMERAL TEN
+0x875F 0x3349  #SQUARE MIRI
+0x8760 0x3314  #SQUARE KIRO
+0x8761 0x3322  #SQUARE SENTI
+0x8762 0x334D  #SQUARE MEETORU
+0x8763 0x3318  #SQUARE GURAMU
+0x8764 0x3327  #SQUARE TON
+0x8765 0x3303  #SQUARE AARU
+0x8766 0x3336  #SQUARE HEKUTAARU
+0x8767 0x3351  #SQUARE RITTORU
+0x8768 0x3357  #SQUARE WATTO
+0x8769 0x330D  #SQUARE KARORII
+0x876A 0x3326  #SQUARE DORU
+0x876B 0x3323  #SQUARE SENTO
+0x876C 0x332B  #SQUARE PAASENTO
+0x876D 0x334A  #SQUARE MIRIBAARU
+0x876E 0x333B  #SQUARE PEEZI
+0x876F 0x339C  #SQUARE MM
+0x8770 0x339D  #SQUARE CM
+0x8771 0x339E  #SQUARE KM
+0x8772 0x338E  #SQUARE MG
+0x8773 0x338F  #SQUARE KG
+0x8774 0x33C4  #SQUARE CC
+0x8775 0x33A1  #SQUARE M SQUARED
+0x877E 0x337B  #SQUARE ERA NAME HEISEI
+0x8780 0x301D  #REVERSED DOUBLE PRIME QUOTATION MARK
+0x8781 0x301F  #LOW DOUBLE PRIME QUOTATION MARK
+0x8782 0x2116  #NUMERO SIGN
+0x8783 0x33CD  #SQUARE KK
+0x8784 0x2121  #TELEPHONE SIGN
+0x8785 0x32A4  #CIRCLED IDEOGRAPH HIGH
+0x8786 0x32A5  #CIRCLED IDEOGRAPH CENTRE
+0x8787 0x32A6  #CIRCLED IDEOGRAPH LOW
+0x8788 0x32A7  #CIRCLED IDEOGRAPH LEFT
+0x8789 0x32A8  #CIRCLED IDEOGRAPH RIGHT
+0x878A 0x3231  #PARENTHESIZED IDEOGRAPH STOCK
+0x878B 0x3232  #PARENTHESIZED IDEOGRAPH HAVE
+0x878C 0x3239  #PARENTHESIZED IDEOGRAPH REPRESENT
+0x878D 0x337E  #SQUARE ERA NAME MEIZI
+0x878E 0x337D  #SQUARE ERA NAME TAISYOU
+0x878F 0x337C  #SQUARE ERA NAME SYOUWA
+0x8790 0x2252  #APPROXIMATELY EQUAL TO OR THE IMAGE OF
+0x8791 0x2261  #IDENTICAL TO
+0x8792 0x222B  #INTEGRAL
+0x8793 0x222E  #CONTOUR INTEGRAL
+0x8794 0x2211  #N-ARY SUMMATION
+0x8795 0x221A  #SQUARE ROOT
+0x8796 0x22A5  #UP TACK
+0x8797 0x2220  #ANGLE
+0x8798 0x221F  #RIGHT ANGLE
+0x8799 0x22BF  #RIGHT TRIANGLE
+0x879A 0x2235  #BECAUSE
+0x879B 0x2229  #INTERSECTION
+0x879C 0x222A  #UNION
+0x889F 0x4E9C  #CJK UNIFIED IDEOGRAPH
+0x88A0 0x5516  #CJK UNIFIED IDEOGRAPH
+0x88A1 0x5A03  #CJK UNIFIED IDEOGRAPH
+0x88A2 0x963F  #CJK UNIFIED IDEOGRAPH
+0x88A3 0x54C0  #CJK UNIFIED IDEOGRAPH
+0x88A4 0x611B  #CJK UNIFIED IDEOGRAPH
+0x88A5 0x6328  #CJK UNIFIED IDEOGRAPH
+0x88A6 0x59F6  #CJK UNIFIED IDEOGRAPH
+0x88A7 0x9022  #CJK UNIFIED IDEOGRAPH
+0x88A8 0x8475  #CJK UNIFIED IDEOGRAPH
+0x88A9 0x831C  #CJK UNIFIED IDEOGRAPH
+0x88AA 0x7A50  #CJK UNIFIED IDEOGRAPH
+0x88AB 0x60AA  #CJK UNIFIED IDEOGRAPH
+0x88AC 0x63E1  #CJK UNIFIED IDEOGRAPH
+0x88AD 0x6E25  #CJK UNIFIED IDEOGRAPH
+0x88AE 0x65ED  #CJK UNIFIED IDEOGRAPH
+0x88AF 0x8466  #CJK UNIFIED IDEOGRAPH
+0x88B0 0x82A6  #CJK UNIFIED IDEOGRAPH
+0x88B1 0x9BF5  #CJK UNIFIED IDEOGRAPH
+0x88B2 0x6893  #CJK UNIFIED IDEOGRAPH
+0x88B3 0x5727  #CJK UNIFIED IDEOGRAPH
+0x88B4 0x65A1  #CJK UNIFIED IDEOGRAPH
+0x88B5 0x6271  #CJK UNIFIED IDEOGRAPH
+0x88B6 0x5B9B  #CJK UNIFIED IDEOGRAPH
+0x88B7 0x59D0  #CJK UNIFIED IDEOGRAPH
+0x88B8 0x867B  #CJK UNIFIED IDEOGRAPH
+0x88B9 0x98F4  #CJK UNIFIED IDEOGRAPH
+0x88BA 0x7D62  #CJK UNIFIED IDEOGRAPH
+0x88BB 0x7DBE  #CJK UNIFIED IDEOGRAPH
+0x88BC 0x9B8E  #CJK UNIFIED IDEOGRAPH
+0x88BD 0x6216  #CJK UNIFIED IDEOGRAPH
+0x88BE 0x7C9F  #CJK UNIFIED IDEOGRAPH
+0x88BF 0x88B7  #CJK UNIFIED IDEOGRAPH
+0x88C0 0x5B89  #CJK UNIFIED IDEOGRAPH
+0x88C1 0x5EB5  #CJK UNIFIED IDEOGRAPH
+0x88C2 0x6309  #CJK UNIFIED IDEOGRAPH
+0x88C3 0x6697  #CJK UNIFIED IDEOGRAPH
+0x88C4 0x6848  #CJK UNIFIED IDEOGRAPH
+0x88C5 0x95C7  #CJK UNIFIED IDEOGRAPH
+0x88C6 0x978D  #CJK UNIFIED IDEOGRAPH
+0x88C7 0x674F  #CJK UNIFIED IDEOGRAPH
+0x88C8 0x4EE5  #CJK UNIFIED IDEOGRAPH
+0x88C9 0x4F0A  #CJK UNIFIED IDEOGRAPH
+0x88CA 0x4F4D  #CJK UNIFIED IDEOGRAPH
+0x88CB 0x4F9D  #CJK UNIFIED IDEOGRAPH
+0x88CC 0x5049  #CJK UNIFIED IDEOGRAPH
+0x88CD 0x56F2  #CJK UNIFIED IDEOGRAPH
+0x88CE 0x5937  #CJK UNIFIED IDEOGRAPH
+0x88CF 0x59D4  #CJK UNIFIED IDEOGRAPH
+0x88D0 0x5A01  #CJK UNIFIED IDEOGRAPH
+0x88D1 0x5C09  #CJK UNIFIED IDEOGRAPH
+0x88D2 0x60DF  #CJK UNIFIED IDEOGRAPH
+0x88D3 0x610F  #CJK UNIFIED IDEOGRAPH
+0x88D4 0x6170  #CJK UNIFIED IDEOGRAPH
+0x88D5 0x6613  #CJK UNIFIED IDEOGRAPH
+0x88D6 0x6905  #CJK UNIFIED IDEOGRAPH
+0x88D7 0x70BA  #CJK UNIFIED IDEOGRAPH
+0x88D8 0x754F  #CJK UNIFIED IDEOGRAPH
+0x88D9 0x7570  #CJK UNIFIED IDEOGRAPH
+0x88DA 0x79FB  #CJK UNIFIED IDEOGRAPH
+0x88DB 0x7DAD  #CJK UNIFIED IDEOGRAPH
+0x88DC 0x7DEF  #CJK UNIFIED IDEOGRAPH
+0x88DD 0x80C3  #CJK UNIFIED IDEOGRAPH
+0x88DE 0x840E  #CJK UNIFIED IDEOGRAPH
+0x88DF 0x8863  #CJK UNIFIED IDEOGRAPH
+0x88E0 0x8B02  #CJK UNIFIED IDEOGRAPH
+0x88E1 0x9055  #CJK UNIFIED IDEOGRAPH
+0x88E2 0x907A  #CJK UNIFIED IDEOGRAPH
+0x88E3 0x533B  #CJK UNIFIED IDEOGRAPH
+0x88E4 0x4E95  #CJK UNIFIED IDEOGRAPH
+0x88E5 0x4EA5  #CJK UNIFIED IDEOGRAPH
+0x88E6 0x57DF  #CJK UNIFIED IDEOGRAPH
+0x88E7 0x80B2  #CJK UNIFIED IDEOGRAPH
+0x88E8 0x90C1  #CJK UNIFIED IDEOGRAPH
+0x88E9 0x78EF  #CJK UNIFIED IDEOGRAPH
+0x88EA 0x4E00  #CJK UNIFIED IDEOGRAPH
+0x88EB 0x58F1  #CJK UNIFIED IDEOGRAPH
+0x88EC 0x6EA2  #CJK UNIFIED IDEOGRAPH
+0x88ED 0x9038  #CJK UNIFIED IDEOGRAPH
+0x88EE 0x7A32  #CJK UNIFIED IDEOGRAPH
+0x88EF 0x8328  #CJK UNIFIED IDEOGRAPH
+0x88F0 0x828B  #CJK UNIFIED IDEOGRAPH
+0x88F1 0x9C2F  #CJK UNIFIED IDEOGRAPH
+0x88F2 0x5141  #CJK UNIFIED IDEOGRAPH
+0x88F3 0x5370  #CJK UNIFIED IDEOGRAPH
+0x88F4 0x54BD  #CJK UNIFIED IDEOGRAPH
+0x88F5 0x54E1  #CJK UNIFIED IDEOGRAPH
+0x88F6 0x56E0  #CJK UNIFIED IDEOGRAPH
+0x88F7 0x59FB  #CJK UNIFIED IDEOGRAPH
+0x88F8 0x5F15  #CJK UNIFIED IDEOGRAPH
+0x88F9 0x98F2  #CJK UNIFIED IDEOGRAPH
+0x88FA 0x6DEB  #CJK UNIFIED IDEOGRAPH
+0x88FB 0x80E4  #CJK UNIFIED IDEOGRAPH
+0x88FC 0x852D  #CJK UNIFIED IDEOGRAPH
+0x8940 0x9662  #CJK UNIFIED IDEOGRAPH
+0x8941 0x9670  #CJK UNIFIED IDEOGRAPH
+0x8942 0x96A0  #CJK UNIFIED IDEOGRAPH
+0x8943 0x97FB  #CJK UNIFIED IDEOGRAPH
+0x8944 0x540B  #CJK UNIFIED IDEOGRAPH
+0x8945 0x53F3  #CJK UNIFIED IDEOGRAPH
+0x8946 0x5B87  #CJK UNIFIED IDEOGRAPH
+0x8947 0x70CF  #CJK UNIFIED IDEOGRAPH
+0x8948 0x7FBD  #CJK UNIFIED IDEOGRAPH
+0x8949 0x8FC2  #CJK UNIFIED IDEOGRAPH
+0x894A 0x96E8  #CJK UNIFIED IDEOGRAPH
+0x894B 0x536F  #CJK UNIFIED IDEOGRAPH
+0x894C 0x9D5C  #CJK UNIFIED IDEOGRAPH
+0x894D 0x7ABA  #CJK UNIFIED IDEOGRAPH
+0x894E 0x4E11  #CJK UNIFIED IDEOGRAPH
+0x894F 0x7893  #CJK UNIFIED IDEOGRAPH
+0x8950 0x81FC  #CJK UNIFIED IDEOGRAPH
+0x8951 0x6E26  #CJK UNIFIED IDEOGRAPH
+0x8952 0x5618  #CJK UNIFIED IDEOGRAPH
+0x8953 0x5504  #CJK UNIFIED IDEOGRAPH
+0x8954 0x6B1D  #CJK UNIFIED IDEOGRAPH
+0x8955 0x851A  #CJK UNIFIED IDEOGRAPH
+0x8956 0x9C3B  #CJK UNIFIED IDEOGRAPH
+0x8957 0x59E5  #CJK UNIFIED IDEOGRAPH
+0x8958 0x53A9  #CJK UNIFIED IDEOGRAPH
+0x8959 0x6D66  #CJK UNIFIED IDEOGRAPH
+0x895A 0x74DC  #CJK UNIFIED IDEOGRAPH
+0x895B 0x958F  #CJK UNIFIED IDEOGRAPH
+0x895C 0x5642  #CJK UNIFIED IDEOGRAPH
+0x895D 0x4E91  #CJK UNIFIED IDEOGRAPH
+0x895E 0x904B  #CJK UNIFIED IDEOGRAPH
+0x895F 0x96F2  #CJK UNIFIED IDEOGRAPH
+0x8960 0x834F  #CJK UNIFIED IDEOGRAPH
+0x8961 0x990C  #CJK UNIFIED IDEOGRAPH
+0x8962 0x53E1  #CJK UNIFIED IDEOGRAPH
+0x8963 0x55B6  #CJK UNIFIED IDEOGRAPH
+0x8964 0x5B30  #CJK UNIFIED IDEOGRAPH
+0x8965 0x5F71  #CJK UNIFIED IDEOGRAPH
+0x8966 0x6620  #CJK UNIFIED IDEOGRAPH
+0x8967 0x66F3  #CJK UNIFIED IDEOGRAPH
+0x8968 0x6804  #CJK UNIFIED IDEOGRAPH
+0x8969 0x6C38  #CJK UNIFIED IDEOGRAPH
+0x896A 0x6CF3  #CJK UNIFIED IDEOGRAPH
+0x896B 0x6D29  #CJK UNIFIED IDEOGRAPH
+0x896C 0x745B  #CJK UNIFIED IDEOGRAPH
+0x896D 0x76C8  #CJK UNIFIED IDEOGRAPH
+0x896E 0x7A4E  #CJK UNIFIED IDEOGRAPH
+0x896F 0x9834  #CJK UNIFIED IDEOGRAPH
+0x8970 0x82F1  #CJK UNIFIED IDEOGRAPH
+0x8971 0x885B  #CJK UNIFIED IDEOGRAPH
+0x8972 0x8A60  #CJK UNIFIED IDEOGRAPH
+0x8973 0x92ED  #CJK UNIFIED IDEOGRAPH
+0x8974 0x6DB2  #CJK UNIFIED IDEOGRAPH
+0x8975 0x75AB  #CJK UNIFIED IDEOGRAPH
+0x8976 0x76CA  #CJK UNIFIED IDEOGRAPH
+0x8977 0x99C5  #CJK UNIFIED IDEOGRAPH
+0x8978 0x60A6  #CJK UNIFIED IDEOGRAPH
+0x8979 0x8B01  #CJK UNIFIED IDEOGRAPH
+0x897A 0x8D8A  #CJK UNIFIED IDEOGRAPH
+0x897B 0x95B2  #CJK UNIFIED IDEOGRAPH
+0x897C 0x698E  #CJK UNIFIED IDEOGRAPH
+0x897D 0x53AD  #CJK UNIFIED IDEOGRAPH
+0x897E 0x5186  #CJK UNIFIED IDEOGRAPH
+0x8980 0x5712  #CJK UNIFIED IDEOGRAPH
+0x8981 0x5830  #CJK UNIFIED IDEOGRAPH
+0x8982 0x5944  #CJK UNIFIED IDEOGRAPH
+0x8983 0x5BB4  #CJK UNIFIED IDEOGRAPH
+0x8984 0x5EF6  #CJK UNIFIED IDEOGRAPH
+0x8985 0x6028  #CJK UNIFIED IDEOGRAPH
+0x8986 0x63A9  #CJK UNIFIED IDEOGRAPH
+0x8987 0x63F4  #CJK UNIFIED IDEOGRAPH
+0x8988 0x6CBF  #CJK UNIFIED IDEOGRAPH
+0x8989 0x6F14  #CJK UNIFIED IDEOGRAPH
+0x898A 0x708E  #CJK UNIFIED IDEOGRAPH
+0x898B 0x7114  #CJK UNIFIED IDEOGRAPH
+0x898C 0x7159  #CJK UNIFIED IDEOGRAPH
+0x898D 0x71D5  #CJK UNIFIED IDEOGRAPH
+0x898E 0x733F  #CJK UNIFIED IDEOGRAPH
+0x898F 0x7E01  #CJK UNIFIED IDEOGRAPH
+0x8990 0x8276  #CJK UNIFIED IDEOGRAPH
+0x8991 0x82D1  #CJK UNIFIED IDEOGRAPH
+0x8992 0x8597  #CJK UNIFIED IDEOGRAPH
+0x8993 0x9060  #CJK UNIFIED IDEOGRAPH
+0x8994 0x925B  #CJK UNIFIED IDEOGRAPH
+0x8995 0x9D1B  #CJK UNIFIED IDEOGRAPH
+0x8996 0x5869  #CJK UNIFIED IDEOGRAPH
+0x8997 0x65BC  #CJK UNIFIED IDEOGRAPH
+0x8998 0x6C5A  #CJK UNIFIED IDEOGRAPH
+0x8999 0x7525  #CJK UNIFIED IDEOGRAPH
+0x899A 0x51F9  #CJK UNIFIED IDEOGRAPH
+0x899B 0x592E  #CJK UNIFIED IDEOGRAPH
+0x899C 0x5965  #CJK UNIFIED IDEOGRAPH
+0x899D 0x5F80  #CJK UNIFIED IDEOGRAPH
+0x899E 0x5FDC  #CJK UNIFIED IDEOGRAPH
+0x899F 0x62BC  #CJK UNIFIED IDEOGRAPH
+0x89A0 0x65FA  #CJK UNIFIED IDEOGRAPH
+0x89A1 0x6A2A  #CJK UNIFIED IDEOGRAPH
+0x89A2 0x6B27  #CJK UNIFIED IDEOGRAPH
+0x89A3 0x6BB4  #CJK UNIFIED IDEOGRAPH
+0x89A4 0x738B  #CJK UNIFIED IDEOGRAPH
+0x89A5 0x7FC1  #CJK UNIFIED IDEOGRAPH
+0x89A6 0x8956  #CJK UNIFIED IDEOGRAPH
+0x89A7 0x9D2C  #CJK UNIFIED IDEOGRAPH
+0x89A8 0x9D0E  #CJK UNIFIED IDEOGRAPH
+0x89A9 0x9EC4  #CJK UNIFIED IDEOGRAPH
+0x89AA 0x5CA1  #CJK UNIFIED IDEOGRAPH
+0x89AB 0x6C96  #CJK UNIFIED IDEOGRAPH
+0x89AC 0x837B  #CJK UNIFIED IDEOGRAPH
+0x89AD 0x5104  #CJK UNIFIED IDEOGRAPH
+0x89AE 0x5C4B  #CJK UNIFIED IDEOGRAPH
+0x89AF 0x61B6  #CJK UNIFIED IDEOGRAPH
+0x89B0 0x81C6  #CJK UNIFIED IDEOGRAPH
+0x89B1 0x6876  #CJK UNIFIED IDEOGRAPH
+0x89B2 0x7261  #CJK UNIFIED IDEOGRAPH
+0x89B3 0x4E59  #CJK UNIFIED IDEOGRAPH
+0x89B4 0x4FFA  #CJK UNIFIED IDEOGRAPH
+0x89B5 0x5378  #CJK UNIFIED IDEOGRAPH
+0x89B6 0x6069  #CJK UNIFIED IDEOGRAPH
+0x89B7 0x6E29  #CJK UNIFIED IDEOGRAPH
+0x89B8 0x7A4F  #CJK UNIFIED IDEOGRAPH
+0x89B9 0x97F3  #CJK UNIFIED IDEOGRAPH
+0x89BA 0x4E0B  #CJK UNIFIED IDEOGRAPH
+0x89BB 0x5316  #CJK UNIFIED IDEOGRAPH
+0x89BC 0x4EEE  #CJK UNIFIED IDEOGRAPH
+0x89BD 0x4F55  #CJK UNIFIED IDEOGRAPH
+0x89BE 0x4F3D  #CJK UNIFIED IDEOGRAPH
+0x89BF 0x4FA1  #CJK UNIFIED IDEOGRAPH
+0x89C0 0x4F73  #CJK UNIFIED IDEOGRAPH
+0x89C1 0x52A0  #CJK UNIFIED IDEOGRAPH
+0x89C2 0x53EF  #CJK UNIFIED IDEOGRAPH
+0x89C3 0x5609  #CJK UNIFIED IDEOGRAPH
+0x89C4 0x590F  #CJK UNIFIED IDEOGRAPH
+0x89C5 0x5AC1  #CJK UNIFIED IDEOGRAPH
+0x89C6 0x5BB6  #CJK UNIFIED IDEOGRAPH
+0x89C7 0x5BE1  #CJK UNIFIED IDEOGRAPH
+0x89C8 0x79D1  #CJK UNIFIED IDEOGRAPH
+0x89C9 0x6687  #CJK UNIFIED IDEOGRAPH
+0x89CA 0x679C  #CJK UNIFIED IDEOGRAPH
+0x89CB 0x67B6  #CJK UNIFIED IDEOGRAPH
+0x89CC 0x6B4C  #CJK UNIFIED IDEOGRAPH
+0x89CD 0x6CB3  #CJK UNIFIED IDEOGRAPH
+0x89CE 0x706B  #CJK UNIFIED IDEOGRAPH
+0x89CF 0x73C2  #CJK UNIFIED IDEOGRAPH
+0x89D0 0x798D  #CJK UNIFIED IDEOGRAPH
+0x89D1 0x79BE  #CJK UNIFIED IDEOGRAPH
+0x89D2 0x7A3C  #CJK UNIFIED IDEOGRAPH
+0x89D3 0x7B87  #CJK UNIFIED IDEOGRAPH
+0x89D4 0x82B1  #CJK UNIFIED IDEOGRAPH
+0x89D5 0x82DB  #CJK UNIFIED IDEOGRAPH
+0x89D6 0x8304  #CJK UNIFIED IDEOGRAPH
+0x89D7 0x8377  #CJK UNIFIED IDEOGRAPH
+0x89D8 0x83EF  #CJK UNIFIED IDEOGRAPH
+0x89D9 0x83D3  #CJK UNIFIED IDEOGRAPH
+0x89DA 0x8766  #CJK UNIFIED IDEOGRAPH
+0x89DB 0x8AB2  #CJK UNIFIED IDEOGRAPH
+0x89DC 0x5629  #CJK UNIFIED IDEOGRAPH
+0x89DD 0x8CA8  #CJK UNIFIED IDEOGRAPH
+0x89DE 0x8FE6  #CJK UNIFIED IDEOGRAPH
+0x89DF 0x904E  #CJK UNIFIED IDEOGRAPH
+0x89E0 0x971E  #CJK UNIFIED IDEOGRAPH
+0x89E1 0x868A  #CJK UNIFIED IDEOGRAPH
+0x89E2 0x4FC4  #CJK UNIFIED IDEOGRAPH
+0x89E3 0x5CE8  #CJK UNIFIED IDEOGRAPH
+0x89E4 0x6211  #CJK UNIFIED IDEOGRAPH
+0x89E5 0x7259  #CJK UNIFIED IDEOGRAPH
+0x89E6 0x753B  #CJK UNIFIED IDEOGRAPH
+0x89E7 0x81E5  #CJK UNIFIED IDEOGRAPH
+0x89E8 0x82BD  #CJK UNIFIED IDEOGRAPH
+0x89E9 0x86FE  #CJK UNIFIED IDEOGRAPH
+0x89EA 0x8CC0  #CJK UNIFIED IDEOGRAPH
+0x89EB 0x96C5  #CJK UNIFIED IDEOGRAPH
+0x89EC 0x9913  #CJK UNIFIED IDEOGRAPH
+0x89ED 0x99D5  #CJK UNIFIED IDEOGRAPH
+0x89EE 0x4ECB  #CJK UNIFIED IDEOGRAPH
+0x89EF 0x4F1A  #CJK UNIFIED IDEOGRAPH
+0x89F0 0x89E3  #CJK UNIFIED IDEOGRAPH
+0x89F1 0x56DE  #CJK UNIFIED IDEOGRAPH
+0x89F2 0x584A  #CJK UNIFIED IDEOGRAPH
+0x89F3 0x58CA  #CJK UNIFIED IDEOGRAPH
+0x89F4 0x5EFB  #CJK UNIFIED IDEOGRAPH
+0x89F5 0x5FEB  #CJK UNIFIED IDEOGRAPH
+0x89F6 0x602A  #CJK UNIFIED IDEOGRAPH
+0x89F7 0x6094  #CJK UNIFIED IDEOGRAPH
+0x89F8 0x6062  #CJK UNIFIED IDEOGRAPH
+0x89F9 0x61D0  #CJK UNIFIED IDEOGRAPH
+0x89FA 0x6212  #CJK UNIFIED IDEOGRAPH
+0x89FB 0x62D0  #CJK UNIFIED IDEOGRAPH
+0x89FC 0x6539  #CJK UNIFIED IDEOGRAPH
+0x8A40 0x9B41  #CJK UNIFIED IDEOGRAPH
+0x8A41 0x6666  #CJK UNIFIED IDEOGRAPH
+0x8A42 0x68B0  #CJK UNIFIED IDEOGRAPH
+0x8A43 0x6D77  #CJK UNIFIED IDEOGRAPH
+0x8A44 0x7070  #CJK UNIFIED IDEOGRAPH
+0x8A45 0x754C  #CJK UNIFIED IDEOGRAPH
+0x8A46 0x7686  #CJK UNIFIED IDEOGRAPH
+0x8A47 0x7D75  #CJK UNIFIED IDEOGRAPH
+0x8A48 0x82A5  #CJK UNIFIED IDEOGRAPH
+0x8A49 0x87F9  #CJK UNIFIED IDEOGRAPH
+0x8A4A 0x958B  #CJK UNIFIED IDEOGRAPH
+0x8A4B 0x968E  #CJK UNIFIED IDEOGRAPH
+0x8A4C 0x8C9D  #CJK UNIFIED IDEOGRAPH
+0x8A4D 0x51F1  #CJK UNIFIED IDEOGRAPH
+0x8A4E 0x52BE  #CJK UNIFIED IDEOGRAPH
+0x8A4F 0x5916  #CJK UNIFIED IDEOGRAPH
+0x8A50 0x54B3  #CJK UNIFIED IDEOGRAPH
+0x8A51 0x5BB3  #CJK UNIFIED IDEOGRAPH
+0x8A52 0x5D16  #CJK UNIFIED IDEOGRAPH
+0x8A53 0x6168  #CJK UNIFIED IDEOGRAPH
+0x8A54 0x6982  #CJK UNIFIED IDEOGRAPH
+0x8A55 0x6DAF  #CJK UNIFIED IDEOGRAPH
+0x8A56 0x788D  #CJK UNIFIED IDEOGRAPH
+0x8A57 0x84CB  #CJK UNIFIED IDEOGRAPH
+0x8A58 0x8857  #CJK UNIFIED IDEOGRAPH
+0x8A59 0x8A72  #CJK UNIFIED IDEOGRAPH
+0x8A5A 0x93A7  #CJK UNIFIED IDEOGRAPH
+0x8A5B 0x9AB8  #CJK UNIFIED IDEOGRAPH
+0x8A5C 0x6D6C  #CJK UNIFIED IDEOGRAPH
+0x8A5D 0x99A8  #CJK UNIFIED IDEOGRAPH
+0x8A5E 0x86D9  #CJK UNIFIED IDEOGRAPH
+0x8A5F 0x57A3  #CJK UNIFIED IDEOGRAPH
+0x8A60 0x67FF  #CJK UNIFIED IDEOGRAPH
+0x8A61 0x86CE  #CJK UNIFIED IDEOGRAPH
+0x8A62 0x920E  #CJK UNIFIED IDEOGRAPH
+0x8A63 0x5283  #CJK UNIFIED IDEOGRAPH
+0x8A64 0x5687  #CJK UNIFIED IDEOGRAPH
+0x8A65 0x5404  #CJK UNIFIED IDEOGRAPH
+0x8A66 0x5ED3  #CJK UNIFIED IDEOGRAPH
+0x8A67 0x62E1  #CJK UNIFIED IDEOGRAPH
+0x8A68 0x64B9  #CJK UNIFIED IDEOGRAPH
+0x8A69 0x683C  #CJK UNIFIED IDEOGRAPH
+0x8A6A 0x6838  #CJK UNIFIED IDEOGRAPH
+0x8A6B 0x6BBB  #CJK UNIFIED IDEOGRAPH
+0x8A6C 0x7372  #CJK UNIFIED IDEOGRAPH
+0x8A6D 0x78BA  #CJK UNIFIED IDEOGRAPH
+0x8A6E 0x7A6B  #CJK UNIFIED IDEOGRAPH
+0x8A6F 0x899A  #CJK UNIFIED IDEOGRAPH
+0x8A70 0x89D2  #CJK UNIFIED IDEOGRAPH
+0x8A71 0x8D6B  #CJK UNIFIED IDEOGRAPH
+0x8A72 0x8F03  #CJK UNIFIED IDEOGRAPH
+0x8A73 0x90ED  #CJK UNIFIED IDEOGRAPH
+0x8A74 0x95A3  #CJK UNIFIED IDEOGRAPH
+0x8A75 0x9694  #CJK UNIFIED IDEOGRAPH
+0x8A76 0x9769  #CJK UNIFIED IDEOGRAPH
+0x8A77 0x5B66  #CJK UNIFIED IDEOGRAPH
+0x8A78 0x5CB3  #CJK UNIFIED IDEOGRAPH
+0x8A79 0x697D  #CJK UNIFIED IDEOGRAPH
+0x8A7A 0x984D  #CJK UNIFIED IDEOGRAPH
+0x8A7B 0x984E  #CJK UNIFIED IDEOGRAPH
+0x8A7C 0x639B  #CJK UNIFIED IDEOGRAPH
+0x8A7D 0x7B20  #CJK UNIFIED IDEOGRAPH
+0x8A7E 0x6A2B  #CJK UNIFIED IDEOGRAPH
+0x8A80 0x6A7F  #CJK UNIFIED IDEOGRAPH
+0x8A81 0x68B6  #CJK UNIFIED IDEOGRAPH
+0x8A82 0x9C0D  #CJK UNIFIED IDEOGRAPH
+0x8A83 0x6F5F  #CJK UNIFIED IDEOGRAPH
+0x8A84 0x5272  #CJK UNIFIED IDEOGRAPH
+0x8A85 0x559D  #CJK UNIFIED IDEOGRAPH
+0x8A86 0x6070  #CJK UNIFIED IDEOGRAPH
+0x8A87 0x62EC  #CJK UNIFIED IDEOGRAPH
+0x8A88 0x6D3B  #CJK UNIFIED IDEOGRAPH
+0x8A89 0x6E07  #CJK UNIFIED IDEOGRAPH
+0x8A8A 0x6ED1  #CJK UNIFIED IDEOGRAPH
+0x8A8B 0x845B  #CJK UNIFIED IDEOGRAPH
+0x8A8C 0x8910  #CJK UNIFIED IDEOGRAPH
+0x8A8D 0x8F44  #CJK UNIFIED IDEOGRAPH
+0x8A8E 0x4E14  #CJK UNIFIED IDEOGRAPH
+0x8A8F 0x9C39  #CJK UNIFIED IDEOGRAPH
+0x8A90 0x53F6  #CJK UNIFIED IDEOGRAPH
+0x8A91 0x691B  #CJK UNIFIED IDEOGRAPH
+0x8A92 0x6A3A  #CJK UNIFIED IDEOGRAPH
+0x8A93 0x9784  #CJK UNIFIED IDEOGRAPH
+0x8A94 0x682A  #CJK UNIFIED IDEOGRAPH
+0x8A95 0x515C  #CJK UNIFIED IDEOGRAPH
+0x8A96 0x7AC3  #CJK UNIFIED IDEOGRAPH
+0x8A97 0x84B2  #CJK UNIFIED IDEOGRAPH
+0x8A98 0x91DC  #CJK UNIFIED IDEOGRAPH
+0x8A99 0x938C  #CJK UNIFIED IDEOGRAPH
+0x8A9A 0x565B  #CJK UNIFIED IDEOGRAPH
+0x8A9B 0x9D28  #CJK UNIFIED IDEOGRAPH
+0x8A9C 0x6822  #CJK UNIFIED IDEOGRAPH
+0x8A9D 0x8305  #CJK UNIFIED IDEOGRAPH
+0x8A9E 0x8431  #CJK UNIFIED IDEOGRAPH
+0x8A9F 0x7CA5  #CJK UNIFIED IDEOGRAPH
+0x8AA0 0x5208  #CJK UNIFIED IDEOGRAPH
+0x8AA1 0x82C5  #CJK UNIFIED IDEOGRAPH
+0x8AA2 0x74E6  #CJK UNIFIED IDEOGRAPH
+0x8AA3 0x4E7E  #CJK UNIFIED IDEOGRAPH
+0x8AA4 0x4F83  #CJK UNIFIED IDEOGRAPH
+0x8AA5 0x51A0  #CJK UNIFIED IDEOGRAPH
+0x8AA6 0x5BD2  #CJK UNIFIED IDEOGRAPH
+0x8AA7 0x520A  #CJK UNIFIED IDEOGRAPH
+0x8AA8 0x52D8  #CJK UNIFIED IDEOGRAPH
+0x8AA9 0x52E7  #CJK UNIFIED IDEOGRAPH
+0x8AAA 0x5DFB  #CJK UNIFIED IDEOGRAPH
+0x8AAB 0x559A  #CJK UNIFIED IDEOGRAPH
+0x8AAC 0x582A  #CJK UNIFIED IDEOGRAPH
+0x8AAD 0x59E6  #CJK UNIFIED IDEOGRAPH
+0x8AAE 0x5B8C  #CJK UNIFIED IDEOGRAPH
+0x8AAF 0x5B98  #CJK UNIFIED IDEOGRAPH
+0x8AB0 0x5BDB  #CJK UNIFIED IDEOGRAPH
+0x8AB1 0x5E72  #CJK UNIFIED IDEOGRAPH
+0x8AB2 0x5E79  #CJK UNIFIED IDEOGRAPH
+0x8AB3 0x60A3  #CJK UNIFIED IDEOGRAPH
+0x8AB4 0x611F  #CJK UNIFIED IDEOGRAPH
+0x8AB5 0x6163  #CJK UNIFIED IDEOGRAPH
+0x8AB6 0x61BE  #CJK UNIFIED IDEOGRAPH
+0x8AB7 0x63DB  #CJK UNIFIED IDEOGRAPH
+0x8AB8 0x6562  #CJK UNIFIED IDEOGRAPH
+0x8AB9 0x67D1  #CJK UNIFIED IDEOGRAPH
+0x8ABA 0x6853  #CJK UNIFIED IDEOGRAPH
+0x8ABB 0x68FA  #CJK UNIFIED IDEOGRAPH
+0x8ABC 0x6B3E  #CJK UNIFIED IDEOGRAPH
+0x8ABD 0x6B53  #CJK UNIFIED IDEOGRAPH
+0x8ABE 0x6C57  #CJK UNIFIED IDEOGRAPH
+0x8ABF 0x6F22  #CJK UNIFIED IDEOGRAPH
+0x8AC0 0x6F97  #CJK UNIFIED IDEOGRAPH
+0x8AC1 0x6F45  #CJK UNIFIED IDEOGRAPH
+0x8AC2 0x74B0  #CJK UNIFIED IDEOGRAPH
+0x8AC3 0x7518  #CJK UNIFIED IDEOGRAPH
+0x8AC4 0x76E3  #CJK UNIFIED IDEOGRAPH
+0x8AC5 0x770B  #CJK UNIFIED IDEOGRAPH
+0x8AC6 0x7AFF  #CJK UNIFIED IDEOGRAPH
+0x8AC7 0x7BA1  #CJK UNIFIED IDEOGRAPH
+0x8AC8 0x7C21  #CJK UNIFIED IDEOGRAPH
+0x8AC9 0x7DE9  #CJK UNIFIED IDEOGRAPH
+0x8ACA 0x7F36  #CJK UNIFIED IDEOGRAPH
+0x8ACB 0x7FF0  #CJK UNIFIED IDEOGRAPH
+0x8ACC 0x809D  #CJK UNIFIED IDEOGRAPH
+0x8ACD 0x8266  #CJK UNIFIED IDEOGRAPH
+0x8ACE 0x839E  #CJK UNIFIED IDEOGRAPH
+0x8ACF 0x89B3  #CJK UNIFIED IDEOGRAPH
+0x8AD0 0x8ACC  #CJK UNIFIED IDEOGRAPH
+0x8AD1 0x8CAB  #CJK UNIFIED IDEOGRAPH
+0x8AD2 0x9084  #CJK UNIFIED IDEOGRAPH
+0x8AD3 0x9451  #CJK UNIFIED IDEOGRAPH
+0x8AD4 0x9593  #CJK UNIFIED IDEOGRAPH
+0x8AD5 0x9591  #CJK UNIFIED IDEOGRAPH
+0x8AD6 0x95A2  #CJK UNIFIED IDEOGRAPH
+0x8AD7 0x9665  #CJK UNIFIED IDEOGRAPH
+0x8AD8 0x97D3  #CJK UNIFIED IDEOGRAPH
+0x8AD9 0x9928  #CJK UNIFIED IDEOGRAPH
+0x8ADA 0x8218  #CJK UNIFIED IDEOGRAPH
+0x8ADB 0x4E38  #CJK UNIFIED IDEOGRAPH
+0x8ADC 0x542B  #CJK UNIFIED IDEOGRAPH
+0x8ADD 0x5CB8  #CJK UNIFIED IDEOGRAPH
+0x8ADE 0x5DCC  #CJK UNIFIED IDEOGRAPH
+0x8ADF 0x73A9  #CJK UNIFIED IDEOGRAPH
+0x8AE0 0x764C  #CJK UNIFIED IDEOGRAPH
+0x8AE1 0x773C  #CJK UNIFIED IDEOGRAPH
+0x8AE2 0x5CA9  #CJK UNIFIED IDEOGRAPH
+0x8AE3 0x7FEB  #CJK UNIFIED IDEOGRAPH
+0x8AE4 0x8D0B  #CJK UNIFIED IDEOGRAPH
+0x8AE5 0x96C1  #CJK UNIFIED IDEOGRAPH
+0x8AE6 0x9811  #CJK UNIFIED IDEOGRAPH
+0x8AE7 0x9854  #CJK UNIFIED IDEOGRAPH
+0x8AE8 0x9858  #CJK UNIFIED IDEOGRAPH
+0x8AE9 0x4F01  #CJK UNIFIED IDEOGRAPH
+0x8AEA 0x4F0E  #CJK UNIFIED IDEOGRAPH
+0x8AEB 0x5371  #CJK UNIFIED IDEOGRAPH
+0x8AEC 0x559C  #CJK UNIFIED IDEOGRAPH
+0x8AED 0x5668  #CJK UNIFIED IDEOGRAPH
+0x8AEE 0x57FA  #CJK UNIFIED IDEOGRAPH
+0x8AEF 0x5947  #CJK UNIFIED IDEOGRAPH
+0x8AF0 0x5B09  #CJK UNIFIED IDEOGRAPH
+0x8AF1 0x5BC4  #CJK UNIFIED IDEOGRAPH
+0x8AF2 0x5C90  #CJK UNIFIED IDEOGRAPH
+0x8AF3 0x5E0C  #CJK UNIFIED IDEOGRAPH
+0x8AF4 0x5E7E  #CJK UNIFIED IDEOGRAPH
+0x8AF5 0x5FCC  #CJK UNIFIED IDEOGRAPH
+0x8AF6 0x63EE  #CJK UNIFIED IDEOGRAPH
+0x8AF7 0x673A  #CJK UNIFIED IDEOGRAPH
+0x8AF8 0x65D7  #CJK UNIFIED IDEOGRAPH
+0x8AF9 0x65E2  #CJK UNIFIED IDEOGRAPH
+0x8AFA 0x671F  #CJK UNIFIED IDEOGRAPH
+0x8AFB 0x68CB  #CJK UNIFIED IDEOGRAPH
+0x8AFC 0x68C4  #CJK UNIFIED IDEOGRAPH
+0x8B40 0x6A5F  #CJK UNIFIED IDEOGRAPH
+0x8B41 0x5E30  #CJK UNIFIED IDEOGRAPH
+0x8B42 0x6BC5  #CJK UNIFIED IDEOGRAPH
+0x8B43 0x6C17  #CJK UNIFIED IDEOGRAPH
+0x8B44 0x6C7D  #CJK UNIFIED IDEOGRAPH
+0x8B45 0x757F  #CJK UNIFIED IDEOGRAPH
+0x8B46 0x7948  #CJK UNIFIED IDEOGRAPH
+0x8B47 0x5B63  #CJK UNIFIED IDEOGRAPH
+0x8B48 0x7A00  #CJK UNIFIED IDEOGRAPH
+0x8B49 0x7D00  #CJK UNIFIED IDEOGRAPH
+0x8B4A 0x5FBD  #CJK UNIFIED IDEOGRAPH
+0x8B4B 0x898F  #CJK UNIFIED IDEOGRAPH
+0x8B4C 0x8A18  #CJK UNIFIED IDEOGRAPH
+0x8B4D 0x8CB4  #CJK UNIFIED IDEOGRAPH
+0x8B4E 0x8D77  #CJK UNIFIED IDEOGRAPH
+0x8B4F 0x8ECC  #CJK UNIFIED IDEOGRAPH
+0x8B50 0x8F1D  #CJK UNIFIED IDEOGRAPH
+0x8B51 0x98E2  #CJK UNIFIED IDEOGRAPH
+0x8B52 0x9A0E  #CJK UNIFIED IDEOGRAPH
+0x8B53 0x9B3C  #CJK UNIFIED IDEOGRAPH
+0x8B54 0x4E80  #CJK UNIFIED IDEOGRAPH
+0x8B55 0x507D  #CJK UNIFIED IDEOGRAPH
+0x8B56 0x5100  #CJK UNIFIED IDEOGRAPH
+0x8B57 0x5993  #CJK UNIFIED IDEOGRAPH
+0x8B58 0x5B9C  #CJK UNIFIED IDEOGRAPH
+0x8B59 0x622F  #CJK UNIFIED IDEOGRAPH
+0x8B5A 0x6280  #CJK UNIFIED IDEOGRAPH
+0x8B5B 0x64EC  #CJK UNIFIED IDEOGRAPH
+0x8B5C 0x6B3A  #CJK UNIFIED IDEOGRAPH
+0x8B5D 0x72A0  #CJK UNIFIED IDEOGRAPH
+0x8B5E 0x7591  #CJK UNIFIED IDEOGRAPH
+0x8B5F 0x7947  #CJK UNIFIED IDEOGRAPH
+0x8B60 0x7FA9  #CJK UNIFIED IDEOGRAPH
+0x8B61 0x87FB  #CJK UNIFIED IDEOGRAPH
+0x8B62 0x8ABC  #CJK UNIFIED IDEOGRAPH
+0x8B63 0x8B70  #CJK UNIFIED IDEOGRAPH
+0x8B64 0x63AC  #CJK UNIFIED IDEOGRAPH
+0x8B65 0x83CA  #CJK UNIFIED IDEOGRAPH
+0x8B66 0x97A0  #CJK UNIFIED IDEOGRAPH
+0x8B67 0x5409  #CJK UNIFIED IDEOGRAPH
+0x8B68 0x5403  #CJK UNIFIED IDEOGRAPH
+0x8B69 0x55AB  #CJK UNIFIED IDEOGRAPH
+0x8B6A 0x6854  #CJK UNIFIED IDEOGRAPH
+0x8B6B 0x6A58  #CJK UNIFIED IDEOGRAPH
+0x8B6C 0x8A70  #CJK UNIFIED IDEOGRAPH
+0x8B6D 0x7827  #CJK UNIFIED IDEOGRAPH
+0x8B6E 0x6775  #CJK UNIFIED IDEOGRAPH
+0x8B6F 0x9ECD  #CJK UNIFIED IDEOGRAPH
+0x8B70 0x5374  #CJK UNIFIED IDEOGRAPH
+0x8B71 0x5BA2  #CJK UNIFIED IDEOGRAPH
+0x8B72 0x811A  #CJK UNIFIED IDEOGRAPH
+0x8B73 0x8650  #CJK UNIFIED IDEOGRAPH
+0x8B74 0x9006  #CJK UNIFIED IDEOGRAPH
+0x8B75 0x4E18  #CJK UNIFIED IDEOGRAPH
+0x8B76 0x4E45  #CJK UNIFIED IDEOGRAPH
+0x8B77 0x4EC7  #CJK UNIFIED IDEOGRAPH
+0x8B78 0x4F11  #CJK UNIFIED IDEOGRAPH
+0x8B79 0x53CA  #CJK UNIFIED IDEOGRAPH
+0x8B7A 0x5438  #CJK UNIFIED IDEOGRAPH
+0x8B7B 0x5BAE  #CJK UNIFIED IDEOGRAPH
+0x8B7C 0x5F13  #CJK UNIFIED IDEOGRAPH
+0x8B7D 0x6025  #CJK UNIFIED IDEOGRAPH
+0x8B7E 0x6551  #CJK UNIFIED IDEOGRAPH
+0x8B80 0x673D  #CJK UNIFIED IDEOGRAPH
+0x8B81 0x6C42  #CJK UNIFIED IDEOGRAPH
+0x8B82 0x6C72  #CJK UNIFIED IDEOGRAPH
+0x8B83 0x6CE3  #CJK UNIFIED IDEOGRAPH
+0x8B84 0x7078  #CJK UNIFIED IDEOGRAPH
+0x8B85 0x7403  #CJK UNIFIED IDEOGRAPH
+0x8B86 0x7A76  #CJK UNIFIED IDEOGRAPH
+0x8B87 0x7AAE  #CJK UNIFIED IDEOGRAPH
+0x8B88 0x7B08  #CJK UNIFIED IDEOGRAPH
+0x8B89 0x7D1A  #CJK UNIFIED IDEOGRAPH
+0x8B8A 0x7CFE  #CJK UNIFIED IDEOGRAPH
+0x8B8B 0x7D66  #CJK UNIFIED IDEOGRAPH
+0x8B8C 0x65E7  #CJK UNIFIED IDEOGRAPH
+0x8B8D 0x725B  #CJK UNIFIED IDEOGRAPH
+0x8B8E 0x53BB  #CJK UNIFIED IDEOGRAPH
+0x8B8F 0x5C45  #CJK UNIFIED IDEOGRAPH
+0x8B90 0x5DE8  #CJK UNIFIED IDEOGRAPH
+0x8B91 0x62D2  #CJK UNIFIED IDEOGRAPH
+0x8B92 0x62E0  #CJK UNIFIED IDEOGRAPH
+0x8B93 0x6319  #CJK UNIFIED IDEOGRAPH
+0x8B94 0x6E20  #CJK UNIFIED IDEOGRAPH
+0x8B95 0x865A  #CJK UNIFIED IDEOGRAPH
+0x8B96 0x8A31  #CJK UNIFIED IDEOGRAPH
+0x8B97 0x8DDD  #CJK UNIFIED IDEOGRAPH
+0x8B98 0x92F8  #CJK UNIFIED IDEOGRAPH
+0x8B99 0x6F01  #CJK UNIFIED IDEOGRAPH
+0x8B9A 0x79A6  #CJK UNIFIED IDEOGRAPH
+0x8B9B 0x9B5A  #CJK UNIFIED IDEOGRAPH
+0x8B9C 0x4EA8  #CJK UNIFIED IDEOGRAPH
+0x8B9D 0x4EAB  #CJK UNIFIED IDEOGRAPH
+0x8B9E 0x4EAC  #CJK UNIFIED IDEOGRAPH
+0x8B9F 0x4F9B  #CJK UNIFIED IDEOGRAPH
+0x8BA0 0x4FA0  #CJK UNIFIED IDEOGRAPH
+0x8BA1 0x50D1  #CJK UNIFIED IDEOGRAPH
+0x8BA2 0x5147  #CJK UNIFIED IDEOGRAPH
+0x8BA3 0x7AF6  #CJK UNIFIED IDEOGRAPH
+0x8BA4 0x5171  #CJK UNIFIED IDEOGRAPH
+0x8BA5 0x51F6  #CJK UNIFIED IDEOGRAPH
+0x8BA6 0x5354  #CJK UNIFIED IDEOGRAPH
+0x8BA7 0x5321  #CJK UNIFIED IDEOGRAPH
+0x8BA8 0x537F  #CJK UNIFIED IDEOGRAPH
+0x8BA9 0x53EB  #CJK UNIFIED IDEOGRAPH
+0x8BAA 0x55AC  #CJK UNIFIED IDEOGRAPH
+0x8BAB 0x5883  #CJK UNIFIED IDEOGRAPH
+0x8BAC 0x5CE1  #CJK UNIFIED IDEOGRAPH
+0x8BAD 0x5F37  #CJK UNIFIED IDEOGRAPH
+0x8BAE 0x5F4A  #CJK UNIFIED IDEOGRAPH
+0x8BAF 0x602F  #CJK UNIFIED IDEOGRAPH
+0x8BB0 0x6050  #CJK UNIFIED IDEOGRAPH
+0x8BB1 0x606D  #CJK UNIFIED IDEOGRAPH
+0x8BB2 0x631F  #CJK UNIFIED IDEOGRAPH
+0x8BB3 0x6559  #CJK UNIFIED IDEOGRAPH
+0x8BB4 0x6A4B  #CJK UNIFIED IDEOGRAPH
+0x8BB5 0x6CC1  #CJK UNIFIED IDEOGRAPH
+0x8BB6 0x72C2  #CJK UNIFIED IDEOGRAPH
+0x8BB7 0x72ED  #CJK UNIFIED IDEOGRAPH
+0x8BB8 0x77EF  #CJK UNIFIED IDEOGRAPH
+0x8BB9 0x80F8  #CJK UNIFIED IDEOGRAPH
+0x8BBA 0x8105  #CJK UNIFIED IDEOGRAPH
+0x8BBB 0x8208  #CJK UNIFIED IDEOGRAPH
+0x8BBC 0x854E  #CJK UNIFIED IDEOGRAPH
+0x8BBD 0x90F7  #CJK UNIFIED IDEOGRAPH
+0x8BBE 0x93E1  #CJK UNIFIED IDEOGRAPH
+0x8BBF 0x97FF  #CJK UNIFIED IDEOGRAPH
+0x8BC0 0x9957  #CJK UNIFIED IDEOGRAPH
+0x8BC1 0x9A5A  #CJK UNIFIED IDEOGRAPH
+0x8BC2 0x4EF0  #CJK UNIFIED IDEOGRAPH
+0x8BC3 0x51DD  #CJK UNIFIED IDEOGRAPH
+0x8BC4 0x5C2D  #CJK UNIFIED IDEOGRAPH
+0x8BC5 0x6681  #CJK UNIFIED IDEOGRAPH
+0x8BC6 0x696D  #CJK UNIFIED IDEOGRAPH
+0x8BC7 0x5C40  #CJK UNIFIED IDEOGRAPH
+0x8BC8 0x66F2  #CJK UNIFIED IDEOGRAPH
+0x8BC9 0x6975  #CJK UNIFIED IDEOGRAPH
+0x8BCA 0x7389  #CJK UNIFIED IDEOGRAPH
+0x8BCB 0x6850  #CJK UNIFIED IDEOGRAPH
+0x8BCC 0x7C81  #CJK UNIFIED IDEOGRAPH
+0x8BCD 0x50C5  #CJK UNIFIED IDEOGRAPH
+0x8BCE 0x52E4  #CJK UNIFIED IDEOGRAPH
+0x8BCF 0x5747  #CJK UNIFIED IDEOGRAPH
+0x8BD0 0x5DFE  #CJK UNIFIED IDEOGRAPH
+0x8BD1 0x9326  #CJK UNIFIED IDEOGRAPH
+0x8BD2 0x65A4  #CJK UNIFIED IDEOGRAPH
+0x8BD3 0x6B23  #CJK UNIFIED IDEOGRAPH
+0x8BD4 0x6B3D  #CJK UNIFIED IDEOGRAPH
+0x8BD5 0x7434  #CJK UNIFIED IDEOGRAPH
+0x8BD6 0x7981  #CJK UNIFIED IDEOGRAPH
+0x8BD7 0x79BD  #CJK UNIFIED IDEOGRAPH
+0x8BD8 0x7B4B  #CJK UNIFIED IDEOGRAPH
+0x8BD9 0x7DCA  #CJK UNIFIED IDEOGRAPH
+0x8BDA 0x82B9  #CJK UNIFIED IDEOGRAPH
+0x8BDB 0x83CC  #CJK UNIFIED IDEOGRAPH
+0x8BDC 0x887F  #CJK UNIFIED IDEOGRAPH
+0x8BDD 0x895F  #CJK UNIFIED IDEOGRAPH
+0x8BDE 0x8B39  #CJK UNIFIED IDEOGRAPH
+0x8BDF 0x8FD1  #CJK UNIFIED IDEOGRAPH
+0x8BE0 0x91D1  #CJK UNIFIED IDEOGRAPH
+0x8BE1 0x541F  #CJK UNIFIED IDEOGRAPH
+0x8BE2 0x9280  #CJK UNIFIED IDEOGRAPH
+0x8BE3 0x4E5D  #CJK UNIFIED IDEOGRAPH
+0x8BE4 0x5036  #CJK UNIFIED IDEOGRAPH
+0x8BE5 0x53E5  #CJK UNIFIED IDEOGRAPH
+0x8BE6 0x533A  #CJK UNIFIED IDEOGRAPH
+0x8BE7 0x72D7  #CJK UNIFIED IDEOGRAPH
+0x8BE8 0x7396  #CJK UNIFIED IDEOGRAPH
+0x8BE9 0x77E9  #CJK UNIFIED IDEOGRAPH
+0x8BEA 0x82E6  #CJK UNIFIED IDEOGRAPH
+0x8BEB 0x8EAF  #CJK UNIFIED IDEOGRAPH
+0x8BEC 0x99C6  #CJK UNIFIED IDEOGRAPH
+0x8BED 0x99C8  #CJK UNIFIED IDEOGRAPH
+0x8BEE 0x99D2  #CJK UNIFIED IDEOGRAPH
+0x8BEF 0x5177  #CJK UNIFIED IDEOGRAPH
+0x8BF0 0x611A  #CJK UNIFIED IDEOGRAPH
+0x8BF1 0x865E  #CJK UNIFIED IDEOGRAPH
+0x8BF2 0x55B0  #CJK UNIFIED IDEOGRAPH
+0x8BF3 0x7A7A  #CJK UNIFIED IDEOGRAPH
+0x8BF4 0x5076  #CJK UNIFIED IDEOGRAPH
+0x8BF5 0x5BD3  #CJK UNIFIED IDEOGRAPH
+0x8BF6 0x9047  #CJK UNIFIED IDEOGRAPH
+0x8BF7 0x9685  #CJK UNIFIED IDEOGRAPH
+0x8BF8 0x4E32  #CJK UNIFIED IDEOGRAPH
+0x8BF9 0x6ADB  #CJK UNIFIED IDEOGRAPH
+0x8BFA 0x91E7  #CJK UNIFIED IDEOGRAPH
+0x8BFB 0x5C51  #CJK UNIFIED IDEOGRAPH
+0x8BFC 0x5C48  #CJK UNIFIED IDEOGRAPH
+0x8C40 0x6398  #CJK UNIFIED IDEOGRAPH
+0x8C41 0x7A9F  #CJK UNIFIED IDEOGRAPH
+0x8C42 0x6C93  #CJK UNIFIED IDEOGRAPH
+0x8C43 0x9774  #CJK UNIFIED IDEOGRAPH
+0x8C44 0x8F61  #CJK UNIFIED IDEOGRAPH
+0x8C45 0x7AAA  #CJK UNIFIED IDEOGRAPH
+0x8C46 0x718A  #CJK UNIFIED IDEOGRAPH
+0x8C47 0x9688  #CJK UNIFIED IDEOGRAPH
+0x8C48 0x7C82  #CJK UNIFIED IDEOGRAPH
+0x8C49 0x6817  #CJK UNIFIED IDEOGRAPH
+0x8C4A 0x7E70  #CJK UNIFIED IDEOGRAPH
+0x8C4B 0x6851  #CJK UNIFIED IDEOGRAPH
+0x8C4C 0x936C  #CJK UNIFIED IDEOGRAPH
+0x8C4D 0x52F2  #CJK UNIFIED IDEOGRAPH
+0x8C4E 0x541B  #CJK UNIFIED IDEOGRAPH
+0x8C4F 0x85AB  #CJK UNIFIED IDEOGRAPH
+0x8C50 0x8A13  #CJK UNIFIED IDEOGRAPH
+0x8C51 0x7FA4  #CJK UNIFIED IDEOGRAPH
+0x8C52 0x8ECD  #CJK UNIFIED IDEOGRAPH
+0x8C53 0x90E1  #CJK UNIFIED IDEOGRAPH
+0x8C54 0x5366  #CJK UNIFIED IDEOGRAPH
+0x8C55 0x8888  #CJK UNIFIED IDEOGRAPH
+0x8C56 0x7941  #CJK UNIFIED IDEOGRAPH
+0x8C57 0x4FC2  #CJK UNIFIED IDEOGRAPH
+0x8C58 0x50BE  #CJK UNIFIED IDEOGRAPH
+0x8C59 0x5211  #CJK UNIFIED IDEOGRAPH
+0x8C5A 0x5144  #CJK UNIFIED IDEOGRAPH
+0x8C5B 0x5553  #CJK UNIFIED IDEOGRAPH
+0x8C5C 0x572D  #CJK UNIFIED IDEOGRAPH
+0x8C5D 0x73EA  #CJK UNIFIED IDEOGRAPH
+0x8C5E 0x578B  #CJK UNIFIED IDEOGRAPH
+0x8C5F 0x5951  #CJK UNIFIED IDEOGRAPH
+0x8C60 0x5F62  #CJK UNIFIED IDEOGRAPH
+0x8C61 0x5F84  #CJK UNIFIED IDEOGRAPH
+0x8C62 0x6075  #CJK UNIFIED IDEOGRAPH
+0x8C63 0x6176  #CJK UNIFIED IDEOGRAPH
+0x8C64 0x6167  #CJK UNIFIED IDEOGRAPH
+0x8C65 0x61A9  #CJK UNIFIED IDEOGRAPH
+0x8C66 0x63B2  #CJK UNIFIED IDEOGRAPH
+0x8C67 0x643A  #CJK UNIFIED IDEOGRAPH
+0x8C68 0x656C  #CJK UNIFIED IDEOGRAPH
+0x8C69 0x666F  #CJK UNIFIED IDEOGRAPH
+0x8C6A 0x6842  #CJK UNIFIED IDEOGRAPH
+0x8C6B 0x6E13  #CJK UNIFIED IDEOGRAPH
+0x8C6C 0x7566  #CJK UNIFIED IDEOGRAPH
+0x8C6D 0x7A3D  #CJK UNIFIED IDEOGRAPH
+0x8C6E 0x7CFB  #CJK UNIFIED IDEOGRAPH
+0x8C6F 0x7D4C  #CJK UNIFIED IDEOGRAPH
+0x8C70 0x7D99  #CJK UNIFIED IDEOGRAPH
+0x8C71 0x7E4B  #CJK UNIFIED IDEOGRAPH
+0x8C72 0x7F6B  #CJK UNIFIED IDEOGRAPH
+0x8C73 0x830E  #CJK UNIFIED IDEOGRAPH
+0x8C74 0x834A  #CJK UNIFIED IDEOGRAPH
+0x8C75 0x86CD  #CJK UNIFIED IDEOGRAPH
+0x8C76 0x8A08  #CJK UNIFIED IDEOGRAPH
+0x8C77 0x8A63  #CJK UNIFIED IDEOGRAPH
+0x8C78 0x8B66  #CJK UNIFIED IDEOGRAPH
+0x8C79 0x8EFD  #CJK UNIFIED IDEOGRAPH
+0x8C7A 0x981A  #CJK UNIFIED IDEOGRAPH
+0x8C7B 0x9D8F  #CJK UNIFIED IDEOGRAPH
+0x8C7C 0x82B8  #CJK UNIFIED IDEOGRAPH
+0x8C7D 0x8FCE  #CJK UNIFIED IDEOGRAPH
+0x8C7E 0x9BE8  #CJK UNIFIED IDEOGRAPH
+0x8C80 0x5287  #CJK UNIFIED IDEOGRAPH
+0x8C81 0x621F  #CJK UNIFIED IDEOGRAPH
+0x8C82 0x6483  #CJK UNIFIED IDEOGRAPH
+0x8C83 0x6FC0  #CJK UNIFIED IDEOGRAPH
+0x8C84 0x9699  #CJK UNIFIED IDEOGRAPH
+0x8C85 0x6841  #CJK UNIFIED IDEOGRAPH
+0x8C86 0x5091  #CJK UNIFIED IDEOGRAPH
+0x8C87 0x6B20  #CJK UNIFIED IDEOGRAPH
+0x8C88 0x6C7A  #CJK UNIFIED IDEOGRAPH
+0x8C89 0x6F54  #CJK UNIFIED IDEOGRAPH
+0x8C8A 0x7A74  #CJK UNIFIED IDEOGRAPH
+0x8C8B 0x7D50  #CJK UNIFIED IDEOGRAPH
+0x8C8C 0x8840  #CJK UNIFIED IDEOGRAPH
+0x8C8D 0x8A23  #CJK UNIFIED IDEOGRAPH
+0x8C8E 0x6708  #CJK UNIFIED IDEOGRAPH
+0x8C8F 0x4EF6  #CJK UNIFIED IDEOGRAPH
+0x8C90 0x5039  #CJK UNIFIED IDEOGRAPH
+0x8C91 0x5026  #CJK UNIFIED IDEOGRAPH
+0x8C92 0x5065  #CJK UNIFIED IDEOGRAPH
+0x8C93 0x517C  #CJK UNIFIED IDEOGRAPH
+0x8C94 0x5238  #CJK UNIFIED IDEOGRAPH
+0x8C95 0x5263  #CJK UNIFIED IDEOGRAPH
+0x8C96 0x55A7  #CJK UNIFIED IDEOGRAPH
+0x8C97 0x570F  #CJK UNIFIED IDEOGRAPH
+0x8C98 0x5805  #CJK UNIFIED IDEOGRAPH
+0x8C99 0x5ACC  #CJK UNIFIED IDEOGRAPH
+0x8C9A 0x5EFA  #CJK UNIFIED IDEOGRAPH
+0x8C9B 0x61B2  #CJK UNIFIED IDEOGRAPH
+0x8C9C 0x61F8  #CJK UNIFIED IDEOGRAPH
+0x8C9D 0x62F3  #CJK UNIFIED IDEOGRAPH
+0x8C9E 0x6372  #CJK UNIFIED IDEOGRAPH
+0x8C9F 0x691C  #CJK UNIFIED IDEOGRAPH
+0x8CA0 0x6A29  #CJK UNIFIED IDEOGRAPH
+0x8CA1 0x727D  #CJK UNIFIED IDEOGRAPH
+0x8CA2 0x72AC  #CJK UNIFIED IDEOGRAPH
+0x8CA3 0x732E  #CJK UNIFIED IDEOGRAPH
+0x8CA4 0x7814  #CJK UNIFIED IDEOGRAPH
+0x8CA5 0x786F  #CJK UNIFIED IDEOGRAPH
+0x8CA6 0x7D79  #CJK UNIFIED IDEOGRAPH
+0x8CA7 0x770C  #CJK UNIFIED IDEOGRAPH
+0x8CA8 0x80A9  #CJK UNIFIED IDEOGRAPH
+0x8CA9 0x898B  #CJK UNIFIED IDEOGRAPH
+0x8CAA 0x8B19  #CJK UNIFIED IDEOGRAPH
+0x8CAB 0x8CE2  #CJK UNIFIED IDEOGRAPH
+0x8CAC 0x8ED2  #CJK UNIFIED IDEOGRAPH
+0x8CAD 0x9063  #CJK UNIFIED IDEOGRAPH
+0x8CAE 0x9375  #CJK UNIFIED IDEOGRAPH
+0x8CAF 0x967A  #CJK UNIFIED IDEOGRAPH
+0x8CB0 0x9855  #CJK UNIFIED IDEOGRAPH
+0x8CB1 0x9A13  #CJK UNIFIED IDEOGRAPH
+0x8CB2 0x9E78  #CJK UNIFIED IDEOGRAPH
+0x8CB3 0x5143  #CJK UNIFIED IDEOGRAPH
+0x8CB4 0x539F  #CJK UNIFIED IDEOGRAPH
+0x8CB5 0x53B3  #CJK UNIFIED IDEOGRAPH
+0x8CB6 0x5E7B  #CJK UNIFIED IDEOGRAPH
+0x8CB7 0x5F26  #CJK UNIFIED IDEOGRAPH
+0x8CB8 0x6E1B  #CJK UNIFIED IDEOGRAPH
+0x8CB9 0x6E90  #CJK UNIFIED IDEOGRAPH
+0x8CBA 0x7384  #CJK UNIFIED IDEOGRAPH
+0x8CBB 0x73FE  #CJK UNIFIED IDEOGRAPH
+0x8CBC 0x7D43  #CJK UNIFIED IDEOGRAPH
+0x8CBD 0x8237  #CJK UNIFIED IDEOGRAPH
+0x8CBE 0x8A00  #CJK UNIFIED IDEOGRAPH
+0x8CBF 0x8AFA  #CJK UNIFIED IDEOGRAPH
+0x8CC0 0x9650  #CJK UNIFIED IDEOGRAPH
+0x8CC1 0x4E4E  #CJK UNIFIED IDEOGRAPH
+0x8CC2 0x500B  #CJK UNIFIED IDEOGRAPH
+0x8CC3 0x53E4  #CJK UNIFIED IDEOGRAPH
+0x8CC4 0x547C  #CJK UNIFIED IDEOGRAPH
+0x8CC5 0x56FA  #CJK UNIFIED IDEOGRAPH
+0x8CC6 0x59D1  #CJK UNIFIED IDEOGRAPH
+0x8CC7 0x5B64  #CJK UNIFIED IDEOGRAPH
+0x8CC8 0x5DF1  #CJK UNIFIED IDEOGRAPH
+0x8CC9 0x5EAB  #CJK UNIFIED IDEOGRAPH
+0x8CCA 0x5F27  #CJK UNIFIED IDEOGRAPH
+0x8CCB 0x6238  #CJK UNIFIED IDEOGRAPH
+0x8CCC 0x6545  #CJK UNIFIED IDEOGRAPH
+0x8CCD 0x67AF  #CJK UNIFIED IDEOGRAPH
+0x8CCE 0x6E56  #CJK UNIFIED IDEOGRAPH
+0x8CCF 0x72D0  #CJK UNIFIED IDEOGRAPH
+0x8CD0 0x7CCA  #CJK UNIFIED IDEOGRAPH
+0x8CD1 0x88B4  #CJK UNIFIED IDEOGRAPH
+0x8CD2 0x80A1  #CJK UNIFIED IDEOGRAPH
+0x8CD3 0x80E1  #CJK UNIFIED IDEOGRAPH
+0x8CD4 0x83F0  #CJK UNIFIED IDEOGRAPH
+0x8CD5 0x864E  #CJK UNIFIED IDEOGRAPH
+0x8CD6 0x8A87  #CJK UNIFIED IDEOGRAPH
+0x8CD7 0x8DE8  #CJK UNIFIED IDEOGRAPH
+0x8CD8 0x9237  #CJK UNIFIED IDEOGRAPH
+0x8CD9 0x96C7  #CJK UNIFIED IDEOGRAPH
+0x8CDA 0x9867  #CJK UNIFIED IDEOGRAPH
+0x8CDB 0x9F13  #CJK UNIFIED IDEOGRAPH
+0x8CDC 0x4E94  #CJK UNIFIED IDEOGRAPH
+0x8CDD 0x4E92  #CJK UNIFIED IDEOGRAPH
+0x8CDE 0x4F0D  #CJK UNIFIED IDEOGRAPH
+0x8CDF 0x5348  #CJK UNIFIED IDEOGRAPH
+0x8CE0 0x5449  #CJK UNIFIED IDEOGRAPH
+0x8CE1 0x543E  #CJK UNIFIED IDEOGRAPH
+0x8CE2 0x5A2F  #CJK UNIFIED IDEOGRAPH
+0x8CE3 0x5F8C  #CJK UNIFIED IDEOGRAPH
+0x8CE4 0x5FA1  #CJK UNIFIED IDEOGRAPH
+0x8CE5 0x609F  #CJK UNIFIED IDEOGRAPH
+0x8CE6 0x68A7  #CJK UNIFIED IDEOGRAPH
+0x8CE7 0x6A8E  #CJK UNIFIED IDEOGRAPH
+0x8CE8 0x745A  #CJK UNIFIED IDEOGRAPH
+0x8CE9 0x7881  #CJK UNIFIED IDEOGRAPH
+0x8CEA 0x8A9E  #CJK UNIFIED IDEOGRAPH
+0x8CEB 0x8AA4  #CJK UNIFIED IDEOGRAPH
+0x8CEC 0x8B77  #CJK UNIFIED IDEOGRAPH
+0x8CED 0x9190  #CJK UNIFIED IDEOGRAPH
+0x8CEE 0x4E5E  #CJK UNIFIED IDEOGRAPH
+0x8CEF 0x9BC9  #CJK UNIFIED IDEOGRAPH
+0x8CF0 0x4EA4  #CJK UNIFIED IDEOGRAPH
+0x8CF1 0x4F7C  #CJK UNIFIED IDEOGRAPH
+0x8CF2 0x4FAF  #CJK UNIFIED IDEOGRAPH
+0x8CF3 0x5019  #CJK UNIFIED IDEOGRAPH
+0x8CF4 0x5016  #CJK UNIFIED IDEOGRAPH
+0x8CF5 0x5149  #CJK UNIFIED IDEOGRAPH
+0x8CF6 0x516C  #CJK UNIFIED IDEOGRAPH
+0x8CF7 0x529F  #CJK UNIFIED IDEOGRAPH
+0x8CF8 0x52B9  #CJK UNIFIED IDEOGRAPH
+0x8CF9 0x52FE  #CJK UNIFIED IDEOGRAPH
+0x8CFA 0x539A  #CJK UNIFIED IDEOGRAPH
+0x8CFB 0x53E3  #CJK UNIFIED IDEOGRAPH
+0x8CFC 0x5411  #CJK UNIFIED IDEOGRAPH
+0x8D40 0x540E  #CJK UNIFIED IDEOGRAPH
+0x8D41 0x5589  #CJK UNIFIED IDEOGRAPH
+0x8D42 0x5751  #CJK UNIFIED IDEOGRAPH
+0x8D43 0x57A2  #CJK UNIFIED IDEOGRAPH
+0x8D44 0x597D  #CJK UNIFIED IDEOGRAPH
+0x8D45 0x5B54  #CJK UNIFIED IDEOGRAPH
+0x8D46 0x5B5D  #CJK UNIFIED IDEOGRAPH
+0x8D47 0x5B8F  #CJK UNIFIED IDEOGRAPH
+0x8D48 0x5DE5  #CJK UNIFIED IDEOGRAPH
+0x8D49 0x5DE7  #CJK UNIFIED IDEOGRAPH
+0x8D4A 0x5DF7  #CJK UNIFIED IDEOGRAPH
+0x8D4B 0x5E78  #CJK UNIFIED IDEOGRAPH
+0x8D4C 0x5E83  #CJK UNIFIED IDEOGRAPH
+0x8D4D 0x5E9A  #CJK UNIFIED IDEOGRAPH
+0x8D4E 0x5EB7  #CJK UNIFIED IDEOGRAPH
+0x8D4F 0x5F18  #CJK UNIFIED IDEOGRAPH
+0x8D50 0x6052  #CJK UNIFIED IDEOGRAPH
+0x8D51 0x614C  #CJK UNIFIED IDEOGRAPH
+0x8D52 0x6297  #CJK UNIFIED IDEOGRAPH
+0x8D53 0x62D8  #CJK UNIFIED IDEOGRAPH
+0x8D54 0x63A7  #CJK UNIFIED IDEOGRAPH
+0x8D55 0x653B  #CJK UNIFIED IDEOGRAPH
+0x8D56 0x6602  #CJK UNIFIED IDEOGRAPH
+0x8D57 0x6643  #CJK UNIFIED IDEOGRAPH
+0x8D58 0x66F4  #CJK UNIFIED IDEOGRAPH
+0x8D59 0x676D  #CJK UNIFIED IDEOGRAPH
+0x8D5A 0x6821  #CJK UNIFIED IDEOGRAPH
+0x8D5B 0x6897  #CJK UNIFIED IDEOGRAPH
+0x8D5C 0x69CB  #CJK UNIFIED IDEOGRAPH
+0x8D5D 0x6C5F  #CJK UNIFIED IDEOGRAPH
+0x8D5E 0x6D2A  #CJK UNIFIED IDEOGRAPH
+0x8D5F 0x6D69  #CJK UNIFIED IDEOGRAPH
+0x8D60 0x6E2F  #CJK UNIFIED IDEOGRAPH
+0x8D61 0x6E9D  #CJK UNIFIED IDEOGRAPH
+0x8D62 0x7532  #CJK UNIFIED IDEOGRAPH
+0x8D63 0x7687  #CJK UNIFIED IDEOGRAPH
+0x8D64 0x786C  #CJK UNIFIED IDEOGRAPH
+0x8D65 0x7A3F  #CJK UNIFIED IDEOGRAPH
+0x8D66 0x7CE0  #CJK UNIFIED IDEOGRAPH
+0x8D67 0x7D05  #CJK UNIFIED IDEOGRAPH
+0x8D68 0x7D18  #CJK UNIFIED IDEOGRAPH
+0x8D69 0x7D5E  #CJK UNIFIED IDEOGRAPH
+0x8D6A 0x7DB1  #CJK UNIFIED IDEOGRAPH
+0x8D6B 0x8015  #CJK UNIFIED IDEOGRAPH
+0x8D6C 0x8003  #CJK UNIFIED IDEOGRAPH
+0x8D6D 0x80AF  #CJK UNIFIED IDEOGRAPH
+0x8D6E 0x80B1  #CJK UNIFIED IDEOGRAPH
+0x8D6F 0x8154  #CJK UNIFIED IDEOGRAPH
+0x8D70 0x818F  #CJK UNIFIED IDEOGRAPH
+0x8D71 0x822A  #CJK UNIFIED IDEOGRAPH
+0x8D72 0x8352  #CJK UNIFIED IDEOGRAPH
+0x8D73 0x884C  #CJK UNIFIED IDEOGRAPH
+0x8D74 0x8861  #CJK UNIFIED IDEOGRAPH
+0x8D75 0x8B1B  #CJK UNIFIED IDEOGRAPH
+0x8D76 0x8CA2  #CJK UNIFIED IDEOGRAPH
+0x8D77 0x8CFC  #CJK UNIFIED IDEOGRAPH
+0x8D78 0x90CA  #CJK UNIFIED IDEOGRAPH
+0x8D79 0x9175  #CJK UNIFIED IDEOGRAPH
+0x8D7A 0x9271  #CJK UNIFIED IDEOGRAPH
+0x8D7B 0x783F  #CJK UNIFIED IDEOGRAPH
+0x8D7C 0x92FC  #CJK UNIFIED IDEOGRAPH
+0x8D7D 0x95A4  #CJK UNIFIED IDEOGRAPH
+0x8D7E 0x964D  #CJK UNIFIED IDEOGRAPH
+0x8D80 0x9805  #CJK UNIFIED IDEOGRAPH
+0x8D81 0x9999  #CJK UNIFIED IDEOGRAPH
+0x8D82 0x9AD8  #CJK UNIFIED IDEOGRAPH
+0x8D83 0x9D3B  #CJK UNIFIED IDEOGRAPH
+0x8D84 0x525B  #CJK UNIFIED IDEOGRAPH
+0x8D85 0x52AB  #CJK UNIFIED IDEOGRAPH
+0x8D86 0x53F7  #CJK UNIFIED IDEOGRAPH
+0x8D87 0x5408  #CJK UNIFIED IDEOGRAPH
+0x8D88 0x58D5  #CJK UNIFIED IDEOGRAPH
+0x8D89 0x62F7  #CJK UNIFIED IDEOGRAPH
+0x8D8A 0x6FE0  #CJK UNIFIED IDEOGRAPH
+0x8D8B 0x8C6A  #CJK UNIFIED IDEOGRAPH
+0x8D8C 0x8F5F  #CJK UNIFIED IDEOGRAPH
+0x8D8D 0x9EB9  #CJK UNIFIED IDEOGRAPH
+0x8D8E 0x514B  #CJK UNIFIED IDEOGRAPH
+0x8D8F 0x523B  #CJK UNIFIED IDEOGRAPH
+0x8D90 0x544A  #CJK UNIFIED IDEOGRAPH
+0x8D91 0x56FD  #CJK UNIFIED IDEOGRAPH
+0x8D92 0x7A40  #CJK UNIFIED IDEOGRAPH
+0x8D93 0x9177  #CJK UNIFIED IDEOGRAPH
+0x8D94 0x9D60  #CJK UNIFIED IDEOGRAPH
+0x8D95 0x9ED2  #CJK UNIFIED IDEOGRAPH
+0x8D96 0x7344  #CJK UNIFIED IDEOGRAPH
+0x8D97 0x6F09  #CJK UNIFIED IDEOGRAPH
+0x8D98 0x8170  #CJK UNIFIED IDEOGRAPH
+0x8D99 0x7511  #CJK UNIFIED IDEOGRAPH
+0x8D9A 0x5FFD  #CJK UNIFIED IDEOGRAPH
+0x8D9B 0x60DA  #CJK UNIFIED IDEOGRAPH
+0x8D9C 0x9AA8  #CJK UNIFIED IDEOGRAPH
+0x8D9D 0x72DB  #CJK UNIFIED IDEOGRAPH
+0x8D9E 0x8FBC  #CJK UNIFIED IDEOGRAPH
+0x8D9F 0x6B64  #CJK UNIFIED IDEOGRAPH
+0x8DA0 0x9803  #CJK UNIFIED IDEOGRAPH
+0x8DA1 0x4ECA  #CJK UNIFIED IDEOGRAPH
+0x8DA2 0x56F0  #CJK UNIFIED IDEOGRAPH
+0x8DA3 0x5764  #CJK UNIFIED IDEOGRAPH
+0x8DA4 0x58BE  #CJK UNIFIED IDEOGRAPH
+0x8DA5 0x5A5A  #CJK UNIFIED IDEOGRAPH
+0x8DA6 0x6068  #CJK UNIFIED IDEOGRAPH
+0x8DA7 0x61C7  #CJK UNIFIED IDEOGRAPH
+0x8DA8 0x660F  #CJK UNIFIED IDEOGRAPH
+0x8DA9 0x6606  #CJK UNIFIED IDEOGRAPH
+0x8DAA 0x6839  #CJK UNIFIED IDEOGRAPH
+0x8DAB 0x68B1  #CJK UNIFIED IDEOGRAPH
+0x8DAC 0x6DF7  #CJK UNIFIED IDEOGRAPH
+0x8DAD 0x75D5  #CJK UNIFIED IDEOGRAPH
+0x8DAE 0x7D3A  #CJK UNIFIED IDEOGRAPH
+0x8DAF 0x826E  #CJK UNIFIED IDEOGRAPH
+0x8DB0 0x9B42  #CJK UNIFIED IDEOGRAPH
+0x8DB1 0x4E9B  #CJK UNIFIED IDEOGRAPH
+0x8DB2 0x4F50  #CJK UNIFIED IDEOGRAPH
+0x8DB3 0x53C9  #CJK UNIFIED IDEOGRAPH
+0x8DB4 0x5506  #CJK UNIFIED IDEOGRAPH
+0x8DB5 0x5D6F  #CJK UNIFIED IDEOGRAPH
+0x8DB6 0x5DE6  #CJK UNIFIED IDEOGRAPH
+0x8DB7 0x5DEE  #CJK UNIFIED IDEOGRAPH
+0x8DB8 0x67FB  #CJK UNIFIED IDEOGRAPH
+0x8DB9 0x6C99  #CJK UNIFIED IDEOGRAPH
+0x8DBA 0x7473  #CJK UNIFIED IDEOGRAPH
+0x8DBB 0x7802  #CJK UNIFIED IDEOGRAPH
+0x8DBC 0x8A50  #CJK UNIFIED IDEOGRAPH
+0x8DBD 0x9396  #CJK UNIFIED IDEOGRAPH
+0x8DBE 0x88DF  #CJK UNIFIED IDEOGRAPH
+0x8DBF 0x5750  #CJK UNIFIED IDEOGRAPH
+0x8DC0 0x5EA7  #CJK UNIFIED IDEOGRAPH
+0x8DC1 0x632B  #CJK UNIFIED IDEOGRAPH
+0x8DC2 0x50B5  #CJK UNIFIED IDEOGRAPH
+0x8DC3 0x50AC  #CJK UNIFIED IDEOGRAPH
+0x8DC4 0x518D  #CJK UNIFIED IDEOGRAPH
+0x8DC5 0x6700  #CJK UNIFIED IDEOGRAPH
+0x8DC6 0x54C9  #CJK UNIFIED IDEOGRAPH
+0x8DC7 0x585E  #CJK UNIFIED IDEOGRAPH
+0x8DC8 0x59BB  #CJK UNIFIED IDEOGRAPH
+0x8DC9 0x5BB0  #CJK UNIFIED IDEOGRAPH
+0x8DCA 0x5F69  #CJK UNIFIED IDEOGRAPH
+0x8DCB 0x624D  #CJK UNIFIED IDEOGRAPH
+0x8DCC 0x63A1  #CJK UNIFIED IDEOGRAPH
+0x8DCD 0x683D  #CJK UNIFIED IDEOGRAPH
+0x8DCE 0x6B73  #CJK UNIFIED IDEOGRAPH
+0x8DCF 0x6E08  #CJK UNIFIED IDEOGRAPH
+0x8DD0 0x707D  #CJK UNIFIED IDEOGRAPH
+0x8DD1 0x91C7  #CJK UNIFIED IDEOGRAPH
+0x8DD2 0x7280  #CJK UNIFIED IDEOGRAPH
+0x8DD3 0x7815  #CJK UNIFIED IDEOGRAPH
+0x8DD4 0x7826  #CJK UNIFIED IDEOGRAPH
+0x8DD5 0x796D  #CJK UNIFIED IDEOGRAPH
+0x8DD6 0x658E  #CJK UNIFIED IDEOGRAPH
+0x8DD7 0x7D30  #CJK UNIFIED IDEOGRAPH
+0x8DD8 0x83DC  #CJK UNIFIED IDEOGRAPH
+0x8DD9 0x88C1  #CJK UNIFIED IDEOGRAPH
+0x8DDA 0x8F09  #CJK UNIFIED IDEOGRAPH
+0x8DDB 0x969B  #CJK UNIFIED IDEOGRAPH
+0x8DDC 0x5264  #CJK UNIFIED IDEOGRAPH
+0x8DDD 0x5728  #CJK UNIFIED IDEOGRAPH
+0x8DDE 0x6750  #CJK UNIFIED IDEOGRAPH
+0x8DDF 0x7F6A  #CJK UNIFIED IDEOGRAPH
+0x8DE0 0x8CA1  #CJK UNIFIED IDEOGRAPH
+0x8DE1 0x51B4  #CJK UNIFIED IDEOGRAPH
+0x8DE2 0x5742  #CJK UNIFIED IDEOGRAPH
+0x8DE3 0x962A  #CJK UNIFIED IDEOGRAPH
+0x8DE4 0x583A  #CJK UNIFIED IDEOGRAPH
+0x8DE5 0x698A  #CJK UNIFIED IDEOGRAPH
+0x8DE6 0x80B4  #CJK UNIFIED IDEOGRAPH
+0x8DE7 0x54B2  #CJK UNIFIED IDEOGRAPH
+0x8DE8 0x5D0E  #CJK UNIFIED IDEOGRAPH
+0x8DE9 0x57FC  #CJK UNIFIED IDEOGRAPH
+0x8DEA 0x7895  #CJK UNIFIED IDEOGRAPH
+0x8DEB 0x9DFA  #CJK UNIFIED IDEOGRAPH
+0x8DEC 0x4F5C  #CJK UNIFIED IDEOGRAPH
+0x8DED 0x524A  #CJK UNIFIED IDEOGRAPH
+0x8DEE 0x548B  #CJK UNIFIED IDEOGRAPH
+0x8DEF 0x643E  #CJK UNIFIED IDEOGRAPH
+0x8DF0 0x6628  #CJK UNIFIED IDEOGRAPH
+0x8DF1 0x6714  #CJK UNIFIED IDEOGRAPH
+0x8DF2 0x67F5  #CJK UNIFIED IDEOGRAPH
+0x8DF3 0x7A84  #CJK UNIFIED IDEOGRAPH
+0x8DF4 0x7B56  #CJK UNIFIED IDEOGRAPH
+0x8DF5 0x7D22  #CJK UNIFIED IDEOGRAPH
+0x8DF6 0x932F  #CJK UNIFIED IDEOGRAPH
+0x8DF7 0x685C  #CJK UNIFIED IDEOGRAPH
+0x8DF8 0x9BAD  #CJK UNIFIED IDEOGRAPH
+0x8DF9 0x7B39  #CJK UNIFIED IDEOGRAPH
+0x8DFA 0x5319  #CJK UNIFIED IDEOGRAPH
+0x8DFB 0x518A  #CJK UNIFIED IDEOGRAPH
+0x8DFC 0x5237  #CJK UNIFIED IDEOGRAPH
+0x8E40 0x5BDF  #CJK UNIFIED IDEOGRAPH
+0x8E41 0x62F6  #CJK UNIFIED IDEOGRAPH
+0x8E42 0x64AE  #CJK UNIFIED IDEOGRAPH
+0x8E43 0x64E6  #CJK UNIFIED IDEOGRAPH
+0x8E44 0x672D  #CJK UNIFIED IDEOGRAPH
+0x8E45 0x6BBA  #CJK UNIFIED IDEOGRAPH
+0x8E46 0x85A9  #CJK UNIFIED IDEOGRAPH
+0x8E47 0x96D1  #CJK UNIFIED IDEOGRAPH
+0x8E48 0x7690  #CJK UNIFIED IDEOGRAPH
+0x8E49 0x9BD6  #CJK UNIFIED IDEOGRAPH
+0x8E4A 0x634C  #CJK UNIFIED IDEOGRAPH
+0x8E4B 0x9306  #CJK UNIFIED IDEOGRAPH
+0x8E4C 0x9BAB  #CJK UNIFIED IDEOGRAPH
+0x8E4D 0x76BF  #CJK UNIFIED IDEOGRAPH
+0x8E4E 0x6652  #CJK UNIFIED IDEOGRAPH
+0x8E4F 0x4E09  #CJK UNIFIED IDEOGRAPH
+0x8E50 0x5098  #CJK UNIFIED IDEOGRAPH
+0x8E51 0x53C2  #CJK UNIFIED IDEOGRAPH
+0x8E52 0x5C71  #CJK UNIFIED IDEOGRAPH
+0x8E53 0x60E8  #CJK UNIFIED IDEOGRAPH
+0x8E54 0x6492  #CJK UNIFIED IDEOGRAPH
+0x8E55 0x6563  #CJK UNIFIED IDEOGRAPH
+0x8E56 0x685F  #CJK UNIFIED IDEOGRAPH
+0x8E57 0x71E6  #CJK UNIFIED IDEOGRAPH
+0x8E58 0x73CA  #CJK UNIFIED IDEOGRAPH
+0x8E59 0x7523  #CJK UNIFIED IDEOGRAPH
+0x8E5A 0x7B97  #CJK UNIFIED IDEOGRAPH
+0x8E5B 0x7E82  #CJK UNIFIED IDEOGRAPH
+0x8E5C 0x8695  #CJK UNIFIED IDEOGRAPH
+0x8E5D 0x8B83  #CJK UNIFIED IDEOGRAPH
+0x8E5E 0x8CDB  #CJK UNIFIED IDEOGRAPH
+0x8E5F 0x9178  #CJK UNIFIED IDEOGRAPH
+0x8E60 0x9910  #CJK UNIFIED IDEOGRAPH
+0x8E61 0x65AC  #CJK UNIFIED IDEOGRAPH
+0x8E62 0x66AB  #CJK UNIFIED IDEOGRAPH
+0x8E63 0x6B8B  #CJK UNIFIED IDEOGRAPH
+0x8E64 0x4ED5  #CJK UNIFIED IDEOGRAPH
+0x8E65 0x4ED4  #CJK UNIFIED IDEOGRAPH
+0x8E66 0x4F3A  #CJK UNIFIED IDEOGRAPH
+0x8E67 0x4F7F  #CJK UNIFIED IDEOGRAPH
+0x8E68 0x523A  #CJK UNIFIED IDEOGRAPH
+0x8E69 0x53F8  #CJK UNIFIED IDEOGRAPH
+0x8E6A 0x53F2  #CJK UNIFIED IDEOGRAPH
+0x8E6B 0x55E3  #CJK UNIFIED IDEOGRAPH
+0x8E6C 0x56DB  #CJK UNIFIED IDEOGRAPH
+0x8E6D 0x58EB  #CJK UNIFIED IDEOGRAPH
+0x8E6E 0x59CB  #CJK UNIFIED IDEOGRAPH
+0x8E6F 0x59C9  #CJK UNIFIED IDEOGRAPH
+0x8E70 0x59FF  #CJK UNIFIED IDEOGRAPH
+0x8E71 0x5B50  #CJK UNIFIED IDEOGRAPH
+0x8E72 0x5C4D  #CJK UNIFIED IDEOGRAPH
+0x8E73 0x5E02  #CJK UNIFIED IDEOGRAPH
+0x8E74 0x5E2B  #CJK UNIFIED IDEOGRAPH
+0x8E75 0x5FD7  #CJK UNIFIED IDEOGRAPH
+0x8E76 0x601D  #CJK UNIFIED IDEOGRAPH
+0x8E77 0x6307  #CJK UNIFIED IDEOGRAPH
+0x8E78 0x652F  #CJK UNIFIED IDEOGRAPH
+0x8E79 0x5B5C  #CJK UNIFIED IDEOGRAPH
+0x8E7A 0x65AF  #CJK UNIFIED IDEOGRAPH
+0x8E7B 0x65BD  #CJK UNIFIED IDEOGRAPH
+0x8E7C 0x65E8  #CJK UNIFIED IDEOGRAPH
+0x8E7D 0x679D  #CJK UNIFIED IDEOGRAPH
+0x8E7E 0x6B62  #CJK UNIFIED IDEOGRAPH
+0x8E80 0x6B7B  #CJK UNIFIED IDEOGRAPH
+0x8E81 0x6C0F  #CJK UNIFIED IDEOGRAPH
+0x8E82 0x7345  #CJK UNIFIED IDEOGRAPH
+0x8E83 0x7949  #CJK UNIFIED IDEOGRAPH
+0x8E84 0x79C1  #CJK UNIFIED IDEOGRAPH
+0x8E85 0x7CF8  #CJK UNIFIED IDEOGRAPH
+0x8E86 0x7D19  #CJK UNIFIED IDEOGRAPH
+0x8E87 0x7D2B  #CJK UNIFIED IDEOGRAPH
+0x8E88 0x80A2  #CJK UNIFIED IDEOGRAPH
+0x8E89 0x8102  #CJK UNIFIED IDEOGRAPH
+0x8E8A 0x81F3  #CJK UNIFIED IDEOGRAPH
+0x8E8B 0x8996  #CJK UNIFIED IDEOGRAPH
+0x8E8C 0x8A5E  #CJK UNIFIED IDEOGRAPH
+0x8E8D 0x8A69  #CJK UNIFIED IDEOGRAPH
+0x8E8E 0x8A66  #CJK UNIFIED IDEOGRAPH
+0x8E8F 0x8A8C  #CJK UNIFIED IDEOGRAPH
+0x8E90 0x8AEE  #CJK UNIFIED IDEOGRAPH
+0x8E91 0x8CC7  #CJK UNIFIED IDEOGRAPH
+0x8E92 0x8CDC  #CJK UNIFIED IDEOGRAPH
+0x8E93 0x96CC  #CJK UNIFIED IDEOGRAPH
+0x8E94 0x98FC  #CJK UNIFIED IDEOGRAPH
+0x8E95 0x6B6F  #CJK UNIFIED IDEOGRAPH
+0x8E96 0x4E8B  #CJK UNIFIED IDEOGRAPH
+0x8E97 0x4F3C  #CJK UNIFIED IDEOGRAPH
+0x8E98 0x4F8D  #CJK UNIFIED IDEOGRAPH
+0x8E99 0x5150  #CJK UNIFIED IDEOGRAPH
+0x8E9A 0x5B57  #CJK UNIFIED IDEOGRAPH
+0x8E9B 0x5BFA  #CJK UNIFIED IDEOGRAPH
+0x8E9C 0x6148  #CJK UNIFIED IDEOGRAPH
+0x8E9D 0x6301  #CJK UNIFIED IDEOGRAPH
+0x8E9E 0x6642  #CJK UNIFIED IDEOGRAPH
+0x8E9F 0x6B21  #CJK UNIFIED IDEOGRAPH
+0x8EA0 0x6ECB  #CJK UNIFIED IDEOGRAPH
+0x8EA1 0x6CBB  #CJK UNIFIED IDEOGRAPH
+0x8EA2 0x723E  #CJK UNIFIED IDEOGRAPH
+0x8EA3 0x74BD  #CJK UNIFIED IDEOGRAPH
+0x8EA4 0x75D4  #CJK UNIFIED IDEOGRAPH
+0x8EA5 0x78C1  #CJK UNIFIED IDEOGRAPH
+0x8EA6 0x793A  #CJK UNIFIED IDEOGRAPH
+0x8EA7 0x800C  #CJK UNIFIED IDEOGRAPH
+0x8EA8 0x8033  #CJK UNIFIED IDEOGRAPH
+0x8EA9 0x81EA  #CJK UNIFIED IDEOGRAPH
+0x8EAA 0x8494  #CJK UNIFIED IDEOGRAPH
+0x8EAB 0x8F9E  #CJK UNIFIED IDEOGRAPH
+0x8EAC 0x6C50  #CJK UNIFIED IDEOGRAPH
+0x8EAD 0x9E7F  #CJK UNIFIED IDEOGRAPH
+0x8EAE 0x5F0F  #CJK UNIFIED IDEOGRAPH
+0x8EAF 0x8B58  #CJK UNIFIED IDEOGRAPH
+0x8EB0 0x9D2B  #CJK UNIFIED IDEOGRAPH
+0x8EB1 0x7AFA  #CJK UNIFIED IDEOGRAPH
+0x8EB2 0x8EF8  #CJK UNIFIED IDEOGRAPH
+0x8EB3 0x5B8D  #CJK UNIFIED IDEOGRAPH
+0x8EB4 0x96EB  #CJK UNIFIED IDEOGRAPH
+0x8EB5 0x4E03  #CJK UNIFIED IDEOGRAPH
+0x8EB6 0x53F1  #CJK UNIFIED IDEOGRAPH
+0x8EB7 0x57F7  #CJK UNIFIED IDEOGRAPH
+0x8EB8 0x5931  #CJK UNIFIED IDEOGRAPH
+0x8EB9 0x5AC9  #CJK UNIFIED IDEOGRAPH
+0x8EBA 0x5BA4  #CJK UNIFIED IDEOGRAPH
+0x8EBB 0x6089  #CJK UNIFIED IDEOGRAPH
+0x8EBC 0x6E7F  #CJK UNIFIED IDEOGRAPH
+0x8EBD 0x6F06  #CJK UNIFIED IDEOGRAPH
+0x8EBE 0x75BE  #CJK UNIFIED IDEOGRAPH
+0x8EBF 0x8CEA  #CJK UNIFIED IDEOGRAPH
+0x8EC0 0x5B9F  #CJK UNIFIED IDEOGRAPH
+0x8EC1 0x8500  #CJK UNIFIED IDEOGRAPH
+0x8EC2 0x7BE0  #CJK UNIFIED IDEOGRAPH
+0x8EC3 0x5072  #CJK UNIFIED IDEOGRAPH
+0x8EC4 0x67F4  #CJK UNIFIED IDEOGRAPH
+0x8EC5 0x829D  #CJK UNIFIED IDEOGRAPH
+0x8EC6 0x5C61  #CJK UNIFIED IDEOGRAPH
+0x8EC7 0x854A  #CJK UNIFIED IDEOGRAPH
+0x8EC8 0x7E1E  #CJK UNIFIED IDEOGRAPH
+0x8EC9 0x820E  #CJK UNIFIED IDEOGRAPH
+0x8ECA 0x5199  #CJK UNIFIED IDEOGRAPH
+0x8ECB 0x5C04  #CJK UNIFIED IDEOGRAPH
+0x8ECC 0x6368  #CJK UNIFIED IDEOGRAPH
+0x8ECD 0x8D66  #CJK UNIFIED IDEOGRAPH
+0x8ECE 0x659C  #CJK UNIFIED IDEOGRAPH
+0x8ECF 0x716E  #CJK UNIFIED IDEOGRAPH
+0x8ED0 0x793E  #CJK UNIFIED IDEOGRAPH
+0x8ED1 0x7D17  #CJK UNIFIED IDEOGRAPH
+0x8ED2 0x8005  #CJK UNIFIED IDEOGRAPH
+0x8ED3 0x8B1D  #CJK UNIFIED IDEOGRAPH
+0x8ED4 0x8ECA  #CJK UNIFIED IDEOGRAPH
+0x8ED5 0x906E  #CJK UNIFIED IDEOGRAPH
+0x8ED6 0x86C7  #CJK UNIFIED IDEOGRAPH
+0x8ED7 0x90AA  #CJK UNIFIED IDEOGRAPH
+0x8ED8 0x501F  #CJK UNIFIED IDEOGRAPH
+0x8ED9 0x52FA  #CJK UNIFIED IDEOGRAPH
+0x8EDA 0x5C3A  #CJK UNIFIED IDEOGRAPH
+0x8EDB 0x6753  #CJK UNIFIED IDEOGRAPH
+0x8EDC 0x707C  #CJK UNIFIED IDEOGRAPH
+0x8EDD 0x7235  #CJK UNIFIED IDEOGRAPH
+0x8EDE 0x914C  #CJK UNIFIED IDEOGRAPH
+0x8EDF 0x91C8  #CJK UNIFIED IDEOGRAPH
+0x8EE0 0x932B  #CJK UNIFIED IDEOGRAPH
+0x8EE1 0x82E5  #CJK UNIFIED IDEOGRAPH
+0x8EE2 0x5BC2  #CJK UNIFIED IDEOGRAPH
+0x8EE3 0x5F31  #CJK UNIFIED IDEOGRAPH
+0x8EE4 0x60F9  #CJK UNIFIED IDEOGRAPH
+0x8EE5 0x4E3B  #CJK UNIFIED IDEOGRAPH
+0x8EE6 0x53D6  #CJK UNIFIED IDEOGRAPH
+0x8EE7 0x5B88  #CJK UNIFIED IDEOGRAPH
+0x8EE8 0x624B  #CJK UNIFIED IDEOGRAPH
+0x8EE9 0x6731  #CJK UNIFIED IDEOGRAPH
+0x8EEA 0x6B8A  #CJK UNIFIED IDEOGRAPH
+0x8EEB 0x72E9  #CJK UNIFIED IDEOGRAPH
+0x8EEC 0x73E0  #CJK UNIFIED IDEOGRAPH
+0x8EED 0x7A2E  #CJK UNIFIED IDEOGRAPH
+0x8EEE 0x816B  #CJK UNIFIED IDEOGRAPH
+0x8EEF 0x8DA3  #CJK UNIFIED IDEOGRAPH
+0x8EF0 0x9152  #CJK UNIFIED IDEOGRAPH
+0x8EF1 0x9996  #CJK UNIFIED IDEOGRAPH
+0x8EF2 0x5112  #CJK UNIFIED IDEOGRAPH
+0x8EF3 0x53D7  #CJK UNIFIED IDEOGRAPH
+0x8EF4 0x546A  #CJK UNIFIED IDEOGRAPH
+0x8EF5 0x5BFF  #CJK UNIFIED IDEOGRAPH
+0x8EF6 0x6388  #CJK UNIFIED IDEOGRAPH
+0x8EF7 0x6A39  #CJK UNIFIED IDEOGRAPH
+0x8EF8 0x7DAC  #CJK UNIFIED IDEOGRAPH
+0x8EF9 0x9700  #CJK UNIFIED IDEOGRAPH
+0x8EFA 0x56DA  #CJK UNIFIED IDEOGRAPH
+0x8EFB 0x53CE  #CJK UNIFIED IDEOGRAPH
+0x8EFC 0x5468  #CJK UNIFIED IDEOGRAPH
+0x8F40 0x5B97  #CJK UNIFIED IDEOGRAPH
+0x8F41 0x5C31  #CJK UNIFIED IDEOGRAPH
+0x8F42 0x5DDE  #CJK UNIFIED IDEOGRAPH
+0x8F43 0x4FEE  #CJK UNIFIED IDEOGRAPH
+0x8F44 0x6101  #CJK UNIFIED IDEOGRAPH
+0x8F45 0x62FE  #CJK UNIFIED IDEOGRAPH
+0x8F46 0x6D32  #CJK UNIFIED IDEOGRAPH
+0x8F47 0x79C0  #CJK UNIFIED IDEOGRAPH
+0x8F48 0x79CB  #CJK UNIFIED IDEOGRAPH
+0x8F49 0x7D42  #CJK UNIFIED IDEOGRAPH
+0x8F4A 0x7E4D  #CJK UNIFIED IDEOGRAPH
+0x8F4B 0x7FD2  #CJK UNIFIED IDEOGRAPH
+0x8F4C 0x81ED  #CJK UNIFIED IDEOGRAPH
+0x8F4D 0x821F  #CJK UNIFIED IDEOGRAPH
+0x8F4E 0x8490  #CJK UNIFIED IDEOGRAPH
+0x8F4F 0x8846  #CJK UNIFIED IDEOGRAPH
+0x8F50 0x8972  #CJK UNIFIED IDEOGRAPH
+0x8F51 0x8B90  #CJK UNIFIED IDEOGRAPH
+0x8F52 0x8E74  #CJK UNIFIED IDEOGRAPH
+0x8F53 0x8F2F  #CJK UNIFIED IDEOGRAPH
+0x8F54 0x9031  #CJK UNIFIED IDEOGRAPH
+0x8F55 0x914B  #CJK UNIFIED IDEOGRAPH
+0x8F56 0x916C  #CJK UNIFIED IDEOGRAPH
+0x8F57 0x96C6  #CJK UNIFIED IDEOGRAPH
+0x8F58 0x919C  #CJK UNIFIED IDEOGRAPH
+0x8F59 0x4EC0  #CJK UNIFIED IDEOGRAPH
+0x8F5A 0x4F4F  #CJK UNIFIED IDEOGRAPH
+0x8F5B 0x5145  #CJK UNIFIED IDEOGRAPH
+0x8F5C 0x5341  #CJK UNIFIED IDEOGRAPH
+0x8F5D 0x5F93  #CJK UNIFIED IDEOGRAPH
+0x8F5E 0x620E  #CJK UNIFIED IDEOGRAPH
+0x8F5F 0x67D4  #CJK UNIFIED IDEOGRAPH
+0x8F60 0x6C41  #CJK UNIFIED IDEOGRAPH
+0x8F61 0x6E0B  #CJK UNIFIED IDEOGRAPH
+0x8F62 0x7363  #CJK UNIFIED IDEOGRAPH
+0x8F63 0x7E26  #CJK UNIFIED IDEOGRAPH
+0x8F64 0x91CD  #CJK UNIFIED IDEOGRAPH
+0x8F65 0x9283  #CJK UNIFIED IDEOGRAPH
+0x8F66 0x53D4  #CJK UNIFIED IDEOGRAPH
+0x8F67 0x5919  #CJK UNIFIED IDEOGRAPH
+0x8F68 0x5BBF  #CJK UNIFIED IDEOGRAPH
+0x8F69 0x6DD1  #CJK UNIFIED IDEOGRAPH
+0x8F6A 0x795D  #CJK UNIFIED IDEOGRAPH
+0x8F6B 0x7E2E  #CJK UNIFIED IDEOGRAPH
+0x8F6C 0x7C9B  #CJK UNIFIED IDEOGRAPH
+0x8F6D 0x587E  #CJK UNIFIED IDEOGRAPH
+0x8F6E 0x719F  #CJK UNIFIED IDEOGRAPH
+0x8F6F 0x51FA  #CJK UNIFIED IDEOGRAPH
+0x8F70 0x8853  #CJK UNIFIED IDEOGRAPH
+0x8F71 0x8FF0  #CJK UNIFIED IDEOGRAPH
+0x8F72 0x4FCA  #CJK UNIFIED IDEOGRAPH
+0x8F73 0x5CFB  #CJK UNIFIED IDEOGRAPH
+0x8F74 0x6625  #CJK UNIFIED IDEOGRAPH
+0x8F75 0x77AC  #CJK UNIFIED IDEOGRAPH
+0x8F76 0x7AE3  #CJK UNIFIED IDEOGRAPH
+0x8F77 0x821C  #CJK UNIFIED IDEOGRAPH
+0x8F78 0x99FF  #CJK UNIFIED IDEOGRAPH
+0x8F79 0x51C6  #CJK UNIFIED IDEOGRAPH
+0x8F7A 0x5FAA  #CJK UNIFIED IDEOGRAPH
+0x8F7B 0x65EC  #CJK UNIFIED IDEOGRAPH
+0x8F7C 0x696F  #CJK UNIFIED IDEOGRAPH
+0x8F7D 0x6B89  #CJK UNIFIED IDEOGRAPH
+0x8F7E 0x6DF3  #CJK UNIFIED IDEOGRAPH
+0x8F80 0x6E96  #CJK UNIFIED IDEOGRAPH
+0x8F81 0x6F64  #CJK UNIFIED IDEOGRAPH
+0x8F82 0x76FE  #CJK UNIFIED IDEOGRAPH
+0x8F83 0x7D14  #CJK UNIFIED IDEOGRAPH
+0x8F84 0x5DE1  #CJK UNIFIED IDEOGRAPH
+0x8F85 0x9075  #CJK UNIFIED IDEOGRAPH
+0x8F86 0x9187  #CJK UNIFIED IDEOGRAPH
+0x8F87 0x9806  #CJK UNIFIED IDEOGRAPH
+0x8F88 0x51E6  #CJK UNIFIED IDEOGRAPH
+0x8F89 0x521D  #CJK UNIFIED IDEOGRAPH
+0x8F8A 0x6240  #CJK UNIFIED IDEOGRAPH
+0x8F8B 0x6691  #CJK UNIFIED IDEOGRAPH
+0x8F8C 0x66D9  #CJK UNIFIED IDEOGRAPH
+0x8F8D 0x6E1A  #CJK UNIFIED IDEOGRAPH
+0x8F8E 0x5EB6  #CJK UNIFIED IDEOGRAPH
+0x8F8F 0x7DD2  #CJK UNIFIED IDEOGRAPH
+0x8F90 0x7F72  #CJK UNIFIED IDEOGRAPH
+0x8F91 0x66F8  #CJK UNIFIED IDEOGRAPH
+0x8F92 0x85AF  #CJK UNIFIED IDEOGRAPH
+0x8F93 0x85F7  #CJK UNIFIED IDEOGRAPH
+0x8F94 0x8AF8  #CJK UNIFIED IDEOGRAPH
+0x8F95 0x52A9  #CJK UNIFIED IDEOGRAPH
+0x8F96 0x53D9  #CJK UNIFIED IDEOGRAPH
+0x8F97 0x5973  #CJK UNIFIED IDEOGRAPH
+0x8F98 0x5E8F  #CJK UNIFIED IDEOGRAPH
+0x8F99 0x5F90  #CJK UNIFIED IDEOGRAPH
+0x8F9A 0x6055  #CJK UNIFIED IDEOGRAPH
+0x8F9B 0x92E4  #CJK UNIFIED IDEOGRAPH
+0x8F9C 0x9664  #CJK UNIFIED IDEOGRAPH
+0x8F9D 0x50B7  #CJK UNIFIED IDEOGRAPH
+0x8F9E 0x511F  #CJK UNIFIED IDEOGRAPH
+0x8F9F 0x52DD  #CJK UNIFIED IDEOGRAPH
+0x8FA0 0x5320  #CJK UNIFIED IDEOGRAPH
+0x8FA1 0x5347  #CJK UNIFIED IDEOGRAPH
+0x8FA2 0x53EC  #CJK UNIFIED IDEOGRAPH
+0x8FA3 0x54E8  #CJK UNIFIED IDEOGRAPH
+0x8FA4 0x5546  #CJK UNIFIED IDEOGRAPH
+0x8FA5 0x5531  #CJK UNIFIED IDEOGRAPH
+0x8FA6 0x5617  #CJK UNIFIED IDEOGRAPH
+0x8FA7 0x5968  #CJK UNIFIED IDEOGRAPH
+0x8FA8 0x59BE  #CJK UNIFIED IDEOGRAPH
+0x8FA9 0x5A3C  #CJK UNIFIED IDEOGRAPH
+0x8FAA 0x5BB5  #CJK UNIFIED IDEOGRAPH
+0x8FAB 0x5C06  #CJK UNIFIED IDEOGRAPH
+0x8FAC 0x5C0F  #CJK UNIFIED IDEOGRAPH
+0x8FAD 0x5C11  #CJK UNIFIED IDEOGRAPH
+0x8FAE 0x5C1A  #CJK UNIFIED IDEOGRAPH
+0x8FAF 0x5E84  #CJK UNIFIED IDEOGRAPH
+0x8FB0 0x5E8A  #CJK UNIFIED IDEOGRAPH
+0x8FB1 0x5EE0  #CJK UNIFIED IDEOGRAPH
+0x8FB2 0x5F70  #CJK UNIFIED IDEOGRAPH
+0x8FB3 0x627F  #CJK UNIFIED IDEOGRAPH
+0x8FB4 0x6284  #CJK UNIFIED IDEOGRAPH
+0x8FB5 0x62DB  #CJK UNIFIED IDEOGRAPH
+0x8FB6 0x638C  #CJK UNIFIED IDEOGRAPH
+0x8FB7 0x6377  #CJK UNIFIED IDEOGRAPH
+0x8FB8 0x6607  #CJK UNIFIED IDEOGRAPH
+0x8FB9 0x660C  #CJK UNIFIED IDEOGRAPH
+0x8FBA 0x662D  #CJK UNIFIED IDEOGRAPH
+0x8FBB 0x6676  #CJK UNIFIED IDEOGRAPH
+0x8FBC 0x677E  #CJK UNIFIED IDEOGRAPH
+0x8FBD 0x68A2  #CJK UNIFIED IDEOGRAPH
+0x8FBE 0x6A1F  #CJK UNIFIED IDEOGRAPH
+0x8FBF 0x6A35  #CJK UNIFIED IDEOGRAPH
+0x8FC0 0x6CBC  #CJK UNIFIED IDEOGRAPH
+0x8FC1 0x6D88  #CJK UNIFIED IDEOGRAPH
+0x8FC2 0x6E09  #CJK UNIFIED IDEOGRAPH
+0x8FC3 0x6E58  #CJK UNIFIED IDEOGRAPH
+0x8FC4 0x713C  #CJK UNIFIED IDEOGRAPH
+0x8FC5 0x7126  #CJK UNIFIED IDEOGRAPH
+0x8FC6 0x7167  #CJK UNIFIED IDEOGRAPH
+0x8FC7 0x75C7  #CJK UNIFIED IDEOGRAPH
+0x8FC8 0x7701  #CJK UNIFIED IDEOGRAPH
+0x8FC9 0x785D  #CJK UNIFIED IDEOGRAPH
+0x8FCA 0x7901  #CJK UNIFIED IDEOGRAPH
+0x8FCB 0x7965  #CJK UNIFIED IDEOGRAPH
+0x8FCC 0x79F0  #CJK UNIFIED IDEOGRAPH
+0x8FCD 0x7AE0  #CJK UNIFIED IDEOGRAPH
+0x8FCE 0x7B11  #CJK UNIFIED IDEOGRAPH
+0x8FCF 0x7CA7  #CJK UNIFIED IDEOGRAPH
+0x8FD0 0x7D39  #CJK UNIFIED IDEOGRAPH
+0x8FD1 0x8096  #CJK UNIFIED IDEOGRAPH
+0x8FD2 0x83D6  #CJK UNIFIED IDEOGRAPH
+0x8FD3 0x848B  #CJK UNIFIED IDEOGRAPH
+0x8FD4 0x8549  #CJK UNIFIED IDEOGRAPH
+0x8FD5 0x885D  #CJK UNIFIED IDEOGRAPH
+0x8FD6 0x88F3  #CJK UNIFIED IDEOGRAPH
+0x8FD7 0x8A1F  #CJK UNIFIED IDEOGRAPH
+0x8FD8 0x8A3C  #CJK UNIFIED IDEOGRAPH
+0x8FD9 0x8A54  #CJK UNIFIED IDEOGRAPH
+0x8FDA 0x8A73  #CJK UNIFIED IDEOGRAPH
+0x8FDB 0x8C61  #CJK UNIFIED IDEOGRAPH
+0x8FDC 0x8CDE  #CJK UNIFIED IDEOGRAPH
+0x8FDD 0x91A4  #CJK UNIFIED IDEOGRAPH
+0x8FDE 0x9266  #CJK UNIFIED IDEOGRAPH
+0x8FDF 0x937E  #CJK UNIFIED IDEOGRAPH
+0x8FE0 0x9418  #CJK UNIFIED IDEOGRAPH
+0x8FE1 0x969C  #CJK UNIFIED IDEOGRAPH
+0x8FE2 0x9798  #CJK UNIFIED IDEOGRAPH
+0x8FE3 0x4E0A  #CJK UNIFIED IDEOGRAPH
+0x8FE4 0x4E08  #CJK UNIFIED IDEOGRAPH
+0x8FE5 0x4E1E  #CJK UNIFIED IDEOGRAPH
+0x8FE6 0x4E57  #CJK UNIFIED IDEOGRAPH
+0x8FE7 0x5197  #CJK UNIFIED IDEOGRAPH
+0x8FE8 0x5270  #CJK UNIFIED IDEOGRAPH
+0x8FE9 0x57CE  #CJK UNIFIED IDEOGRAPH
+0x8FEA 0x5834  #CJK UNIFIED IDEOGRAPH
+0x8FEB 0x58CC  #CJK UNIFIED IDEOGRAPH
+0x8FEC 0x5B22  #CJK UNIFIED IDEOGRAPH
+0x8FED 0x5E38  #CJK UNIFIED IDEOGRAPH
+0x8FEE 0x60C5  #CJK UNIFIED IDEOGRAPH
+0x8FEF 0x64FE  #CJK UNIFIED IDEOGRAPH
+0x8FF0 0x6761  #CJK UNIFIED IDEOGRAPH
+0x8FF1 0x6756  #CJK UNIFIED IDEOGRAPH
+0x8FF2 0x6D44  #CJK UNIFIED IDEOGRAPH
+0x8FF3 0x72B6  #CJK UNIFIED IDEOGRAPH
+0x8FF4 0x7573  #CJK UNIFIED IDEOGRAPH
+0x8FF5 0x7A63  #CJK UNIFIED IDEOGRAPH
+0x8FF6 0x84B8  #CJK UNIFIED IDEOGRAPH
+0x8FF7 0x8B72  #CJK UNIFIED IDEOGRAPH
+0x8FF8 0x91B8  #CJK UNIFIED IDEOGRAPH
+0x8FF9 0x9320  #CJK UNIFIED IDEOGRAPH
+0x8FFA 0x5631  #CJK UNIFIED IDEOGRAPH
+0x8FFB 0x57F4  #CJK UNIFIED IDEOGRAPH
+0x8FFC 0x98FE  #CJK UNIFIED IDEOGRAPH
+0x9040 0x62ED  #CJK UNIFIED IDEOGRAPH
+0x9041 0x690D  #CJK UNIFIED IDEOGRAPH
+0x9042 0x6B96  #CJK UNIFIED IDEOGRAPH
+0x9043 0x71ED  #CJK UNIFIED IDEOGRAPH
+0x9044 0x7E54  #CJK UNIFIED IDEOGRAPH
+0x9045 0x8077  #CJK UNIFIED IDEOGRAPH
+0x9046 0x8272  #CJK UNIFIED IDEOGRAPH
+0x9047 0x89E6  #CJK UNIFIED IDEOGRAPH
+0x9048 0x98DF  #CJK UNIFIED IDEOGRAPH
+0x9049 0x8755  #CJK UNIFIED IDEOGRAPH
+0x904A 0x8FB1  #CJK UNIFIED IDEOGRAPH
+0x904B 0x5C3B  #CJK UNIFIED IDEOGRAPH
+0x904C 0x4F38  #CJK UNIFIED IDEOGRAPH
+0x904D 0x4FE1  #CJK UNIFIED IDEOGRAPH
+0x904E 0x4FB5  #CJK UNIFIED IDEOGRAPH
+0x904F 0x5507  #CJK UNIFIED IDEOGRAPH
+0x9050 0x5A20  #CJK UNIFIED IDEOGRAPH
+0x9051 0x5BDD  #CJK UNIFIED IDEOGRAPH
+0x9052 0x5BE9  #CJK UNIFIED IDEOGRAPH
+0x9053 0x5FC3  #CJK UNIFIED IDEOGRAPH
+0x9054 0x614E  #CJK UNIFIED IDEOGRAPH
+0x9055 0x632F  #CJK UNIFIED IDEOGRAPH
+0x9056 0x65B0  #CJK UNIFIED IDEOGRAPH
+0x9057 0x664B  #CJK UNIFIED IDEOGRAPH
+0x9058 0x68EE  #CJK UNIFIED IDEOGRAPH
+0x9059 0x699B  #CJK UNIFIED IDEOGRAPH
+0x905A 0x6D78  #CJK UNIFIED IDEOGRAPH
+0x905B 0x6DF1  #CJK UNIFIED IDEOGRAPH
+0x905C 0x7533  #CJK UNIFIED IDEOGRAPH
+0x905D 0x75B9  #CJK UNIFIED IDEOGRAPH
+0x905E 0x771F  #CJK UNIFIED IDEOGRAPH
+0x905F 0x795E  #CJK UNIFIED IDEOGRAPH
+0x9060 0x79E6  #CJK UNIFIED IDEOGRAPH
+0x9061 0x7D33  #CJK UNIFIED IDEOGRAPH
+0x9062 0x81E3  #CJK UNIFIED IDEOGRAPH
+0x9063 0x82AF  #CJK UNIFIED IDEOGRAPH
+0x9064 0x85AA  #CJK UNIFIED IDEOGRAPH
+0x9065 0x89AA  #CJK UNIFIED IDEOGRAPH
+0x9066 0x8A3A  #CJK UNIFIED IDEOGRAPH
+0x9067 0x8EAB  #CJK UNIFIED IDEOGRAPH
+0x9068 0x8F9B  #CJK UNIFIED IDEOGRAPH
+0x9069 0x9032  #CJK UNIFIED IDEOGRAPH
+0x906A 0x91DD  #CJK UNIFIED IDEOGRAPH
+0x906B 0x9707  #CJK UNIFIED IDEOGRAPH
+0x906C 0x4EBA  #CJK UNIFIED IDEOGRAPH
+0x906D 0x4EC1  #CJK UNIFIED IDEOGRAPH
+0x906E 0x5203  #CJK UNIFIED IDEOGRAPH
+0x906F 0x5875  #CJK UNIFIED IDEOGRAPH
+0x9070 0x58EC  #CJK UNIFIED IDEOGRAPH
+0x9071 0x5C0B  #CJK UNIFIED IDEOGRAPH
+0x9072 0x751A  #CJK UNIFIED IDEOGRAPH
+0x9073 0x5C3D  #CJK UNIFIED IDEOGRAPH
+0x9074 0x814E  #CJK UNIFIED IDEOGRAPH
+0x9075 0x8A0A  #CJK UNIFIED IDEOGRAPH
+0x9076 0x8FC5  #CJK UNIFIED IDEOGRAPH
+0x9077 0x9663  #CJK UNIFIED IDEOGRAPH
+0x9078 0x976D  #CJK UNIFIED IDEOGRAPH
+0x9079 0x7B25  #CJK UNIFIED IDEOGRAPH
+0x907A 0x8ACF  #CJK UNIFIED IDEOGRAPH
+0x907B 0x9808  #CJK UNIFIED IDEOGRAPH
+0x907C 0x9162  #CJK UNIFIED IDEOGRAPH
+0x907D 0x56F3  #CJK UNIFIED IDEOGRAPH
+0x907E 0x53A8  #CJK UNIFIED IDEOGRAPH
+0x9080 0x9017  #CJK UNIFIED IDEOGRAPH
+0x9081 0x5439  #CJK UNIFIED IDEOGRAPH
+0x9082 0x5782  #CJK UNIFIED IDEOGRAPH
+0x9083 0x5E25  #CJK UNIFIED IDEOGRAPH
+0x9084 0x63A8  #CJK UNIFIED IDEOGRAPH
+0x9085 0x6C34  #CJK UNIFIED IDEOGRAPH
+0x9086 0x708A  #CJK UNIFIED IDEOGRAPH
+0x9087 0x7761  #CJK UNIFIED IDEOGRAPH
+0x9088 0x7C8B  #CJK UNIFIED IDEOGRAPH
+0x9089 0x7FE0  #CJK UNIFIED IDEOGRAPH
+0x908A 0x8870  #CJK UNIFIED IDEOGRAPH
+0x908B 0x9042  #CJK UNIFIED IDEOGRAPH
+0x908C 0x9154  #CJK UNIFIED IDEOGRAPH
+0x908D 0x9310  #CJK UNIFIED IDEOGRAPH
+0x908E 0x9318  #CJK UNIFIED IDEOGRAPH
+0x908F 0x968F  #CJK UNIFIED IDEOGRAPH
+0x9090 0x745E  #CJK UNIFIED IDEOGRAPH
+0x9091 0x9AC4  #CJK UNIFIED IDEOGRAPH
+0x9092 0x5D07  #CJK UNIFIED IDEOGRAPH
+0x9093 0x5D69  #CJK UNIFIED IDEOGRAPH
+0x9094 0x6570  #CJK UNIFIED IDEOGRAPH
+0x9095 0x67A2  #CJK UNIFIED IDEOGRAPH
+0x9096 0x8DA8  #CJK UNIFIED IDEOGRAPH
+0x9097 0x96DB  #CJK UNIFIED IDEOGRAPH
+0x9098 0x636E  #CJK UNIFIED IDEOGRAPH
+0x9099 0x6749  #CJK UNIFIED IDEOGRAPH
+0x909A 0x6919  #CJK UNIFIED IDEOGRAPH
+0x909B 0x83C5  #CJK UNIFIED IDEOGRAPH
+0x909C 0x9817  #CJK UNIFIED IDEOGRAPH
+0x909D 0x96C0  #CJK UNIFIED IDEOGRAPH
+0x909E 0x88FE  #CJK UNIFIED IDEOGRAPH
+0x909F 0x6F84  #CJK UNIFIED IDEOGRAPH
+0x90A0 0x647A  #CJK UNIFIED IDEOGRAPH
+0x90A1 0x5BF8  #CJK UNIFIED IDEOGRAPH
+0x90A2 0x4E16  #CJK UNIFIED IDEOGRAPH
+0x90A3 0x702C  #CJK UNIFIED IDEOGRAPH
+0x90A4 0x755D  #CJK UNIFIED IDEOGRAPH
+0x90A5 0x662F  #CJK UNIFIED IDEOGRAPH
+0x90A6 0x51C4  #CJK UNIFIED IDEOGRAPH
+0x90A7 0x5236  #CJK UNIFIED IDEOGRAPH
+0x90A8 0x52E2  #CJK UNIFIED IDEOGRAPH
+0x90A9 0x59D3  #CJK UNIFIED IDEOGRAPH
+0x90AA 0x5F81  #CJK UNIFIED IDEOGRAPH
+0x90AB 0x6027  #CJK UNIFIED IDEOGRAPH
+0x90AC 0x6210  #CJK UNIFIED IDEOGRAPH
+0x90AD 0x653F  #CJK UNIFIED IDEOGRAPH
+0x90AE 0x6574  #CJK UNIFIED IDEOGRAPH
+0x90AF 0x661F  #CJK UNIFIED IDEOGRAPH
+0x90B0 0x6674  #CJK UNIFIED IDEOGRAPH
+0x90B1 0x68F2  #CJK UNIFIED IDEOGRAPH
+0x90B2 0x6816  #CJK UNIFIED IDEOGRAPH
+0x90B3 0x6B63  #CJK UNIFIED IDEOGRAPH
+0x90B4 0x6E05  #CJK UNIFIED IDEOGRAPH
+0x90B5 0x7272  #CJK UNIFIED IDEOGRAPH
+0x90B6 0x751F  #CJK UNIFIED IDEOGRAPH
+0x90B7 0x76DB  #CJK UNIFIED IDEOGRAPH
+0x90B8 0x7CBE  #CJK UNIFIED IDEOGRAPH
+0x90B9 0x8056  #CJK UNIFIED IDEOGRAPH
+0x90BA 0x58F0  #CJK UNIFIED IDEOGRAPH
+0x90BB 0x88FD  #CJK UNIFIED IDEOGRAPH
+0x90BC 0x897F  #CJK UNIFIED IDEOGRAPH
+0x90BD 0x8AA0  #CJK UNIFIED IDEOGRAPH
+0x90BE 0x8A93  #CJK UNIFIED IDEOGRAPH
+0x90BF 0x8ACB  #CJK UNIFIED IDEOGRAPH
+0x90C0 0x901D  #CJK UNIFIED IDEOGRAPH
+0x90C1 0x9192  #CJK UNIFIED IDEOGRAPH
+0x90C2 0x9752  #CJK UNIFIED IDEOGRAPH
+0x90C3 0x9759  #CJK UNIFIED IDEOGRAPH
+0x90C4 0x6589  #CJK UNIFIED IDEOGRAPH
+0x90C5 0x7A0E  #CJK UNIFIED IDEOGRAPH
+0x90C6 0x8106  #CJK UNIFIED IDEOGRAPH
+0x90C7 0x96BB  #CJK UNIFIED IDEOGRAPH
+0x90C8 0x5E2D  #CJK UNIFIED IDEOGRAPH
+0x90C9 0x60DC  #CJK UNIFIED IDEOGRAPH
+0x90CA 0x621A  #CJK UNIFIED IDEOGRAPH
+0x90CB 0x65A5  #CJK UNIFIED IDEOGRAPH
+0x90CC 0x6614  #CJK UNIFIED IDEOGRAPH
+0x90CD 0x6790  #CJK UNIFIED IDEOGRAPH
+0x90CE 0x77F3  #CJK UNIFIED IDEOGRAPH
+0x90CF 0x7A4D  #CJK UNIFIED IDEOGRAPH
+0x90D0 0x7C4D  #CJK UNIFIED IDEOGRAPH
+0x90D1 0x7E3E  #CJK UNIFIED IDEOGRAPH
+0x90D2 0x810A  #CJK UNIFIED IDEOGRAPH
+0x90D3 0x8CAC  #CJK UNIFIED IDEOGRAPH
+0x90D4 0x8D64  #CJK UNIFIED IDEOGRAPH
+0x90D5 0x8DE1  #CJK UNIFIED IDEOGRAPH
+0x90D6 0x8E5F  #CJK UNIFIED IDEOGRAPH
+0x90D7 0x78A9  #CJK UNIFIED IDEOGRAPH
+0x90D8 0x5207  #CJK UNIFIED IDEOGRAPH
+0x90D9 0x62D9  #CJK UNIFIED IDEOGRAPH
+0x90DA 0x63A5  #CJK UNIFIED IDEOGRAPH
+0x90DB 0x6442  #CJK UNIFIED IDEOGRAPH
+0x90DC 0x6298  #CJK UNIFIED IDEOGRAPH
+0x90DD 0x8A2D  #CJK UNIFIED IDEOGRAPH
+0x90DE 0x7A83  #CJK UNIFIED IDEOGRAPH
+0x90DF 0x7BC0  #CJK UNIFIED IDEOGRAPH
+0x90E0 0x8AAC  #CJK UNIFIED IDEOGRAPH
+0x90E1 0x96EA  #CJK UNIFIED IDEOGRAPH
+0x90E2 0x7D76  #CJK UNIFIED IDEOGRAPH
+0x90E3 0x820C  #CJK UNIFIED IDEOGRAPH
+0x90E4 0x8749  #CJK UNIFIED IDEOGRAPH
+0x90E5 0x4ED9  #CJK UNIFIED IDEOGRAPH
+0x90E6 0x5148  #CJK UNIFIED IDEOGRAPH
+0x90E7 0x5343  #CJK UNIFIED IDEOGRAPH
+0x90E8 0x5360  #CJK UNIFIED IDEOGRAPH
+0x90E9 0x5BA3  #CJK UNIFIED IDEOGRAPH
+0x90EA 0x5C02  #CJK UNIFIED IDEOGRAPH
+0x90EB 0x5C16  #CJK UNIFIED IDEOGRAPH
+0x90EC 0x5DDD  #CJK UNIFIED IDEOGRAPH
+0x90ED 0x6226  #CJK UNIFIED IDEOGRAPH
+0x90EE 0x6247  #CJK UNIFIED IDEOGRAPH
+0x90EF 0x64B0  #CJK UNIFIED IDEOGRAPH
+0x90F0 0x6813  #CJK UNIFIED IDEOGRAPH
+0x90F1 0x6834  #CJK UNIFIED IDEOGRAPH
+0x90F2 0x6CC9  #CJK UNIFIED IDEOGRAPH
+0x90F3 0x6D45  #CJK UNIFIED IDEOGRAPH
+0x90F4 0x6D17  #CJK UNIFIED IDEOGRAPH
+0x90F5 0x67D3  #CJK UNIFIED IDEOGRAPH
+0x90F6 0x6F5C  #CJK UNIFIED IDEOGRAPH
+0x90F7 0x714E  #CJK UNIFIED IDEOGRAPH
+0x90F8 0x717D  #CJK UNIFIED IDEOGRAPH
+0x90F9 0x65CB  #CJK UNIFIED IDEOGRAPH
+0x90FA 0x7A7F  #CJK UNIFIED IDEOGRAPH
+0x90FB 0x7BAD  #CJK UNIFIED IDEOGRAPH
+0x90FC 0x7DDA  #CJK UNIFIED IDEOGRAPH
+0x9140 0x7E4A  #CJK UNIFIED IDEOGRAPH
+0x9141 0x7FA8  #CJK UNIFIED IDEOGRAPH
+0x9142 0x817A  #CJK UNIFIED IDEOGRAPH
+0x9143 0x821B  #CJK UNIFIED IDEOGRAPH
+0x9144 0x8239  #CJK UNIFIED IDEOGRAPH
+0x9145 0x85A6  #CJK UNIFIED IDEOGRAPH
+0x9146 0x8A6E  #CJK UNIFIED IDEOGRAPH
+0x9147 0x8CCE  #CJK UNIFIED IDEOGRAPH
+0x9148 0x8DF5  #CJK UNIFIED IDEOGRAPH
+0x9149 0x9078  #CJK UNIFIED IDEOGRAPH
+0x914A 0x9077  #CJK UNIFIED IDEOGRAPH
+0x914B 0x92AD  #CJK UNIFIED IDEOGRAPH
+0x914C 0x9291  #CJK UNIFIED IDEOGRAPH
+0x914D 0x9583  #CJK UNIFIED IDEOGRAPH
+0x914E 0x9BAE  #CJK UNIFIED IDEOGRAPH
+0x914F 0x524D  #CJK UNIFIED IDEOGRAPH
+0x9150 0x5584  #CJK UNIFIED IDEOGRAPH
+0x9151 0x6F38  #CJK UNIFIED IDEOGRAPH
+0x9152 0x7136  #CJK UNIFIED IDEOGRAPH
+0x9153 0x5168  #CJK UNIFIED IDEOGRAPH
+0x9154 0x7985  #CJK UNIFIED IDEOGRAPH
+0x9155 0x7E55  #CJK UNIFIED IDEOGRAPH
+0x9156 0x81B3  #CJK UNIFIED IDEOGRAPH
+0x9157 0x7CCE  #CJK UNIFIED IDEOGRAPH
+0x9158 0x564C  #CJK UNIFIED IDEOGRAPH
+0x9159 0x5851  #CJK UNIFIED IDEOGRAPH
+0x915A 0x5CA8  #CJK UNIFIED IDEOGRAPH
+0x915B 0x63AA  #CJK UNIFIED IDEOGRAPH
+0x915C 0x66FE  #CJK UNIFIED IDEOGRAPH
+0x915D 0x66FD  #CJK UNIFIED IDEOGRAPH
+0x915E 0x695A  #CJK UNIFIED IDEOGRAPH
+0x915F 0x72D9  #CJK UNIFIED IDEOGRAPH
+0x9160 0x758F  #CJK UNIFIED IDEOGRAPH
+0x9161 0x758E  #CJK UNIFIED IDEOGRAPH
+0x9162 0x790E  #CJK UNIFIED IDEOGRAPH
+0x9163 0x7956  #CJK UNIFIED IDEOGRAPH
+0x9164 0x79DF  #CJK UNIFIED IDEOGRAPH
+0x9165 0x7C97  #CJK UNIFIED IDEOGRAPH
+0x9166 0x7D20  #CJK UNIFIED IDEOGRAPH
+0x9167 0x7D44  #CJK UNIFIED IDEOGRAPH
+0x9168 0x8607  #CJK UNIFIED IDEOGRAPH
+0x9169 0x8A34  #CJK UNIFIED IDEOGRAPH
+0x916A 0x963B  #CJK UNIFIED IDEOGRAPH
+0x916B 0x9061  #CJK UNIFIED IDEOGRAPH
+0x916C 0x9F20  #CJK UNIFIED IDEOGRAPH
+0x916D 0x50E7  #CJK UNIFIED IDEOGRAPH
+0x916E 0x5275  #CJK UNIFIED IDEOGRAPH
+0x916F 0x53CC  #CJK UNIFIED IDEOGRAPH
+0x9170 0x53E2  #CJK UNIFIED IDEOGRAPH
+0x9171 0x5009  #CJK UNIFIED IDEOGRAPH
+0x9172 0x55AA  #CJK UNIFIED IDEOGRAPH
+0x9173 0x58EE  #CJK UNIFIED IDEOGRAPH
+0x9174 0x594F  #CJK UNIFIED IDEOGRAPH
+0x9175 0x723D  #CJK UNIFIED IDEOGRAPH
+0x9176 0x5B8B  #CJK UNIFIED IDEOGRAPH
+0x9177 0x5C64  #CJK UNIFIED IDEOGRAPH
+0x9178 0x531D  #CJK UNIFIED IDEOGRAPH
+0x9179 0x60E3  #CJK UNIFIED IDEOGRAPH
+0x917A 0x60F3  #CJK UNIFIED IDEOGRAPH
+0x917B 0x635C  #CJK UNIFIED IDEOGRAPH
+0x917C 0x6383  #CJK UNIFIED IDEOGRAPH
+0x917D 0x633F  #CJK UNIFIED IDEOGRAPH
+0x917E 0x63BB  #CJK UNIFIED IDEOGRAPH
+0x9180 0x64CD  #CJK UNIFIED IDEOGRAPH
+0x9181 0x65E9  #CJK UNIFIED IDEOGRAPH
+0x9182 0x66F9  #CJK UNIFIED IDEOGRAPH
+0x9183 0x5DE3  #CJK UNIFIED IDEOGRAPH
+0x9184 0x69CD  #CJK UNIFIED IDEOGRAPH
+0x9185 0x69FD  #CJK UNIFIED IDEOGRAPH
+0x9186 0x6F15  #CJK UNIFIED IDEOGRAPH
+0x9187 0x71E5  #CJK UNIFIED IDEOGRAPH
+0x9188 0x4E89  #CJK UNIFIED IDEOGRAPH
+0x9189 0x75E9  #CJK UNIFIED IDEOGRAPH
+0x918A 0x76F8  #CJK UNIFIED IDEOGRAPH
+0x918B 0x7A93  #CJK UNIFIED IDEOGRAPH
+0x918C 0x7CDF  #CJK UNIFIED IDEOGRAPH
+0x918D 0x7DCF  #CJK UNIFIED IDEOGRAPH
+0x918E 0x7D9C  #CJK UNIFIED IDEOGRAPH
+0x918F 0x8061  #CJK UNIFIED IDEOGRAPH
+0x9190 0x8349  #CJK UNIFIED IDEOGRAPH
+0x9191 0x8358  #CJK UNIFIED IDEOGRAPH
+0x9192 0x846C  #CJK UNIFIED IDEOGRAPH
+0x9193 0x84BC  #CJK UNIFIED IDEOGRAPH
+0x9194 0x85FB  #CJK UNIFIED IDEOGRAPH
+0x9195 0x88C5  #CJK UNIFIED IDEOGRAPH
+0x9196 0x8D70  #CJK UNIFIED IDEOGRAPH
+0x9197 0x9001  #CJK UNIFIED IDEOGRAPH
+0x9198 0x906D  #CJK UNIFIED IDEOGRAPH
+0x9199 0x9397  #CJK UNIFIED IDEOGRAPH
+0x919A 0x971C  #CJK UNIFIED IDEOGRAPH
+0x919B 0x9A12  #CJK UNIFIED IDEOGRAPH
+0x919C 0x50CF  #CJK UNIFIED IDEOGRAPH
+0x919D 0x5897  #CJK UNIFIED IDEOGRAPH
+0x919E 0x618E  #CJK UNIFIED IDEOGRAPH
+0x919F 0x81D3  #CJK UNIFIED IDEOGRAPH
+0x91A0 0x8535  #CJK UNIFIED IDEOGRAPH
+0x91A1 0x8D08  #CJK UNIFIED IDEOGRAPH
+0x91A2 0x9020  #CJK UNIFIED IDEOGRAPH
+0x91A3 0x4FC3  #CJK UNIFIED IDEOGRAPH
+0x91A4 0x5074  #CJK UNIFIED IDEOGRAPH
+0x91A5 0x5247  #CJK UNIFIED IDEOGRAPH
+0x91A6 0x5373  #CJK UNIFIED IDEOGRAPH
+0x91A7 0x606F  #CJK UNIFIED IDEOGRAPH
+0x91A8 0x6349  #CJK UNIFIED IDEOGRAPH
+0x91A9 0x675F  #CJK UNIFIED IDEOGRAPH
+0x91AA 0x6E2C  #CJK UNIFIED IDEOGRAPH
+0x91AB 0x8DB3  #CJK UNIFIED IDEOGRAPH
+0x91AC 0x901F  #CJK UNIFIED IDEOGRAPH
+0x91AD 0x4FD7  #CJK UNIFIED IDEOGRAPH
+0x91AE 0x5C5E  #CJK UNIFIED IDEOGRAPH
+0x91AF 0x8CCA  #CJK UNIFIED IDEOGRAPH
+0x91B0 0x65CF  #CJK UNIFIED IDEOGRAPH
+0x91B1 0x7D9A  #CJK UNIFIED IDEOGRAPH
+0x91B2 0x5352  #CJK UNIFIED IDEOGRAPH
+0x91B3 0x8896  #CJK UNIFIED IDEOGRAPH
+0x91B4 0x5176  #CJK UNIFIED IDEOGRAPH
+0x91B5 0x63C3  #CJK UNIFIED IDEOGRAPH
+0x91B6 0x5B58  #CJK UNIFIED IDEOGRAPH
+0x91B7 0x5B6B  #CJK UNIFIED IDEOGRAPH
+0x91B8 0x5C0A  #CJK UNIFIED IDEOGRAPH
+0x91B9 0x640D  #CJK UNIFIED IDEOGRAPH
+0x91BA 0x6751  #CJK UNIFIED IDEOGRAPH
+0x91BB 0x905C  #CJK UNIFIED IDEOGRAPH
+0x91BC 0x4ED6  #CJK UNIFIED IDEOGRAPH
+0x91BD 0x591A  #CJK UNIFIED IDEOGRAPH
+0x91BE 0x592A  #CJK UNIFIED IDEOGRAPH
+0x91BF 0x6C70  #CJK UNIFIED IDEOGRAPH
+0x91C0 0x8A51  #CJK UNIFIED IDEOGRAPH
+0x91C1 0x553E  #CJK UNIFIED IDEOGRAPH
+0x91C2 0x5815  #CJK UNIFIED IDEOGRAPH
+0x91C3 0x59A5  #CJK UNIFIED IDEOGRAPH
+0x91C4 0x60F0  #CJK UNIFIED IDEOGRAPH
+0x91C5 0x6253  #CJK UNIFIED IDEOGRAPH
+0x91C6 0x67C1  #CJK UNIFIED IDEOGRAPH
+0x91C7 0x8235  #CJK UNIFIED IDEOGRAPH
+0x91C8 0x6955  #CJK UNIFIED IDEOGRAPH
+0x91C9 0x9640  #CJK UNIFIED IDEOGRAPH
+0x91CA 0x99C4  #CJK UNIFIED IDEOGRAPH
+0x91CB 0x9A28  #CJK UNIFIED IDEOGRAPH
+0x91CC 0x4F53  #CJK UNIFIED IDEOGRAPH
+0x91CD 0x5806  #CJK UNIFIED IDEOGRAPH
+0x91CE 0x5BFE  #CJK UNIFIED IDEOGRAPH
+0x91CF 0x8010  #CJK UNIFIED IDEOGRAPH
+0x91D0 0x5CB1  #CJK UNIFIED IDEOGRAPH
+0x91D1 0x5E2F  #CJK UNIFIED IDEOGRAPH
+0x91D2 0x5F85  #CJK UNIFIED IDEOGRAPH
+0x91D3 0x6020  #CJK UNIFIED IDEOGRAPH
+0x91D4 0x614B  #CJK UNIFIED IDEOGRAPH
+0x91D5 0x6234  #CJK UNIFIED IDEOGRAPH
+0x91D6 0x66FF  #CJK UNIFIED IDEOGRAPH
+0x91D7 0x6CF0  #CJK UNIFIED IDEOGRAPH
+0x91D8 0x6EDE  #CJK UNIFIED IDEOGRAPH
+0x91D9 0x80CE  #CJK UNIFIED IDEOGRAPH
+0x91DA 0x817F  #CJK UNIFIED IDEOGRAPH
+0x91DB 0x82D4  #CJK UNIFIED IDEOGRAPH
+0x91DC 0x888B  #CJK UNIFIED IDEOGRAPH
+0x91DD 0x8CB8  #CJK UNIFIED IDEOGRAPH
+0x91DE 0x9000  #CJK UNIFIED IDEOGRAPH
+0x91DF 0x902E  #CJK UNIFIED IDEOGRAPH
+0x91E0 0x968A  #CJK UNIFIED IDEOGRAPH
+0x91E1 0x9EDB  #CJK UNIFIED IDEOGRAPH
+0x91E2 0x9BDB  #CJK UNIFIED IDEOGRAPH
+0x91E3 0x4EE3  #CJK UNIFIED IDEOGRAPH
+0x91E4 0x53F0  #CJK UNIFIED IDEOGRAPH
+0x91E5 0x5927  #CJK UNIFIED IDEOGRAPH
+0x91E6 0x7B2C  #CJK UNIFIED IDEOGRAPH
+0x91E7 0x918D  #CJK UNIFIED IDEOGRAPH
+0x91E8 0x984C  #CJK UNIFIED IDEOGRAPH
+0x91E9 0x9DF9  #CJK UNIFIED IDEOGRAPH
+0x91EA 0x6EDD  #CJK UNIFIED IDEOGRAPH
+0x91EB 0x7027  #CJK UNIFIED IDEOGRAPH
+0x91EC 0x5353  #CJK UNIFIED IDEOGRAPH
+0x91ED 0x5544  #CJK UNIFIED IDEOGRAPH
+0x91EE 0x5B85  #CJK UNIFIED IDEOGRAPH
+0x91EF 0x6258  #CJK UNIFIED IDEOGRAPH
+0x91F0 0x629E  #CJK UNIFIED IDEOGRAPH
+0x91F1 0x62D3  #CJK UNIFIED IDEOGRAPH
+0x91F2 0x6CA2  #CJK UNIFIED IDEOGRAPH
+0x91F3 0x6FEF  #CJK UNIFIED IDEOGRAPH
+0x91F4 0x7422  #CJK UNIFIED IDEOGRAPH
+0x91F5 0x8A17  #CJK UNIFIED IDEOGRAPH
+0x91F6 0x9438  #CJK UNIFIED IDEOGRAPH
+0x91F7 0x6FC1  #CJK UNIFIED IDEOGRAPH
+0x91F8 0x8AFE  #CJK UNIFIED IDEOGRAPH
+0x91F9 0x8338  #CJK UNIFIED IDEOGRAPH
+0x91FA 0x51E7  #CJK UNIFIED IDEOGRAPH
+0x91FB 0x86F8  #CJK UNIFIED IDEOGRAPH
+0x91FC 0x53EA  #CJK UNIFIED IDEOGRAPH
+0x9240 0x53E9  #CJK UNIFIED IDEOGRAPH
+0x9241 0x4F46  #CJK UNIFIED IDEOGRAPH
+0x9242 0x9054  #CJK UNIFIED IDEOGRAPH
+0x9243 0x8FB0  #CJK UNIFIED IDEOGRAPH
+0x9244 0x596A  #CJK UNIFIED IDEOGRAPH
+0x9245 0x8131  #CJK UNIFIED IDEOGRAPH
+0x9246 0x5DFD  #CJK UNIFIED IDEOGRAPH
+0x9247 0x7AEA  #CJK UNIFIED IDEOGRAPH
+0x9248 0x8FBF  #CJK UNIFIED IDEOGRAPH
+0x9249 0x68DA  #CJK UNIFIED IDEOGRAPH
+0x924A 0x8C37  #CJK UNIFIED IDEOGRAPH
+0x924B 0x72F8  #CJK UNIFIED IDEOGRAPH
+0x924C 0x9C48  #CJK UNIFIED IDEOGRAPH
+0x924D 0x6A3D  #CJK UNIFIED IDEOGRAPH
+0x924E 0x8AB0  #CJK UNIFIED IDEOGRAPH
+0x924F 0x4E39  #CJK UNIFIED IDEOGRAPH
+0x9250 0x5358  #CJK UNIFIED IDEOGRAPH
+0x9251 0x5606  #CJK UNIFIED IDEOGRAPH
+0x9252 0x5766  #CJK UNIFIED IDEOGRAPH
+0x9253 0x62C5  #CJK UNIFIED IDEOGRAPH
+0x9254 0x63A2  #CJK UNIFIED IDEOGRAPH
+0x9255 0x65E6  #CJK UNIFIED IDEOGRAPH
+0x9256 0x6B4E  #CJK UNIFIED IDEOGRAPH
+0x9257 0x6DE1  #CJK UNIFIED IDEOGRAPH
+0x9258 0x6E5B  #CJK UNIFIED IDEOGRAPH
+0x9259 0x70AD  #CJK UNIFIED IDEOGRAPH
+0x925A 0x77ED  #CJK UNIFIED IDEOGRAPH
+0x925B 0x7AEF  #CJK UNIFIED IDEOGRAPH
+0x925C 0x7BAA  #CJK UNIFIED IDEOGRAPH
+0x925D 0x7DBB  #CJK UNIFIED IDEOGRAPH
+0x925E 0x803D  #CJK UNIFIED IDEOGRAPH
+0x925F 0x80C6  #CJK UNIFIED IDEOGRAPH
+0x9260 0x86CB  #CJK UNIFIED IDEOGRAPH
+0x9261 0x8A95  #CJK UNIFIED IDEOGRAPH
+0x9262 0x935B  #CJK UNIFIED IDEOGRAPH
+0x9263 0x56E3  #CJK UNIFIED IDEOGRAPH
+0x9264 0x58C7  #CJK UNIFIED IDEOGRAPH
+0x9265 0x5F3E  #CJK UNIFIED IDEOGRAPH
+0x9266 0x65AD  #CJK UNIFIED IDEOGRAPH
+0x9267 0x6696  #CJK UNIFIED IDEOGRAPH
+0x9268 0x6A80  #CJK UNIFIED IDEOGRAPH
+0x9269 0x6BB5  #CJK UNIFIED IDEOGRAPH
+0x926A 0x7537  #CJK UNIFIED IDEOGRAPH
+0x926B 0x8AC7  #CJK UNIFIED IDEOGRAPH
+0x926C 0x5024  #CJK UNIFIED IDEOGRAPH
+0x926D 0x77E5  #CJK UNIFIED IDEOGRAPH
+0x926E 0x5730  #CJK UNIFIED IDEOGRAPH
+0x926F 0x5F1B  #CJK UNIFIED IDEOGRAPH
+0x9270 0x6065  #CJK UNIFIED IDEOGRAPH
+0x9271 0x667A  #CJK UNIFIED IDEOGRAPH
+0x9272 0x6C60  #CJK UNIFIED IDEOGRAPH
+0x9273 0x75F4  #CJK UNIFIED IDEOGRAPH
+0x9274 0x7A1A  #CJK UNIFIED IDEOGRAPH
+0x9275 0x7F6E  #CJK UNIFIED IDEOGRAPH
+0x9276 0x81F4  #CJK UNIFIED IDEOGRAPH
+0x9277 0x8718  #CJK UNIFIED IDEOGRAPH
+0x9278 0x9045  #CJK UNIFIED IDEOGRAPH
+0x9279 0x99B3  #CJK UNIFIED IDEOGRAPH
+0x927A 0x7BC9  #CJK UNIFIED IDEOGRAPH
+0x927B 0x755C  #CJK UNIFIED IDEOGRAPH
+0x927C 0x7AF9  #CJK UNIFIED IDEOGRAPH
+0x927D 0x7B51  #CJK UNIFIED IDEOGRAPH
+0x927E 0x84C4  #CJK UNIFIED IDEOGRAPH
+0x9280 0x9010  #CJK UNIFIED IDEOGRAPH
+0x9281 0x79E9  #CJK UNIFIED IDEOGRAPH
+0x9282 0x7A92  #CJK UNIFIED IDEOGRAPH
+0x9283 0x8336  #CJK UNIFIED IDEOGRAPH
+0x9284 0x5AE1  #CJK UNIFIED IDEOGRAPH
+0x9285 0x7740  #CJK UNIFIED IDEOGRAPH
+0x9286 0x4E2D  #CJK UNIFIED IDEOGRAPH
+0x9287 0x4EF2  #CJK UNIFIED IDEOGRAPH
+0x9288 0x5B99  #CJK UNIFIED IDEOGRAPH
+0x9289 0x5FE0  #CJK UNIFIED IDEOGRAPH
+0x928A 0x62BD  #CJK UNIFIED IDEOGRAPH
+0x928B 0x663C  #CJK UNIFIED IDEOGRAPH
+0x928C 0x67F1  #CJK UNIFIED IDEOGRAPH
+0x928D 0x6CE8  #CJK UNIFIED IDEOGRAPH
+0x928E 0x866B  #CJK UNIFIED IDEOGRAPH
+0x928F 0x8877  #CJK UNIFIED IDEOGRAPH
+0x9290 0x8A3B  #CJK UNIFIED IDEOGRAPH
+0x9291 0x914E  #CJK UNIFIED IDEOGRAPH
+0x9292 0x92F3  #CJK UNIFIED IDEOGRAPH
+0x9293 0x99D0  #CJK UNIFIED IDEOGRAPH
+0x9294 0x6A17  #CJK UNIFIED IDEOGRAPH
+0x9295 0x7026  #CJK UNIFIED IDEOGRAPH
+0x9296 0x732A  #CJK UNIFIED IDEOGRAPH
+0x9297 0x82E7  #CJK UNIFIED IDEOGRAPH
+0x9298 0x8457  #CJK UNIFIED IDEOGRAPH
+0x9299 0x8CAF  #CJK UNIFIED IDEOGRAPH
+0x929A 0x4E01  #CJK UNIFIED IDEOGRAPH
+0x929B 0x5146  #CJK UNIFIED IDEOGRAPH
+0x929C 0x51CB  #CJK UNIFIED IDEOGRAPH
+0x929D 0x558B  #CJK UNIFIED IDEOGRAPH
+0x929E 0x5BF5  #CJK UNIFIED IDEOGRAPH
+0x929F 0x5E16  #CJK UNIFIED IDEOGRAPH
+0x92A0 0x5E33  #CJK UNIFIED IDEOGRAPH
+0x92A1 0x5E81  #CJK UNIFIED IDEOGRAPH
+0x92A2 0x5F14  #CJK UNIFIED IDEOGRAPH
+0x92A3 0x5F35  #CJK UNIFIED IDEOGRAPH
+0x92A4 0x5F6B  #CJK UNIFIED IDEOGRAPH
+0x92A5 0x5FB4  #CJK UNIFIED IDEOGRAPH
+0x92A6 0x61F2  #CJK UNIFIED IDEOGRAPH
+0x92A7 0x6311  #CJK UNIFIED IDEOGRAPH
+0x92A8 0x66A2  #CJK UNIFIED IDEOGRAPH
+0x92A9 0x671D  #CJK UNIFIED IDEOGRAPH
+0x92AA 0x6F6E  #CJK UNIFIED IDEOGRAPH
+0x92AB 0x7252  #CJK UNIFIED IDEOGRAPH
+0x92AC 0x753A  #CJK UNIFIED IDEOGRAPH
+0x92AD 0x773A  #CJK UNIFIED IDEOGRAPH
+0x92AE 0x8074  #CJK UNIFIED IDEOGRAPH
+0x92AF 0x8139  #CJK UNIFIED IDEOGRAPH
+0x92B0 0x8178  #CJK UNIFIED IDEOGRAPH
+0x92B1 0x8776  #CJK UNIFIED IDEOGRAPH
+0x92B2 0x8ABF  #CJK UNIFIED IDEOGRAPH
+0x92B3 0x8ADC  #CJK UNIFIED IDEOGRAPH
+0x92B4 0x8D85  #CJK UNIFIED IDEOGRAPH
+0x92B5 0x8DF3  #CJK UNIFIED IDEOGRAPH
+0x92B6 0x929A  #CJK UNIFIED IDEOGRAPH
+0x92B7 0x9577  #CJK UNIFIED IDEOGRAPH
+0x92B8 0x9802  #CJK UNIFIED IDEOGRAPH
+0x92B9 0x9CE5  #CJK UNIFIED IDEOGRAPH
+0x92BA 0x52C5  #CJK UNIFIED IDEOGRAPH
+0x92BB 0x6357  #CJK UNIFIED IDEOGRAPH
+0x92BC 0x76F4  #CJK UNIFIED IDEOGRAPH
+0x92BD 0x6715  #CJK UNIFIED IDEOGRAPH
+0x92BE 0x6C88  #CJK UNIFIED IDEOGRAPH
+0x92BF 0x73CD  #CJK UNIFIED IDEOGRAPH
+0x92C0 0x8CC3  #CJK UNIFIED IDEOGRAPH
+0x92C1 0x93AE  #CJK UNIFIED IDEOGRAPH
+0x92C2 0x9673  #CJK UNIFIED IDEOGRAPH
+0x92C3 0x6D25  #CJK UNIFIED IDEOGRAPH
+0x92C4 0x589C  #CJK UNIFIED IDEOGRAPH
+0x92C5 0x690E  #CJK UNIFIED IDEOGRAPH
+0x92C6 0x69CC  #CJK UNIFIED IDEOGRAPH
+0x92C7 0x8FFD  #CJK UNIFIED IDEOGRAPH
+0x92C8 0x939A  #CJK UNIFIED IDEOGRAPH
+0x92C9 0x75DB  #CJK UNIFIED IDEOGRAPH
+0x92CA 0x901A  #CJK UNIFIED IDEOGRAPH
+0x92CB 0x585A  #CJK UNIFIED IDEOGRAPH
+0x92CC 0x6802  #CJK UNIFIED IDEOGRAPH
+0x92CD 0x63B4  #CJK UNIFIED IDEOGRAPH
+0x92CE 0x69FB  #CJK UNIFIED IDEOGRAPH
+0x92CF 0x4F43  #CJK UNIFIED IDEOGRAPH
+0x92D0 0x6F2C  #CJK UNIFIED IDEOGRAPH
+0x92D1 0x67D8  #CJK UNIFIED IDEOGRAPH
+0x92D2 0x8FBB  #CJK UNIFIED IDEOGRAPH
+0x92D3 0x8526  #CJK UNIFIED IDEOGRAPH
+0x92D4 0x7DB4  #CJK UNIFIED IDEOGRAPH
+0x92D5 0x9354  #CJK UNIFIED IDEOGRAPH
+0x92D6 0x693F  #CJK UNIFIED IDEOGRAPH
+0x92D7 0x6F70  #CJK UNIFIED IDEOGRAPH
+0x92D8 0x576A  #CJK UNIFIED IDEOGRAPH
+0x92D9 0x58F7  #CJK UNIFIED IDEOGRAPH
+0x92DA 0x5B2C  #CJK UNIFIED IDEOGRAPH
+0x92DB 0x7D2C  #CJK UNIFIED IDEOGRAPH
+0x92DC 0x722A  #CJK UNIFIED IDEOGRAPH
+0x92DD 0x540A  #CJK UNIFIED IDEOGRAPH
+0x92DE 0x91E3  #CJK UNIFIED IDEOGRAPH
+0x92DF 0x9DB4  #CJK UNIFIED IDEOGRAPH
+0x92E0 0x4EAD  #CJK UNIFIED IDEOGRAPH
+0x92E1 0x4F4E  #CJK UNIFIED IDEOGRAPH
+0x92E2 0x505C  #CJK UNIFIED IDEOGRAPH
+0x92E3 0x5075  #CJK UNIFIED IDEOGRAPH
+0x92E4 0x5243  #CJK UNIFIED IDEOGRAPH
+0x92E5 0x8C9E  #CJK UNIFIED IDEOGRAPH
+0x92E6 0x5448  #CJK UNIFIED IDEOGRAPH
+0x92E7 0x5824  #CJK UNIFIED IDEOGRAPH
+0x92E8 0x5B9A  #CJK UNIFIED IDEOGRAPH
+0x92E9 0x5E1D  #CJK UNIFIED IDEOGRAPH
+0x92EA 0x5E95  #CJK UNIFIED IDEOGRAPH
+0x92EB 0x5EAD  #CJK UNIFIED IDEOGRAPH
+0x92EC 0x5EF7  #CJK UNIFIED IDEOGRAPH
+0x92ED 0x5F1F  #CJK UNIFIED IDEOGRAPH
+0x92EE 0x608C  #CJK UNIFIED IDEOGRAPH
+0x92EF 0x62B5  #CJK UNIFIED IDEOGRAPH
+0x92F0 0x633A  #CJK UNIFIED IDEOGRAPH
+0x92F1 0x63D0  #CJK UNIFIED IDEOGRAPH
+0x92F2 0x68AF  #CJK UNIFIED IDEOGRAPH
+0x92F3 0x6C40  #CJK UNIFIED IDEOGRAPH
+0x92F4 0x7887  #CJK UNIFIED IDEOGRAPH
+0x92F5 0x798E  #CJK UNIFIED IDEOGRAPH
+0x92F6 0x7A0B  #CJK UNIFIED IDEOGRAPH
+0x92F7 0x7DE0  #CJK UNIFIED IDEOGRAPH
+0x92F8 0x8247  #CJK UNIFIED IDEOGRAPH
+0x92F9 0x8A02  #CJK UNIFIED IDEOGRAPH
+0x92FA 0x8AE6  #CJK UNIFIED IDEOGRAPH
+0x92FB 0x8E44  #CJK UNIFIED IDEOGRAPH
+0x92FC 0x9013  #CJK UNIFIED IDEOGRAPH
+0x9340 0x90B8  #CJK UNIFIED IDEOGRAPH
+0x9341 0x912D  #CJK UNIFIED IDEOGRAPH
+0x9342 0x91D8  #CJK UNIFIED IDEOGRAPH
+0x9343 0x9F0E  #CJK UNIFIED IDEOGRAPH
+0x9344 0x6CE5  #CJK UNIFIED IDEOGRAPH
+0x9345 0x6458  #CJK UNIFIED IDEOGRAPH
+0x9346 0x64E2  #CJK UNIFIED IDEOGRAPH
+0x9347 0x6575  #CJK UNIFIED IDEOGRAPH
+0x9348 0x6EF4  #CJK UNIFIED IDEOGRAPH
+0x9349 0x7684  #CJK UNIFIED IDEOGRAPH
+0x934A 0x7B1B  #CJK UNIFIED IDEOGRAPH
+0x934B 0x9069  #CJK UNIFIED IDEOGRAPH
+0x934C 0x93D1  #CJK UNIFIED IDEOGRAPH
+0x934D 0x6EBA  #CJK UNIFIED IDEOGRAPH
+0x934E 0x54F2  #CJK UNIFIED IDEOGRAPH
+0x934F 0x5FB9  #CJK UNIFIED IDEOGRAPH
+0x9350 0x64A4  #CJK UNIFIED IDEOGRAPH
+0x9351 0x8F4D  #CJK UNIFIED IDEOGRAPH
+0x9352 0x8FED  #CJK UNIFIED IDEOGRAPH
+0x9353 0x9244  #CJK UNIFIED IDEOGRAPH
+0x9354 0x5178  #CJK UNIFIED IDEOGRAPH
+0x9355 0x586B  #CJK UNIFIED IDEOGRAPH
+0x9356 0x5929  #CJK UNIFIED IDEOGRAPH
+0x9357 0x5C55  #CJK UNIFIED IDEOGRAPH
+0x9358 0x5E97  #CJK UNIFIED IDEOGRAPH
+0x9359 0x6DFB  #CJK UNIFIED IDEOGRAPH
+0x935A 0x7E8F  #CJK UNIFIED IDEOGRAPH
+0x935B 0x751C  #CJK UNIFIED IDEOGRAPH
+0x935C 0x8CBC  #CJK UNIFIED IDEOGRAPH
+0x935D 0x8EE2  #CJK UNIFIED IDEOGRAPH
+0x935E 0x985B  #CJK UNIFIED IDEOGRAPH
+0x935F 0x70B9  #CJK UNIFIED IDEOGRAPH
+0x9360 0x4F1D  #CJK UNIFIED IDEOGRAPH
+0x9361 0x6BBF  #CJK UNIFIED IDEOGRAPH
+0x9362 0x6FB1  #CJK UNIFIED IDEOGRAPH
+0x9363 0x7530  #CJK UNIFIED IDEOGRAPH
+0x9364 0x96FB  #CJK UNIFIED IDEOGRAPH
+0x9365 0x514E  #CJK UNIFIED IDEOGRAPH
+0x9366 0x5410  #CJK UNIFIED IDEOGRAPH
+0x9367 0x5835  #CJK UNIFIED IDEOGRAPH
+0x9368 0x5857  #CJK UNIFIED IDEOGRAPH
+0x9369 0x59AC  #CJK UNIFIED IDEOGRAPH
+0x936A 0x5C60  #CJK UNIFIED IDEOGRAPH
+0x936B 0x5F92  #CJK UNIFIED IDEOGRAPH
+0x936C 0x6597  #CJK UNIFIED IDEOGRAPH
+0x936D 0x675C  #CJK UNIFIED IDEOGRAPH
+0x936E 0x6E21  #CJK UNIFIED IDEOGRAPH
+0x936F 0x767B  #CJK UNIFIED IDEOGRAPH
+0x9370 0x83DF  #CJK UNIFIED IDEOGRAPH
+0x9371 0x8CED  #CJK UNIFIED IDEOGRAPH
+0x9372 0x9014  #CJK UNIFIED IDEOGRAPH
+0x9373 0x90FD  #CJK UNIFIED IDEOGRAPH
+0x9374 0x934D  #CJK UNIFIED IDEOGRAPH
+0x9375 0x7825  #CJK UNIFIED IDEOGRAPH
+0x9376 0x783A  #CJK UNIFIED IDEOGRAPH
+0x9377 0x52AA  #CJK UNIFIED IDEOGRAPH
+0x9378 0x5EA6  #CJK UNIFIED IDEOGRAPH
+0x9379 0x571F  #CJK UNIFIED IDEOGRAPH
+0x937A 0x5974  #CJK UNIFIED IDEOGRAPH
+0x937B 0x6012  #CJK UNIFIED IDEOGRAPH
+0x937C 0x5012  #CJK UNIFIED IDEOGRAPH
+0x937D 0x515A  #CJK UNIFIED IDEOGRAPH
+0x937E 0x51AC  #CJK UNIFIED IDEOGRAPH
+0x9380 0x51CD  #CJK UNIFIED IDEOGRAPH
+0x9381 0x5200  #CJK UNIFIED IDEOGRAPH
+0x9382 0x5510  #CJK UNIFIED IDEOGRAPH
+0x9383 0x5854  #CJK UNIFIED IDEOGRAPH
+0x9384 0x5858  #CJK UNIFIED IDEOGRAPH
+0x9385 0x5957  #CJK UNIFIED IDEOGRAPH
+0x9386 0x5B95  #CJK UNIFIED IDEOGRAPH
+0x9387 0x5CF6  #CJK UNIFIED IDEOGRAPH
+0x9388 0x5D8B  #CJK UNIFIED IDEOGRAPH
+0x9389 0x60BC  #CJK UNIFIED IDEOGRAPH
+0x938A 0x6295  #CJK UNIFIED IDEOGRAPH
+0x938B 0x642D  #CJK UNIFIED IDEOGRAPH
+0x938C 0x6771  #CJK UNIFIED IDEOGRAPH
+0x938D 0x6843  #CJK UNIFIED IDEOGRAPH
+0x938E 0x68BC  #CJK UNIFIED IDEOGRAPH
+0x938F 0x68DF  #CJK UNIFIED IDEOGRAPH
+0x9390 0x76D7  #CJK UNIFIED IDEOGRAPH
+0x9391 0x6DD8  #CJK UNIFIED IDEOGRAPH
+0x9392 0x6E6F  #CJK UNIFIED IDEOGRAPH
+0x9393 0x6D9B  #CJK UNIFIED IDEOGRAPH
+0x9394 0x706F  #CJK UNIFIED IDEOGRAPH
+0x9395 0x71C8  #CJK UNIFIED IDEOGRAPH
+0x9396 0x5F53  #CJK UNIFIED IDEOGRAPH
+0x9397 0x75D8  #CJK UNIFIED IDEOGRAPH
+0x9398 0x7977  #CJK UNIFIED IDEOGRAPH
+0x9399 0x7B49  #CJK UNIFIED IDEOGRAPH
+0x939A 0x7B54  #CJK UNIFIED IDEOGRAPH
+0x939B 0x7B52  #CJK UNIFIED IDEOGRAPH
+0x939C 0x7CD6  #CJK UNIFIED IDEOGRAPH
+0x939D 0x7D71  #CJK UNIFIED IDEOGRAPH
+0x939E 0x5230  #CJK UNIFIED IDEOGRAPH
+0x939F 0x8463  #CJK UNIFIED IDEOGRAPH
+0x93A0 0x8569  #CJK UNIFIED IDEOGRAPH
+0x93A1 0x85E4  #CJK UNIFIED IDEOGRAPH
+0x93A2 0x8A0E  #CJK UNIFIED IDEOGRAPH
+0x93A3 0x8B04  #CJK UNIFIED IDEOGRAPH
+0x93A4 0x8C46  #CJK UNIFIED IDEOGRAPH
+0x93A5 0x8E0F  #CJK UNIFIED IDEOGRAPH
+0x93A6 0x9003  #CJK UNIFIED IDEOGRAPH
+0x93A7 0x900F  #CJK UNIFIED IDEOGRAPH
+0x93A8 0x9419  #CJK UNIFIED IDEOGRAPH
+0x93A9 0x9676  #CJK UNIFIED IDEOGRAPH
+0x93AA 0x982D  #CJK UNIFIED IDEOGRAPH
+0x93AB 0x9A30  #CJK UNIFIED IDEOGRAPH
+0x93AC 0x95D8  #CJK UNIFIED IDEOGRAPH
+0x93AD 0x50CD  #CJK UNIFIED IDEOGRAPH
+0x93AE 0x52D5  #CJK UNIFIED IDEOGRAPH
+0x93AF 0x540C  #CJK UNIFIED IDEOGRAPH
+0x93B0 0x5802  #CJK UNIFIED IDEOGRAPH
+0x93B1 0x5C0E  #CJK UNIFIED IDEOGRAPH
+0x93B2 0x61A7  #CJK UNIFIED IDEOGRAPH
+0x93B3 0x649E  #CJK UNIFIED IDEOGRAPH
+0x93B4 0x6D1E  #CJK UNIFIED IDEOGRAPH
+0x93B5 0x77B3  #CJK UNIFIED IDEOGRAPH
+0x93B6 0x7AE5  #CJK UNIFIED IDEOGRAPH
+0x93B7 0x80F4  #CJK UNIFIED IDEOGRAPH
+0x93B8 0x8404  #CJK UNIFIED IDEOGRAPH
+0x93B9 0x9053  #CJK UNIFIED IDEOGRAPH
+0x93BA 0x9285  #CJK UNIFIED IDEOGRAPH
+0x93BB 0x5CE0  #CJK UNIFIED IDEOGRAPH
+0x93BC 0x9D07  #CJK UNIFIED IDEOGRAPH
+0x93BD 0x533F  #CJK UNIFIED IDEOGRAPH
+0x93BE 0x5F97  #CJK UNIFIED IDEOGRAPH
+0x93BF 0x5FB3  #CJK UNIFIED IDEOGRAPH
+0x93C0 0x6D9C  #CJK UNIFIED IDEOGRAPH
+0x93C1 0x7279  #CJK UNIFIED IDEOGRAPH
+0x93C2 0x7763  #CJK UNIFIED IDEOGRAPH
+0x93C3 0x79BF  #CJK UNIFIED IDEOGRAPH
+0x93C4 0x7BE4  #CJK UNIFIED IDEOGRAPH
+0x93C5 0x6BD2  #CJK UNIFIED IDEOGRAPH
+0x93C6 0x72EC  #CJK UNIFIED IDEOGRAPH
+0x93C7 0x8AAD  #CJK UNIFIED IDEOGRAPH
+0x93C8 0x6803  #CJK UNIFIED IDEOGRAPH
+0x93C9 0x6A61  #CJK UNIFIED IDEOGRAPH
+0x93CA 0x51F8  #CJK UNIFIED IDEOGRAPH
+0x93CB 0x7A81  #CJK UNIFIED IDEOGRAPH
+0x93CC 0x6934  #CJK UNIFIED IDEOGRAPH
+0x93CD 0x5C4A  #CJK UNIFIED IDEOGRAPH
+0x93CE 0x9CF6  #CJK UNIFIED IDEOGRAPH
+0x93CF 0x82EB  #CJK UNIFIED IDEOGRAPH
+0x93D0 0x5BC5  #CJK UNIFIED IDEOGRAPH
+0x93D1 0x9149  #CJK UNIFIED IDEOGRAPH
+0x93D2 0x701E  #CJK UNIFIED IDEOGRAPH
+0x93D3 0x5678  #CJK UNIFIED IDEOGRAPH
+0x93D4 0x5C6F  #CJK UNIFIED IDEOGRAPH
+0x93D5 0x60C7  #CJK UNIFIED IDEOGRAPH
+0x93D6 0x6566  #CJK UNIFIED IDEOGRAPH
+0x93D7 0x6C8C  #CJK UNIFIED IDEOGRAPH
+0x93D8 0x8C5A  #CJK UNIFIED IDEOGRAPH
+0x93D9 0x9041  #CJK UNIFIED IDEOGRAPH
+0x93DA 0x9813  #CJK UNIFIED IDEOGRAPH
+0x93DB 0x5451  #CJK UNIFIED IDEOGRAPH
+0x93DC 0x66C7  #CJK UNIFIED IDEOGRAPH
+0x93DD 0x920D  #CJK UNIFIED IDEOGRAPH
+0x93DE 0x5948  #CJK UNIFIED IDEOGRAPH
+0x93DF 0x90A3  #CJK UNIFIED IDEOGRAPH
+0x93E0 0x5185  #CJK UNIFIED IDEOGRAPH
+0x93E1 0x4E4D  #CJK UNIFIED IDEOGRAPH
+0x93E2 0x51EA  #CJK UNIFIED IDEOGRAPH
+0x93E3 0x8599  #CJK UNIFIED IDEOGRAPH
+0x93E4 0x8B0E  #CJK UNIFIED IDEOGRAPH
+0x93E5 0x7058  #CJK UNIFIED IDEOGRAPH
+0x93E6 0x637A  #CJK UNIFIED IDEOGRAPH
+0x93E7 0x934B  #CJK UNIFIED IDEOGRAPH
+0x93E8 0x6962  #CJK UNIFIED IDEOGRAPH
+0x93E9 0x99B4  #CJK UNIFIED IDEOGRAPH
+0x93EA 0x7E04  #CJK UNIFIED IDEOGRAPH
+0x93EB 0x7577  #CJK UNIFIED IDEOGRAPH
+0x93EC 0x5357  #CJK UNIFIED IDEOGRAPH
+0x93ED 0x6960  #CJK UNIFIED IDEOGRAPH
+0x93EE 0x8EDF  #CJK UNIFIED IDEOGRAPH
+0x93EF 0x96E3  #CJK UNIFIED IDEOGRAPH
+0x93F0 0x6C5D  #CJK UNIFIED IDEOGRAPH
+0x93F1 0x4E8C  #CJK UNIFIED IDEOGRAPH
+0x93F2 0x5C3C  #CJK UNIFIED IDEOGRAPH
+0x93F3 0x5F10  #CJK UNIFIED IDEOGRAPH
+0x93F4 0x8FE9  #CJK UNIFIED IDEOGRAPH
+0x93F5 0x5302  #CJK UNIFIED IDEOGRAPH
+0x93F6 0x8CD1  #CJK UNIFIED IDEOGRAPH
+0x93F7 0x8089  #CJK UNIFIED IDEOGRAPH
+0x93F8 0x8679  #CJK UNIFIED IDEOGRAPH
+0x93F9 0x5EFF  #CJK UNIFIED IDEOGRAPH
+0x93FA 0x65E5  #CJK UNIFIED IDEOGRAPH
+0x93FB 0x4E73  #CJK UNIFIED IDEOGRAPH
+0x93FC 0x5165  #CJK UNIFIED IDEOGRAPH
+0x9440 0x5982  #CJK UNIFIED IDEOGRAPH
+0x9441 0x5C3F  #CJK UNIFIED IDEOGRAPH
+0x9442 0x97EE  #CJK UNIFIED IDEOGRAPH
+0x9443 0x4EFB  #CJK UNIFIED IDEOGRAPH
+0x9444 0x598A  #CJK UNIFIED IDEOGRAPH
+0x9445 0x5FCD  #CJK UNIFIED IDEOGRAPH
+0x9446 0x8A8D  #CJK UNIFIED IDEOGRAPH
+0x9447 0x6FE1  #CJK UNIFIED IDEOGRAPH
+0x9448 0x79B0  #CJK UNIFIED IDEOGRAPH
+0x9449 0x7962  #CJK UNIFIED IDEOGRAPH
+0x944A 0x5BE7  #CJK UNIFIED IDEOGRAPH
+0x944B 0x8471  #CJK UNIFIED IDEOGRAPH
+0x944C 0x732B  #CJK UNIFIED IDEOGRAPH
+0x944D 0x71B1  #CJK UNIFIED IDEOGRAPH
+0x944E 0x5E74  #CJK UNIFIED IDEOGRAPH
+0x944F 0x5FF5  #CJK UNIFIED IDEOGRAPH
+0x9450 0x637B  #CJK UNIFIED IDEOGRAPH
+0x9451 0x649A  #CJK UNIFIED IDEOGRAPH
+0x9452 0x71C3  #CJK UNIFIED IDEOGRAPH
+0x9453 0x7C98  #CJK UNIFIED IDEOGRAPH
+0x9454 0x4E43  #CJK UNIFIED IDEOGRAPH
+0x9455 0x5EFC  #CJK UNIFIED IDEOGRAPH
+0x9456 0x4E4B  #CJK UNIFIED IDEOGRAPH
+0x9457 0x57DC  #CJK UNIFIED IDEOGRAPH
+0x9458 0x56A2  #CJK UNIFIED IDEOGRAPH
+0x9459 0x60A9  #CJK UNIFIED IDEOGRAPH
+0x945A 0x6FC3  #CJK UNIFIED IDEOGRAPH
+0x945B 0x7D0D  #CJK UNIFIED IDEOGRAPH
+0x945C 0x80FD  #CJK UNIFIED IDEOGRAPH
+0x945D 0x8133  #CJK UNIFIED IDEOGRAPH
+0x945E 0x81BF  #CJK UNIFIED IDEOGRAPH
+0x945F 0x8FB2  #CJK UNIFIED IDEOGRAPH
+0x9460 0x8997  #CJK UNIFIED IDEOGRAPH
+0x9461 0x86A4  #CJK UNIFIED IDEOGRAPH
+0x9462 0x5DF4  #CJK UNIFIED IDEOGRAPH
+0x9463 0x628A  #CJK UNIFIED IDEOGRAPH
+0x9464 0x64AD  #CJK UNIFIED IDEOGRAPH
+0x9465 0x8987  #CJK UNIFIED IDEOGRAPH
+0x9466 0x6777  #CJK UNIFIED IDEOGRAPH
+0x9467 0x6CE2  #CJK UNIFIED IDEOGRAPH
+0x9468 0x6D3E  #CJK UNIFIED IDEOGRAPH
+0x9469 0x7436  #CJK UNIFIED IDEOGRAPH
+0x946A 0x7834  #CJK UNIFIED IDEOGRAPH
+0x946B 0x5A46  #CJK UNIFIED IDEOGRAPH
+0x946C 0x7F75  #CJK UNIFIED IDEOGRAPH
+0x946D 0x82AD  #CJK UNIFIED IDEOGRAPH
+0x946E 0x99AC  #CJK UNIFIED IDEOGRAPH
+0x946F 0x4FF3  #CJK UNIFIED IDEOGRAPH
+0x9470 0x5EC3  #CJK UNIFIED IDEOGRAPH
+0x9471 0x62DD  #CJK UNIFIED IDEOGRAPH
+0x9472 0x6392  #CJK UNIFIED IDEOGRAPH
+0x9473 0x6557  #CJK UNIFIED IDEOGRAPH
+0x9474 0x676F  #CJK UNIFIED IDEOGRAPH
+0x9475 0x76C3  #CJK UNIFIED IDEOGRAPH
+0x9476 0x724C  #CJK UNIFIED IDEOGRAPH
+0x9477 0x80CC  #CJK UNIFIED IDEOGRAPH
+0x9478 0x80BA  #CJK UNIFIED IDEOGRAPH
+0x9479 0x8F29  #CJK UNIFIED IDEOGRAPH
+0x947A 0x914D  #CJK UNIFIED IDEOGRAPH
+0x947B 0x500D  #CJK UNIFIED IDEOGRAPH
+0x947C 0x57F9  #CJK UNIFIED IDEOGRAPH
+0x947D 0x5A92  #CJK UNIFIED IDEOGRAPH
+0x947E 0x6885  #CJK UNIFIED IDEOGRAPH
+0x9480 0x6973  #CJK UNIFIED IDEOGRAPH
+0x9481 0x7164  #CJK UNIFIED IDEOGRAPH
+0x9482 0x72FD  #CJK UNIFIED IDEOGRAPH
+0x9483 0x8CB7  #CJK UNIFIED IDEOGRAPH
+0x9484 0x58F2  #CJK UNIFIED IDEOGRAPH
+0x9485 0x8CE0  #CJK UNIFIED IDEOGRAPH
+0x9486 0x966A  #CJK UNIFIED IDEOGRAPH
+0x9487 0x9019  #CJK UNIFIED IDEOGRAPH
+0x9488 0x877F  #CJK UNIFIED IDEOGRAPH
+0x9489 0x79E4  #CJK UNIFIED IDEOGRAPH
+0x948A 0x77E7  #CJK UNIFIED IDEOGRAPH
+0x948B 0x8429  #CJK UNIFIED IDEOGRAPH
+0x948C 0x4F2F  #CJK UNIFIED IDEOGRAPH
+0x948D 0x5265  #CJK UNIFIED IDEOGRAPH
+0x948E 0x535A  #CJK UNIFIED IDEOGRAPH
+0x948F 0x62CD  #CJK UNIFIED IDEOGRAPH
+0x9490 0x67CF  #CJK UNIFIED IDEOGRAPH
+0x9491 0x6CCA  #CJK UNIFIED IDEOGRAPH
+0x9492 0x767D  #CJK UNIFIED IDEOGRAPH
+0x9493 0x7B94  #CJK UNIFIED IDEOGRAPH
+0x9494 0x7C95  #CJK UNIFIED IDEOGRAPH
+0x9495 0x8236  #CJK UNIFIED IDEOGRAPH
+0x9496 0x8584  #CJK UNIFIED IDEOGRAPH
+0x9497 0x8FEB  #CJK UNIFIED IDEOGRAPH
+0x9498 0x66DD  #CJK UNIFIED IDEOGRAPH
+0x9499 0x6F20  #CJK UNIFIED IDEOGRAPH
+0x949A 0x7206  #CJK UNIFIED IDEOGRAPH
+0x949B 0x7E1B  #CJK UNIFIED IDEOGRAPH
+0x949C 0x83AB  #CJK UNIFIED IDEOGRAPH
+0x949D 0x99C1  #CJK UNIFIED IDEOGRAPH
+0x949E 0x9EA6  #CJK UNIFIED IDEOGRAPH
+0x949F 0x51FD  #CJK UNIFIED IDEOGRAPH
+0x94A0 0x7BB1  #CJK UNIFIED IDEOGRAPH
+0x94A1 0x7872  #CJK UNIFIED IDEOGRAPH
+0x94A2 0x7BB8  #CJK UNIFIED IDEOGRAPH
+0x94A3 0x8087  #CJK UNIFIED IDEOGRAPH
+0x94A4 0x7B48  #CJK UNIFIED IDEOGRAPH
+0x94A5 0x6AE8  #CJK UNIFIED IDEOGRAPH
+0x94A6 0x5E61  #CJK UNIFIED IDEOGRAPH
+0x94A7 0x808C  #CJK UNIFIED IDEOGRAPH
+0x94A8 0x7551  #CJK UNIFIED IDEOGRAPH
+0x94A9 0x7560  #CJK UNIFIED IDEOGRAPH
+0x94AA 0x516B  #CJK UNIFIED IDEOGRAPH
+0x94AB 0x9262  #CJK UNIFIED IDEOGRAPH
+0x94AC 0x6E8C  #CJK UNIFIED IDEOGRAPH
+0x94AD 0x767A  #CJK UNIFIED IDEOGRAPH
+0x94AE 0x9197  #CJK UNIFIED IDEOGRAPH
+0x94AF 0x9AEA  #CJK UNIFIED IDEOGRAPH
+0x94B0 0x4F10  #CJK UNIFIED IDEOGRAPH
+0x94B1 0x7F70  #CJK UNIFIED IDEOGRAPH
+0x94B2 0x629C  #CJK UNIFIED IDEOGRAPH
+0x94B3 0x7B4F  #CJK UNIFIED IDEOGRAPH
+0x94B4 0x95A5  #CJK UNIFIED IDEOGRAPH
+0x94B5 0x9CE9  #CJK UNIFIED IDEOGRAPH
+0x94B6 0x567A  #CJK UNIFIED IDEOGRAPH
+0x94B7 0x5859  #CJK UNIFIED IDEOGRAPH
+0x94B8 0x86E4  #CJK UNIFIED IDEOGRAPH
+0x94B9 0x96BC  #CJK UNIFIED IDEOGRAPH
+0x94BA 0x4F34  #CJK UNIFIED IDEOGRAPH
+0x94BB 0x5224  #CJK UNIFIED IDEOGRAPH
+0x94BC 0x534A  #CJK UNIFIED IDEOGRAPH
+0x94BD 0x53CD  #CJK UNIFIED IDEOGRAPH
+0x94BE 0x53DB  #CJK UNIFIED IDEOGRAPH
+0x94BF 0x5E06  #CJK UNIFIED IDEOGRAPH
+0x94C0 0x642C  #CJK UNIFIED IDEOGRAPH
+0x94C1 0x6591  #CJK UNIFIED IDEOGRAPH
+0x94C2 0x677F  #CJK UNIFIED IDEOGRAPH
+0x94C3 0x6C3E  #CJK UNIFIED IDEOGRAPH
+0x94C4 0x6C4E  #CJK UNIFIED IDEOGRAPH
+0x94C5 0x7248  #CJK UNIFIED IDEOGRAPH
+0x94C6 0x72AF  #CJK UNIFIED IDEOGRAPH
+0x94C7 0x73ED  #CJK UNIFIED IDEOGRAPH
+0x94C8 0x7554  #CJK UNIFIED IDEOGRAPH
+0x94C9 0x7E41  #CJK UNIFIED IDEOGRAPH
+0x94CA 0x822C  #CJK UNIFIED IDEOGRAPH
+0x94CB 0x85E9  #CJK UNIFIED IDEOGRAPH
+0x94CC 0x8CA9  #CJK UNIFIED IDEOGRAPH
+0x94CD 0x7BC4  #CJK UNIFIED IDEOGRAPH
+0x94CE 0x91C6  #CJK UNIFIED IDEOGRAPH
+0x94CF 0x7169  #CJK UNIFIED IDEOGRAPH
+0x94D0 0x9812  #CJK UNIFIED IDEOGRAPH
+0x94D1 0x98EF  #CJK UNIFIED IDEOGRAPH
+0x94D2 0x633D  #CJK UNIFIED IDEOGRAPH
+0x94D3 0x6669  #CJK UNIFIED IDEOGRAPH
+0x94D4 0x756A  #CJK UNIFIED IDEOGRAPH
+0x94D5 0x76E4  #CJK UNIFIED IDEOGRAPH
+0x94D6 0x78D0  #CJK UNIFIED IDEOGRAPH
+0x94D7 0x8543  #CJK UNIFIED IDEOGRAPH
+0x94D8 0x86EE  #CJK UNIFIED IDEOGRAPH
+0x94D9 0x532A  #CJK UNIFIED IDEOGRAPH
+0x94DA 0x5351  #CJK UNIFIED IDEOGRAPH
+0x94DB 0x5426  #CJK UNIFIED IDEOGRAPH
+0x94DC 0x5983  #CJK UNIFIED IDEOGRAPH
+0x94DD 0x5E87  #CJK UNIFIED IDEOGRAPH
+0x94DE 0x5F7C  #CJK UNIFIED IDEOGRAPH
+0x94DF 0x60B2  #CJK UNIFIED IDEOGRAPH
+0x94E0 0x6249  #CJK UNIFIED IDEOGRAPH
+0x94E1 0x6279  #CJK UNIFIED IDEOGRAPH
+0x94E2 0x62AB  #CJK UNIFIED IDEOGRAPH
+0x94E3 0x6590  #CJK UNIFIED IDEOGRAPH
+0x94E4 0x6BD4  #CJK UNIFIED IDEOGRAPH
+0x94E5 0x6CCC  #CJK UNIFIED IDEOGRAPH
+0x94E6 0x75B2  #CJK UNIFIED IDEOGRAPH
+0x94E7 0x76AE  #CJK UNIFIED IDEOGRAPH
+0x94E8 0x7891  #CJK UNIFIED IDEOGRAPH
+0x94E9 0x79D8  #CJK UNIFIED IDEOGRAPH
+0x94EA 0x7DCB  #CJK UNIFIED IDEOGRAPH
+0x94EB 0x7F77  #CJK UNIFIED IDEOGRAPH
+0x94EC 0x80A5  #CJK UNIFIED IDEOGRAPH
+0x94ED 0x88AB  #CJK UNIFIED IDEOGRAPH
+0x94EE 0x8AB9  #CJK UNIFIED IDEOGRAPH
+0x94EF 0x8CBB  #CJK UNIFIED IDEOGRAPH
+0x94F0 0x907F  #CJK UNIFIED IDEOGRAPH
+0x94F1 0x975E  #CJK UNIFIED IDEOGRAPH
+0x94F2 0x98DB  #CJK UNIFIED IDEOGRAPH
+0x94F3 0x6A0B  #CJK UNIFIED IDEOGRAPH
+0x94F4 0x7C38  #CJK UNIFIED IDEOGRAPH
+0x94F5 0x5099  #CJK UNIFIED IDEOGRAPH
+0x94F6 0x5C3E  #CJK UNIFIED IDEOGRAPH
+0x94F7 0x5FAE  #CJK UNIFIED IDEOGRAPH
+0x94F8 0x6787  #CJK UNIFIED IDEOGRAPH
+0x94F9 0x6BD8  #CJK UNIFIED IDEOGRAPH
+0x94FA 0x7435  #CJK UNIFIED IDEOGRAPH
+0x94FB 0x7709  #CJK UNIFIED IDEOGRAPH
+0x94FC 0x7F8E  #CJK UNIFIED IDEOGRAPH
+0x9540 0x9F3B  #CJK UNIFIED IDEOGRAPH
+0x9541 0x67CA  #CJK UNIFIED IDEOGRAPH
+0x9542 0x7A17  #CJK UNIFIED IDEOGRAPH
+0x9543 0x5339  #CJK UNIFIED IDEOGRAPH
+0x9544 0x758B  #CJK UNIFIED IDEOGRAPH
+0x9545 0x9AED  #CJK UNIFIED IDEOGRAPH
+0x9546 0x5F66  #CJK UNIFIED IDEOGRAPH
+0x9547 0x819D  #CJK UNIFIED IDEOGRAPH
+0x9548 0x83F1  #CJK UNIFIED IDEOGRAPH
+0x9549 0x8098  #CJK UNIFIED IDEOGRAPH
+0x954A 0x5F3C  #CJK UNIFIED IDEOGRAPH
+0x954B 0x5FC5  #CJK UNIFIED IDEOGRAPH
+0x954C 0x7562  #CJK UNIFIED IDEOGRAPH
+0x954D 0x7B46  #CJK UNIFIED IDEOGRAPH
+0x954E 0x903C  #CJK UNIFIED IDEOGRAPH
+0x954F 0x6867  #CJK UNIFIED IDEOGRAPH
+0x9550 0x59EB  #CJK UNIFIED IDEOGRAPH
+0x9551 0x5A9B  #CJK UNIFIED IDEOGRAPH
+0x9552 0x7D10  #CJK UNIFIED IDEOGRAPH
+0x9553 0x767E  #CJK UNIFIED IDEOGRAPH
+0x9554 0x8B2C  #CJK UNIFIED IDEOGRAPH
+0x9555 0x4FF5  #CJK UNIFIED IDEOGRAPH
+0x9556 0x5F6A  #CJK UNIFIED IDEOGRAPH
+0x9557 0x6A19  #CJK UNIFIED IDEOGRAPH
+0x9558 0x6C37  #CJK UNIFIED IDEOGRAPH
+0x9559 0x6F02  #CJK UNIFIED IDEOGRAPH
+0x955A 0x74E2  #CJK UNIFIED IDEOGRAPH
+0x955B 0x7968  #CJK UNIFIED IDEOGRAPH
+0x955C 0x8868  #CJK UNIFIED IDEOGRAPH
+0x955D 0x8A55  #CJK UNIFIED IDEOGRAPH
+0x955E 0x8C79  #CJK UNIFIED IDEOGRAPH
+0x955F 0x5EDF  #CJK UNIFIED IDEOGRAPH
+0x9560 0x63CF  #CJK UNIFIED IDEOGRAPH
+0x9561 0x75C5  #CJK UNIFIED IDEOGRAPH
+0x9562 0x79D2  #CJK UNIFIED IDEOGRAPH
+0x9563 0x82D7  #CJK UNIFIED IDEOGRAPH
+0x9564 0x9328  #CJK UNIFIED IDEOGRAPH
+0x9565 0x92F2  #CJK UNIFIED IDEOGRAPH
+0x9566 0x849C  #CJK UNIFIED IDEOGRAPH
+0x9567 0x86ED  #CJK UNIFIED IDEOGRAPH
+0x9568 0x9C2D  #CJK UNIFIED IDEOGRAPH
+0x9569 0x54C1  #CJK UNIFIED IDEOGRAPH
+0x956A 0x5F6C  #CJK UNIFIED IDEOGRAPH
+0x956B 0x658C  #CJK UNIFIED IDEOGRAPH
+0x956C 0x6D5C  #CJK UNIFIED IDEOGRAPH
+0x956D 0x7015  #CJK UNIFIED IDEOGRAPH
+0x956E 0x8CA7  #CJK UNIFIED IDEOGRAPH
+0x956F 0x8CD3  #CJK UNIFIED IDEOGRAPH
+0x9570 0x983B  #CJK UNIFIED IDEOGRAPH
+0x9571 0x654F  #CJK UNIFIED IDEOGRAPH
+0x9572 0x74F6  #CJK UNIFIED IDEOGRAPH
+0x9573 0x4E0D  #CJK UNIFIED IDEOGRAPH
+0x9574 0x4ED8  #CJK UNIFIED IDEOGRAPH
+0x9575 0x57E0  #CJK UNIFIED IDEOGRAPH
+0x9576 0x592B  #CJK UNIFIED IDEOGRAPH
+0x9577 0x5A66  #CJK UNIFIED IDEOGRAPH
+0x9578 0x5BCC  #CJK UNIFIED IDEOGRAPH
+0x9579 0x51A8  #CJK UNIFIED IDEOGRAPH
+0x957A 0x5E03  #CJK UNIFIED IDEOGRAPH
+0x957B 0x5E9C  #CJK UNIFIED IDEOGRAPH
+0x957C 0x6016  #CJK UNIFIED IDEOGRAPH
+0x957D 0x6276  #CJK UNIFIED IDEOGRAPH
+0x957E 0x6577  #CJK UNIFIED IDEOGRAPH
+0x9580 0x65A7  #CJK UNIFIED IDEOGRAPH
+0x9581 0x666E  #CJK UNIFIED IDEOGRAPH
+0x9582 0x6D6E  #CJK UNIFIED IDEOGRAPH
+0x9583 0x7236  #CJK UNIFIED IDEOGRAPH
+0x9584 0x7B26  #CJK UNIFIED IDEOGRAPH
+0x9585 0x8150  #CJK UNIFIED IDEOGRAPH
+0x9586 0x819A  #CJK UNIFIED IDEOGRAPH
+0x9587 0x8299  #CJK UNIFIED IDEOGRAPH
+0x9588 0x8B5C  #CJK UNIFIED IDEOGRAPH
+0x9589 0x8CA0  #CJK UNIFIED IDEOGRAPH
+0x958A 0x8CE6  #CJK UNIFIED IDEOGRAPH
+0x958B 0x8D74  #CJK UNIFIED IDEOGRAPH
+0x958C 0x961C  #CJK UNIFIED IDEOGRAPH
+0x958D 0x9644  #CJK UNIFIED IDEOGRAPH
+0x958E 0x4FAE  #CJK UNIFIED IDEOGRAPH
+0x958F 0x64AB  #CJK UNIFIED IDEOGRAPH
+0x9590 0x6B66  #CJK UNIFIED IDEOGRAPH
+0x9591 0x821E  #CJK UNIFIED IDEOGRAPH
+0x9592 0x8461  #CJK UNIFIED IDEOGRAPH
+0x9593 0x856A  #CJK UNIFIED IDEOGRAPH
+0x9594 0x90E8  #CJK UNIFIED IDEOGRAPH
+0x9595 0x5C01  #CJK UNIFIED IDEOGRAPH
+0x9596 0x6953  #CJK UNIFIED IDEOGRAPH
+0x9597 0x98A8  #CJK UNIFIED IDEOGRAPH
+0x9598 0x847A  #CJK UNIFIED IDEOGRAPH
+0x9599 0x8557  #CJK UNIFIED IDEOGRAPH
+0x959A 0x4F0F  #CJK UNIFIED IDEOGRAPH
+0x959B 0x526F  #CJK UNIFIED IDEOGRAPH
+0x959C 0x5FA9  #CJK UNIFIED IDEOGRAPH
+0x959D 0x5E45  #CJK UNIFIED IDEOGRAPH
+0x959E 0x670D  #CJK UNIFIED IDEOGRAPH
+0x959F 0x798F  #CJK UNIFIED IDEOGRAPH
+0x95A0 0x8179  #CJK UNIFIED IDEOGRAPH
+0x95A1 0x8907  #CJK UNIFIED IDEOGRAPH
+0x95A2 0x8986  #CJK UNIFIED IDEOGRAPH
+0x95A3 0x6DF5  #CJK UNIFIED IDEOGRAPH
+0x95A4 0x5F17  #CJK UNIFIED IDEOGRAPH
+0x95A5 0x6255  #CJK UNIFIED IDEOGRAPH
+0x95A6 0x6CB8  #CJK UNIFIED IDEOGRAPH
+0x95A7 0x4ECF  #CJK UNIFIED IDEOGRAPH
+0x95A8 0x7269  #CJK UNIFIED IDEOGRAPH
+0x95A9 0x9B92  #CJK UNIFIED IDEOGRAPH
+0x95AA 0x5206  #CJK UNIFIED IDEOGRAPH
+0x95AB 0x543B  #CJK UNIFIED IDEOGRAPH
+0x95AC 0x5674  #CJK UNIFIED IDEOGRAPH
+0x95AD 0x58B3  #CJK UNIFIED IDEOGRAPH
+0x95AE 0x61A4  #CJK UNIFIED IDEOGRAPH
+0x95AF 0x626E  #CJK UNIFIED IDEOGRAPH
+0x95B0 0x711A  #CJK UNIFIED IDEOGRAPH
+0x95B1 0x596E  #CJK UNIFIED IDEOGRAPH
+0x95B2 0x7C89  #CJK UNIFIED IDEOGRAPH
+0x95B3 0x7CDE  #CJK UNIFIED IDEOGRAPH
+0x95B4 0x7D1B  #CJK UNIFIED IDEOGRAPH
+0x95B5 0x96F0  #CJK UNIFIED IDEOGRAPH
+0x95B6 0x6587  #CJK UNIFIED IDEOGRAPH
+0x95B7 0x805E  #CJK UNIFIED IDEOGRAPH
+0x95B8 0x4E19  #CJK UNIFIED IDEOGRAPH
+0x95B9 0x4F75  #CJK UNIFIED IDEOGRAPH
+0x95BA 0x5175  #CJK UNIFIED IDEOGRAPH
+0x95BB 0x5840  #CJK UNIFIED IDEOGRAPH
+0x95BC 0x5E63  #CJK UNIFIED IDEOGRAPH
+0x95BD 0x5E73  #CJK UNIFIED IDEOGRAPH
+0x95BE 0x5F0A  #CJK UNIFIED IDEOGRAPH
+0x95BF 0x67C4  #CJK UNIFIED IDEOGRAPH
+0x95C0 0x4E26  #CJK UNIFIED IDEOGRAPH
+0x95C1 0x853D  #CJK UNIFIED IDEOGRAPH
+0x95C2 0x9589  #CJK UNIFIED IDEOGRAPH
+0x95C3 0x965B  #CJK UNIFIED IDEOGRAPH
+0x95C4 0x7C73  #CJK UNIFIED IDEOGRAPH
+0x95C5 0x9801  #CJK UNIFIED IDEOGRAPH
+0x95C6 0x50FB  #CJK UNIFIED IDEOGRAPH
+0x95C7 0x58C1  #CJK UNIFIED IDEOGRAPH
+0x95C8 0x7656  #CJK UNIFIED IDEOGRAPH
+0x95C9 0x78A7  #CJK UNIFIED IDEOGRAPH
+0x95CA 0x5225  #CJK UNIFIED IDEOGRAPH
+0x95CB 0x77A5  #CJK UNIFIED IDEOGRAPH
+0x95CC 0x8511  #CJK UNIFIED IDEOGRAPH
+0x95CD 0x7B86  #CJK UNIFIED IDEOGRAPH
+0x95CE 0x504F  #CJK UNIFIED IDEOGRAPH
+0x95CF 0x5909  #CJK UNIFIED IDEOGRAPH
+0x95D0 0x7247  #CJK UNIFIED IDEOGRAPH
+0x95D1 0x7BC7  #CJK UNIFIED IDEOGRAPH
+0x95D2 0x7DE8  #CJK UNIFIED IDEOGRAPH
+0x95D3 0x8FBA  #CJK UNIFIED IDEOGRAPH
+0x95D4 0x8FD4  #CJK UNIFIED IDEOGRAPH
+0x95D5 0x904D  #CJK UNIFIED IDEOGRAPH
+0x95D6 0x4FBF  #CJK UNIFIED IDEOGRAPH
+0x95D7 0x52C9  #CJK UNIFIED IDEOGRAPH
+0x95D8 0x5A29  #CJK UNIFIED IDEOGRAPH
+0x95D9 0x5F01  #CJK UNIFIED IDEOGRAPH
+0x95DA 0x97AD  #CJK UNIFIED IDEOGRAPH
+0x95DB 0x4FDD  #CJK UNIFIED IDEOGRAPH
+0x95DC 0x8217  #CJK UNIFIED IDEOGRAPH
+0x95DD 0x92EA  #CJK UNIFIED IDEOGRAPH
+0x95DE 0x5703  #CJK UNIFIED IDEOGRAPH
+0x95DF 0x6355  #CJK UNIFIED IDEOGRAPH
+0x95E0 0x6B69  #CJK UNIFIED IDEOGRAPH
+0x95E1 0x752B  #CJK UNIFIED IDEOGRAPH
+0x95E2 0x88DC  #CJK UNIFIED IDEOGRAPH
+0x95E3 0x8F14  #CJK UNIFIED IDEOGRAPH
+0x95E4 0x7A42  #CJK UNIFIED IDEOGRAPH
+0x95E5 0x52DF  #CJK UNIFIED IDEOGRAPH
+0x95E6 0x5893  #CJK UNIFIED IDEOGRAPH
+0x95E7 0x6155  #CJK UNIFIED IDEOGRAPH
+0x95E8 0x620A  #CJK UNIFIED IDEOGRAPH
+0x95E9 0x66AE  #CJK UNIFIED IDEOGRAPH
+0x95EA 0x6BCD  #CJK UNIFIED IDEOGRAPH
+0x95EB 0x7C3F  #CJK UNIFIED IDEOGRAPH
+0x95EC 0x83E9  #CJK UNIFIED IDEOGRAPH
+0x95ED 0x5023  #CJK UNIFIED IDEOGRAPH
+0x95EE 0x4FF8  #CJK UNIFIED IDEOGRAPH
+0x95EF 0x5305  #CJK UNIFIED IDEOGRAPH
+0x95F0 0x5446  #CJK UNIFIED IDEOGRAPH
+0x95F1 0x5831  #CJK UNIFIED IDEOGRAPH
+0x95F2 0x5949  #CJK UNIFIED IDEOGRAPH
+0x95F3 0x5B9D  #CJK UNIFIED IDEOGRAPH
+0x95F4 0x5CF0  #CJK UNIFIED IDEOGRAPH
+0x95F5 0x5CEF  #CJK UNIFIED IDEOGRAPH
+0x95F6 0x5D29  #CJK UNIFIED IDEOGRAPH
+0x95F7 0x5E96  #CJK UNIFIED IDEOGRAPH
+0x95F8 0x62B1  #CJK UNIFIED IDEOGRAPH
+0x95F9 0x6367  #CJK UNIFIED IDEOGRAPH
+0x95FA 0x653E  #CJK UNIFIED IDEOGRAPH
+0x95FB 0x65B9  #CJK UNIFIED IDEOGRAPH
+0x95FC 0x670B  #CJK UNIFIED IDEOGRAPH
+0x9640 0x6CD5  #CJK UNIFIED IDEOGRAPH
+0x9641 0x6CE1  #CJK UNIFIED IDEOGRAPH
+0x9642 0x70F9  #CJK UNIFIED IDEOGRAPH
+0x9643 0x7832  #CJK UNIFIED IDEOGRAPH
+0x9644 0x7E2B  #CJK UNIFIED IDEOGRAPH
+0x9645 0x80DE  #CJK UNIFIED IDEOGRAPH
+0x9646 0x82B3  #CJK UNIFIED IDEOGRAPH
+0x9647 0x840C  #CJK UNIFIED IDEOGRAPH
+0x9648 0x84EC  #CJK UNIFIED IDEOGRAPH
+0x9649 0x8702  #CJK UNIFIED IDEOGRAPH
+0x964A 0x8912  #CJK UNIFIED IDEOGRAPH
+0x964B 0x8A2A  #CJK UNIFIED IDEOGRAPH
+0x964C 0x8C4A  #CJK UNIFIED IDEOGRAPH
+0x964D 0x90A6  #CJK UNIFIED IDEOGRAPH
+0x964E 0x92D2  #CJK UNIFIED IDEOGRAPH
+0x964F 0x98FD  #CJK UNIFIED IDEOGRAPH
+0x9650 0x9CF3  #CJK UNIFIED IDEOGRAPH
+0x9651 0x9D6C  #CJK UNIFIED IDEOGRAPH
+0x9652 0x4E4F  #CJK UNIFIED IDEOGRAPH
+0x9653 0x4EA1  #CJK UNIFIED IDEOGRAPH
+0x9654 0x508D  #CJK UNIFIED IDEOGRAPH
+0x9655 0x5256  #CJK UNIFIED IDEOGRAPH
+0x9656 0x574A  #CJK UNIFIED IDEOGRAPH
+0x9657 0x59A8  #CJK UNIFIED IDEOGRAPH
+0x9658 0x5E3D  #CJK UNIFIED IDEOGRAPH
+0x9659 0x5FD8  #CJK UNIFIED IDEOGRAPH
+0x965A 0x5FD9  #CJK UNIFIED IDEOGRAPH
+0x965B 0x623F  #CJK UNIFIED IDEOGRAPH
+0x965C 0x66B4  #CJK UNIFIED IDEOGRAPH
+0x965D 0x671B  #CJK UNIFIED IDEOGRAPH
+0x965E 0x67D0  #CJK UNIFIED IDEOGRAPH
+0x965F 0x68D2  #CJK UNIFIED IDEOGRAPH
+0x9660 0x5192  #CJK UNIFIED IDEOGRAPH
+0x9661 0x7D21  #CJK UNIFIED IDEOGRAPH
+0x9662 0x80AA  #CJK UNIFIED IDEOGRAPH
+0x9663 0x81A8  #CJK UNIFIED IDEOGRAPH
+0x9664 0x8B00  #CJK UNIFIED IDEOGRAPH
+0x9665 0x8C8C  #CJK UNIFIED IDEOGRAPH
+0x9666 0x8CBF  #CJK UNIFIED IDEOGRAPH
+0x9667 0x927E  #CJK UNIFIED IDEOGRAPH
+0x9668 0x9632  #CJK UNIFIED IDEOGRAPH
+0x9669 0x5420  #CJK UNIFIED IDEOGRAPH
+0x966A 0x982C  #CJK UNIFIED IDEOGRAPH
+0x966B 0x5317  #CJK UNIFIED IDEOGRAPH
+0x966C 0x50D5  #CJK UNIFIED IDEOGRAPH
+0x966D 0x535C  #CJK UNIFIED IDEOGRAPH
+0x966E 0x58A8  #CJK UNIFIED IDEOGRAPH
+0x966F 0x64B2  #CJK UNIFIED IDEOGRAPH
+0x9670 0x6734  #CJK UNIFIED IDEOGRAPH
+0x9671 0x7267  #CJK UNIFIED IDEOGRAPH
+0x9672 0x7766  #CJK UNIFIED IDEOGRAPH
+0x9673 0x7A46  #CJK UNIFIED IDEOGRAPH
+0x9674 0x91E6  #CJK UNIFIED IDEOGRAPH
+0x9675 0x52C3  #CJK UNIFIED IDEOGRAPH
+0x9676 0x6CA1  #CJK UNIFIED IDEOGRAPH
+0x9677 0x6B86  #CJK UNIFIED IDEOGRAPH
+0x9678 0x5800  #CJK UNIFIED IDEOGRAPH
+0x9679 0x5E4C  #CJK UNIFIED IDEOGRAPH
+0x967A 0x5954  #CJK UNIFIED IDEOGRAPH
+0x967B 0x672C  #CJK UNIFIED IDEOGRAPH
+0x967C 0x7FFB  #CJK UNIFIED IDEOGRAPH
+0x967D 0x51E1  #CJK UNIFIED IDEOGRAPH
+0x967E 0x76C6  #CJK UNIFIED IDEOGRAPH
+0x9680 0x6469  #CJK UNIFIED IDEOGRAPH
+0x9681 0x78E8  #CJK UNIFIED IDEOGRAPH
+0x9682 0x9B54  #CJK UNIFIED IDEOGRAPH
+0x9683 0x9EBB  #CJK UNIFIED IDEOGRAPH
+0x9684 0x57CB  #CJK UNIFIED IDEOGRAPH
+0x9685 0x59B9  #CJK UNIFIED IDEOGRAPH
+0x9686 0x6627  #CJK UNIFIED IDEOGRAPH
+0x9687 0x679A  #CJK UNIFIED IDEOGRAPH
+0x9688 0x6BCE  #CJK UNIFIED IDEOGRAPH
+0x9689 0x54E9  #CJK UNIFIED IDEOGRAPH
+0x968A 0x69D9  #CJK UNIFIED IDEOGRAPH
+0x968B 0x5E55  #CJK UNIFIED IDEOGRAPH
+0x968C 0x819C  #CJK UNIFIED IDEOGRAPH
+0x968D 0x6795  #CJK UNIFIED IDEOGRAPH
+0x968E 0x9BAA  #CJK UNIFIED IDEOGRAPH
+0x968F 0x67FE  #CJK UNIFIED IDEOGRAPH
+0x9690 0x9C52  #CJK UNIFIED IDEOGRAPH
+0x9691 0x685D  #CJK UNIFIED IDEOGRAPH
+0x9692 0x4EA6  #CJK UNIFIED IDEOGRAPH
+0x9693 0x4FE3  #CJK UNIFIED IDEOGRAPH
+0x9694 0x53C8  #CJK UNIFIED IDEOGRAPH
+0x9695 0x62B9  #CJK UNIFIED IDEOGRAPH
+0x9696 0x672B  #CJK UNIFIED IDEOGRAPH
+0x9697 0x6CAB  #CJK UNIFIED IDEOGRAPH
+0x9698 0x8FC4  #CJK UNIFIED IDEOGRAPH
+0x9699 0x4FAD  #CJK UNIFIED IDEOGRAPH
+0x969A 0x7E6D  #CJK UNIFIED IDEOGRAPH
+0x969B 0x9EBF  #CJK UNIFIED IDEOGRAPH
+0x969C 0x4E07  #CJK UNIFIED IDEOGRAPH
+0x969D 0x6162  #CJK UNIFIED IDEOGRAPH
+0x969E 0x6E80  #CJK UNIFIED IDEOGRAPH
+0x969F 0x6F2B  #CJK UNIFIED IDEOGRAPH
+0x96A0 0x8513  #CJK UNIFIED IDEOGRAPH
+0x96A1 0x5473  #CJK UNIFIED IDEOGRAPH
+0x96A2 0x672A  #CJK UNIFIED IDEOGRAPH
+0x96A3 0x9B45  #CJK UNIFIED IDEOGRAPH
+0x96A4 0x5DF3  #CJK UNIFIED IDEOGRAPH
+0x96A5 0x7B95  #CJK UNIFIED IDEOGRAPH
+0x96A6 0x5CAC  #CJK UNIFIED IDEOGRAPH
+0x96A7 0x5BC6  #CJK UNIFIED IDEOGRAPH
+0x96A8 0x871C  #CJK UNIFIED IDEOGRAPH
+0x96A9 0x6E4A  #CJK UNIFIED IDEOGRAPH
+0x96AA 0x84D1  #CJK UNIFIED IDEOGRAPH
+0x96AB 0x7A14  #CJK UNIFIED IDEOGRAPH
+0x96AC 0x8108  #CJK UNIFIED IDEOGRAPH
+0x96AD 0x5999  #CJK UNIFIED IDEOGRAPH
+0x96AE 0x7C8D  #CJK UNIFIED IDEOGRAPH
+0x96AF 0x6C11  #CJK UNIFIED IDEOGRAPH
+0x96B0 0x7720  #CJK UNIFIED IDEOGRAPH
+0x96B1 0x52D9  #CJK UNIFIED IDEOGRAPH
+0x96B2 0x5922  #CJK UNIFIED IDEOGRAPH
+0x96B3 0x7121  #CJK UNIFIED IDEOGRAPH
+0x96B4 0x725F  #CJK UNIFIED IDEOGRAPH
+0x96B5 0x77DB  #CJK UNIFIED IDEOGRAPH
+0x96B6 0x9727  #CJK UNIFIED IDEOGRAPH
+0x96B7 0x9D61  #CJK UNIFIED IDEOGRAPH
+0x96B8 0x690B  #CJK UNIFIED IDEOGRAPH
+0x96B9 0x5A7F  #CJK UNIFIED IDEOGRAPH
+0x96BA 0x5A18  #CJK UNIFIED IDEOGRAPH
+0x96BB 0x51A5  #CJK UNIFIED IDEOGRAPH
+0x96BC 0x540D  #CJK UNIFIED IDEOGRAPH
+0x96BD 0x547D  #CJK UNIFIED IDEOGRAPH
+0x96BE 0x660E  #CJK UNIFIED IDEOGRAPH
+0x96BF 0x76DF  #CJK UNIFIED IDEOGRAPH
+0x96C0 0x8FF7  #CJK UNIFIED IDEOGRAPH
+0x96C1 0x9298  #CJK UNIFIED IDEOGRAPH
+0x96C2 0x9CF4  #CJK UNIFIED IDEOGRAPH
+0x96C3 0x59EA  #CJK UNIFIED IDEOGRAPH
+0x96C4 0x725D  #CJK UNIFIED IDEOGRAPH
+0x96C5 0x6EC5  #CJK UNIFIED IDEOGRAPH
+0x96C6 0x514D  #CJK UNIFIED IDEOGRAPH
+0x96C7 0x68C9  #CJK UNIFIED IDEOGRAPH
+0x96C8 0x7DBF  #CJK UNIFIED IDEOGRAPH
+0x96C9 0x7DEC  #CJK UNIFIED IDEOGRAPH
+0x96CA 0x9762  #CJK UNIFIED IDEOGRAPH
+0x96CB 0x9EBA  #CJK UNIFIED IDEOGRAPH
+0x96CC 0x6478  #CJK UNIFIED IDEOGRAPH
+0x96CD 0x6A21  #CJK UNIFIED IDEOGRAPH
+0x96CE 0x8302  #CJK UNIFIED IDEOGRAPH
+0x96CF 0x5984  #CJK UNIFIED IDEOGRAPH
+0x96D0 0x5B5F  #CJK UNIFIED IDEOGRAPH
+0x96D1 0x6BDB  #CJK UNIFIED IDEOGRAPH
+0x96D2 0x731B  #CJK UNIFIED IDEOGRAPH
+0x96D3 0x76F2  #CJK UNIFIED IDEOGRAPH
+0x96D4 0x7DB2  #CJK UNIFIED IDEOGRAPH
+0x96D5 0x8017  #CJK UNIFIED IDEOGRAPH
+0x96D6 0x8499  #CJK UNIFIED IDEOGRAPH
+0x96D7 0x5132  #CJK UNIFIED IDEOGRAPH
+0x96D8 0x6728  #CJK UNIFIED IDEOGRAPH
+0x96D9 0x9ED9  #CJK UNIFIED IDEOGRAPH
+0x96DA 0x76EE  #CJK UNIFIED IDEOGRAPH
+0x96DB 0x6762  #CJK UNIFIED IDEOGRAPH
+0x96DC 0x52FF  #CJK UNIFIED IDEOGRAPH
+0x96DD 0x9905  #CJK UNIFIED IDEOGRAPH
+0x96DE 0x5C24  #CJK UNIFIED IDEOGRAPH
+0x96DF 0x623B  #CJK UNIFIED IDEOGRAPH
+0x96E0 0x7C7E  #CJK UNIFIED IDEOGRAPH
+0x96E1 0x8CB0  #CJK UNIFIED IDEOGRAPH
+0x96E2 0x554F  #CJK UNIFIED IDEOGRAPH
+0x96E3 0x60B6  #CJK UNIFIED IDEOGRAPH
+0x96E4 0x7D0B  #CJK UNIFIED IDEOGRAPH
+0x96E5 0x9580  #CJK UNIFIED IDEOGRAPH
+0x96E6 0x5301  #CJK UNIFIED IDEOGRAPH
+0x96E7 0x4E5F  #CJK UNIFIED IDEOGRAPH
+0x96E8 0x51B6  #CJK UNIFIED IDEOGRAPH
+0x96E9 0x591C  #CJK UNIFIED IDEOGRAPH
+0x96EA 0x723A  #CJK UNIFIED IDEOGRAPH
+0x96EB 0x8036  #CJK UNIFIED IDEOGRAPH
+0x96EC 0x91CE  #CJK UNIFIED IDEOGRAPH
+0x96ED 0x5F25  #CJK UNIFIED IDEOGRAPH
+0x96EE 0x77E2  #CJK UNIFIED IDEOGRAPH
+0x96EF 0x5384  #CJK UNIFIED IDEOGRAPH
+0x96F0 0x5F79  #CJK UNIFIED IDEOGRAPH
+0x96F1 0x7D04  #CJK UNIFIED IDEOGRAPH
+0x96F2 0x85AC  #CJK UNIFIED IDEOGRAPH
+0x96F3 0x8A33  #CJK UNIFIED IDEOGRAPH
+0x96F4 0x8E8D  #CJK UNIFIED IDEOGRAPH
+0x96F5 0x9756  #CJK UNIFIED IDEOGRAPH
+0x96F6 0x67F3  #CJK UNIFIED IDEOGRAPH
+0x96F7 0x85AE  #CJK UNIFIED IDEOGRAPH
+0x96F8 0x9453  #CJK UNIFIED IDEOGRAPH
+0x96F9 0x6109  #CJK UNIFIED IDEOGRAPH
+0x96FA 0x6108  #CJK UNIFIED IDEOGRAPH
+0x96FB 0x6CB9  #CJK UNIFIED IDEOGRAPH
+0x96FC 0x7652  #CJK UNIFIED IDEOGRAPH
+0x9740 0x8AED  #CJK UNIFIED IDEOGRAPH
+0x9741 0x8F38  #CJK UNIFIED IDEOGRAPH
+0x9742 0x552F  #CJK UNIFIED IDEOGRAPH
+0x9743 0x4F51  #CJK UNIFIED IDEOGRAPH
+0x9744 0x512A  #CJK UNIFIED IDEOGRAPH
+0x9745 0x52C7  #CJK UNIFIED IDEOGRAPH
+0x9746 0x53CB  #CJK UNIFIED IDEOGRAPH
+0x9747 0x5BA5  #CJK UNIFIED IDEOGRAPH
+0x9748 0x5E7D  #CJK UNIFIED IDEOGRAPH
+0x9749 0x60A0  #CJK UNIFIED IDEOGRAPH
+0x974A 0x6182  #CJK UNIFIED IDEOGRAPH
+0x974B 0x63D6  #CJK UNIFIED IDEOGRAPH
+0x974C 0x6709  #CJK UNIFIED IDEOGRAPH
+0x974D 0x67DA  #CJK UNIFIED IDEOGRAPH
+0x974E 0x6E67  #CJK UNIFIED IDEOGRAPH
+0x974F 0x6D8C  #CJK UNIFIED IDEOGRAPH
+0x9750 0x7336  #CJK UNIFIED IDEOGRAPH
+0x9751 0x7337  #CJK UNIFIED IDEOGRAPH
+0x9752 0x7531  #CJK UNIFIED IDEOGRAPH
+0x9753 0x7950  #CJK UNIFIED IDEOGRAPH
+0x9754 0x88D5  #CJK UNIFIED IDEOGRAPH
+0x9755 0x8A98  #CJK UNIFIED IDEOGRAPH
+0x9756 0x904A  #CJK UNIFIED IDEOGRAPH
+0x9757 0x9091  #CJK UNIFIED IDEOGRAPH
+0x9758 0x90F5  #CJK UNIFIED IDEOGRAPH
+0x9759 0x96C4  #CJK UNIFIED IDEOGRAPH
+0x975A 0x878D  #CJK UNIFIED IDEOGRAPH
+0x975B 0x5915  #CJK UNIFIED IDEOGRAPH
+0x975C 0x4E88  #CJK UNIFIED IDEOGRAPH
+0x975D 0x4F59  #CJK UNIFIED IDEOGRAPH
+0x975E 0x4E0E  #CJK UNIFIED IDEOGRAPH
+0x975F 0x8A89  #CJK UNIFIED IDEOGRAPH
+0x9760 0x8F3F  #CJK UNIFIED IDEOGRAPH
+0x9761 0x9810  #CJK UNIFIED IDEOGRAPH
+0x9762 0x50AD  #CJK UNIFIED IDEOGRAPH
+0x9763 0x5E7C  #CJK UNIFIED IDEOGRAPH
+0x9764 0x5996  #CJK UNIFIED IDEOGRAPH
+0x9765 0x5BB9  #CJK UNIFIED IDEOGRAPH
+0x9766 0x5EB8  #CJK UNIFIED IDEOGRAPH
+0x9767 0x63DA  #CJK UNIFIED IDEOGRAPH
+0x9768 0x63FA  #CJK UNIFIED IDEOGRAPH
+0x9769 0x64C1  #CJK UNIFIED IDEOGRAPH
+0x976A 0x66DC  #CJK UNIFIED IDEOGRAPH
+0x976B 0x694A  #CJK UNIFIED IDEOGRAPH
+0x976C 0x69D8  #CJK UNIFIED IDEOGRAPH
+0x976D 0x6D0B  #CJK UNIFIED IDEOGRAPH
+0x976E 0x6EB6  #CJK UNIFIED IDEOGRAPH
+0x976F 0x7194  #CJK UNIFIED IDEOGRAPH
+0x9770 0x7528  #CJK UNIFIED IDEOGRAPH
+0x9771 0x7AAF  #CJK UNIFIED IDEOGRAPH
+0x9772 0x7F8A  #CJK UNIFIED IDEOGRAPH
+0x9773 0x8000  #CJK UNIFIED IDEOGRAPH
+0x9774 0x8449  #CJK UNIFIED IDEOGRAPH
+0x9775 0x84C9  #CJK UNIFIED IDEOGRAPH
+0x9776 0x8981  #CJK UNIFIED IDEOGRAPH
+0x9777 0x8B21  #CJK UNIFIED IDEOGRAPH
+0x9778 0x8E0A  #CJK UNIFIED IDEOGRAPH
+0x9779 0x9065  #CJK UNIFIED IDEOGRAPH
+0x977A 0x967D  #CJK UNIFIED IDEOGRAPH
+0x977B 0x990A  #CJK UNIFIED IDEOGRAPH
+0x977C 0x617E  #CJK UNIFIED IDEOGRAPH
+0x977D 0x6291  #CJK UNIFIED IDEOGRAPH
+0x977E 0x6B32  #CJK UNIFIED IDEOGRAPH
+0x9780 0x6C83  #CJK UNIFIED IDEOGRAPH
+0x9781 0x6D74  #CJK UNIFIED IDEOGRAPH
+0x9782 0x7FCC  #CJK UNIFIED IDEOGRAPH
+0x9783 0x7FFC  #CJK UNIFIED IDEOGRAPH
+0x9784 0x6DC0  #CJK UNIFIED IDEOGRAPH
+0x9785 0x7F85  #CJK UNIFIED IDEOGRAPH
+0x9786 0x87BA  #CJK UNIFIED IDEOGRAPH
+0x9787 0x88F8  #CJK UNIFIED IDEOGRAPH
+0x9788 0x6765  #CJK UNIFIED IDEOGRAPH
+0x9789 0x83B1  #CJK UNIFIED IDEOGRAPH
+0x978A 0x983C  #CJK UNIFIED IDEOGRAPH
+0x978B 0x96F7  #CJK UNIFIED IDEOGRAPH
+0x978C 0x6D1B  #CJK UNIFIED IDEOGRAPH
+0x978D 0x7D61  #CJK UNIFIED IDEOGRAPH
+0x978E 0x843D  #CJK UNIFIED IDEOGRAPH
+0x978F 0x916A  #CJK UNIFIED IDEOGRAPH
+0x9790 0x4E71  #CJK UNIFIED IDEOGRAPH
+0x9791 0x5375  #CJK UNIFIED IDEOGRAPH
+0x9792 0x5D50  #CJK UNIFIED IDEOGRAPH
+0x9793 0x6B04  #CJK UNIFIED IDEOGRAPH
+0x9794 0x6FEB  #CJK UNIFIED IDEOGRAPH
+0x9795 0x85CD  #CJK UNIFIED IDEOGRAPH
+0x9796 0x862D  #CJK UNIFIED IDEOGRAPH
+0x9797 0x89A7  #CJK UNIFIED IDEOGRAPH
+0x9798 0x5229  #CJK UNIFIED IDEOGRAPH
+0x9799 0x540F  #CJK UNIFIED IDEOGRAPH
+0x979A 0x5C65  #CJK UNIFIED IDEOGRAPH
+0x979B 0x674E  #CJK UNIFIED IDEOGRAPH
+0x979C 0x68A8  #CJK UNIFIED IDEOGRAPH
+0x979D 0x7406  #CJK UNIFIED IDEOGRAPH
+0x979E 0x7483  #CJK UNIFIED IDEOGRAPH
+0x979F 0x75E2  #CJK UNIFIED IDEOGRAPH
+0x97A0 0x88CF  #CJK UNIFIED IDEOGRAPH
+0x97A1 0x88E1  #CJK UNIFIED IDEOGRAPH
+0x97A2 0x91CC  #CJK UNIFIED IDEOGRAPH
+0x97A3 0x96E2  #CJK UNIFIED IDEOGRAPH
+0x97A4 0x9678  #CJK UNIFIED IDEOGRAPH
+0x97A5 0x5F8B  #CJK UNIFIED IDEOGRAPH
+0x97A6 0x7387  #CJK UNIFIED IDEOGRAPH
+0x97A7 0x7ACB  #CJK UNIFIED IDEOGRAPH
+0x97A8 0x844E  #CJK UNIFIED IDEOGRAPH
+0x97A9 0x63A0  #CJK UNIFIED IDEOGRAPH
+0x97AA 0x7565  #CJK UNIFIED IDEOGRAPH
+0x97AB 0x5289  #CJK UNIFIED IDEOGRAPH
+0x97AC 0x6D41  #CJK UNIFIED IDEOGRAPH
+0x97AD 0x6E9C  #CJK UNIFIED IDEOGRAPH
+0x97AE 0x7409  #CJK UNIFIED IDEOGRAPH
+0x97AF 0x7559  #CJK UNIFIED IDEOGRAPH
+0x97B0 0x786B  #CJK UNIFIED IDEOGRAPH
+0x97B1 0x7C92  #CJK UNIFIED IDEOGRAPH
+0x97B2 0x9686  #CJK UNIFIED IDEOGRAPH
+0x97B3 0x7ADC  #CJK UNIFIED IDEOGRAPH
+0x97B4 0x9F8D  #CJK UNIFIED IDEOGRAPH
+0x97B5 0x4FB6  #CJK UNIFIED IDEOGRAPH
+0x97B6 0x616E  #CJK UNIFIED IDEOGRAPH
+0x97B7 0x65C5  #CJK UNIFIED IDEOGRAPH
+0x97B8 0x865C  #CJK UNIFIED IDEOGRAPH
+0x97B9 0x4E86  #CJK UNIFIED IDEOGRAPH
+0x97BA 0x4EAE  #CJK UNIFIED IDEOGRAPH
+0x97BB 0x50DA  #CJK UNIFIED IDEOGRAPH
+0x97BC 0x4E21  #CJK UNIFIED IDEOGRAPH
+0x97BD 0x51CC  #CJK UNIFIED IDEOGRAPH
+0x97BE 0x5BEE  #CJK UNIFIED IDEOGRAPH
+0x97BF 0x6599  #CJK UNIFIED IDEOGRAPH
+0x97C0 0x6881  #CJK UNIFIED IDEOGRAPH
+0x97C1 0x6DBC  #CJK UNIFIED IDEOGRAPH
+0x97C2 0x731F  #CJK UNIFIED IDEOGRAPH
+0x97C3 0x7642  #CJK UNIFIED IDEOGRAPH
+0x97C4 0x77AD  #CJK UNIFIED IDEOGRAPH
+0x97C5 0x7A1C  #CJK UNIFIED IDEOGRAPH
+0x97C6 0x7CE7  #CJK UNIFIED IDEOGRAPH
+0x97C7 0x826F  #CJK UNIFIED IDEOGRAPH
+0x97C8 0x8AD2  #CJK UNIFIED IDEOGRAPH
+0x97C9 0x907C  #CJK UNIFIED IDEOGRAPH
+0x97CA 0x91CF  #CJK UNIFIED IDEOGRAPH
+0x97CB 0x9675  #CJK UNIFIED IDEOGRAPH
+0x97CC 0x9818  #CJK UNIFIED IDEOGRAPH
+0x97CD 0x529B  #CJK UNIFIED IDEOGRAPH
+0x97CE 0x7DD1  #CJK UNIFIED IDEOGRAPH
+0x97CF 0x502B  #CJK UNIFIED IDEOGRAPH
+0x97D0 0x5398  #CJK UNIFIED IDEOGRAPH
+0x97D1 0x6797  #CJK UNIFIED IDEOGRAPH
+0x97D2 0x6DCB  #CJK UNIFIED IDEOGRAPH
+0x97D3 0x71D0  #CJK UNIFIED IDEOGRAPH
+0x97D4 0x7433  #CJK UNIFIED IDEOGRAPH
+0x97D5 0x81E8  #CJK UNIFIED IDEOGRAPH
+0x97D6 0x8F2A  #CJK UNIFIED IDEOGRAPH
+0x97D7 0x96A3  #CJK UNIFIED IDEOGRAPH
+0x97D8 0x9C57  #CJK UNIFIED IDEOGRAPH
+0x97D9 0x9E9F  #CJK UNIFIED IDEOGRAPH
+0x97DA 0x7460  #CJK UNIFIED IDEOGRAPH
+0x97DB 0x5841  #CJK UNIFIED IDEOGRAPH
+0x97DC 0x6D99  #CJK UNIFIED IDEOGRAPH
+0x97DD 0x7D2F  #CJK UNIFIED IDEOGRAPH
+0x97DE 0x985E  #CJK UNIFIED IDEOGRAPH
+0x97DF 0x4EE4  #CJK UNIFIED IDEOGRAPH
+0x97E0 0x4F36  #CJK UNIFIED IDEOGRAPH
+0x97E1 0x4F8B  #CJK UNIFIED IDEOGRAPH
+0x97E2 0x51B7  #CJK UNIFIED IDEOGRAPH
+0x97E3 0x52B1  #CJK UNIFIED IDEOGRAPH
+0x97E4 0x5DBA  #CJK UNIFIED IDEOGRAPH
+0x97E5 0x601C  #CJK UNIFIED IDEOGRAPH
+0x97E6 0x73B2  #CJK UNIFIED IDEOGRAPH
+0x97E7 0x793C  #CJK UNIFIED IDEOGRAPH
+0x97E8 0x82D3  #CJK UNIFIED IDEOGRAPH
+0x97E9 0x9234  #CJK UNIFIED IDEOGRAPH
+0x97EA 0x96B7  #CJK UNIFIED IDEOGRAPH
+0x97EB 0x96F6  #CJK UNIFIED IDEOGRAPH
+0x97EC 0x970A  #CJK UNIFIED IDEOGRAPH
+0x97ED 0x9E97  #CJK UNIFIED IDEOGRAPH
+0x97EE 0x9F62  #CJK UNIFIED IDEOGRAPH
+0x97EF 0x66A6  #CJK UNIFIED IDEOGRAPH
+0x97F0 0x6B74  #CJK UNIFIED IDEOGRAPH
+0x97F1 0x5217  #CJK UNIFIED IDEOGRAPH
+0x97F2 0x52A3  #CJK UNIFIED IDEOGRAPH
+0x97F3 0x70C8  #CJK UNIFIED IDEOGRAPH
+0x97F4 0x88C2  #CJK UNIFIED IDEOGRAPH
+0x97F5 0x5EC9  #CJK UNIFIED IDEOGRAPH
+0x97F6 0x604B  #CJK UNIFIED IDEOGRAPH
+0x97F7 0x6190  #CJK UNIFIED IDEOGRAPH
+0x97F8 0x6F23  #CJK UNIFIED IDEOGRAPH
+0x97F9 0x7149  #CJK UNIFIED IDEOGRAPH
+0x97FA 0x7C3E  #CJK UNIFIED IDEOGRAPH
+0x97FB 0x7DF4  #CJK UNIFIED IDEOGRAPH
+0x97FC 0x806F  #CJK UNIFIED IDEOGRAPH
+0x9840 0x84EE  #CJK UNIFIED IDEOGRAPH
+0x9841 0x9023  #CJK UNIFIED IDEOGRAPH
+0x9842 0x932C  #CJK UNIFIED IDEOGRAPH
+0x9843 0x5442  #CJK UNIFIED IDEOGRAPH
+0x9844 0x9B6F  #CJK UNIFIED IDEOGRAPH
+0x9845 0x6AD3  #CJK UNIFIED IDEOGRAPH
+0x9846 0x7089  #CJK UNIFIED IDEOGRAPH
+0x9847 0x8CC2  #CJK UNIFIED IDEOGRAPH
+0x9848 0x8DEF  #CJK UNIFIED IDEOGRAPH
+0x9849 0x9732  #CJK UNIFIED IDEOGRAPH
+0x984A 0x52B4  #CJK UNIFIED IDEOGRAPH
+0x984B 0x5A41  #CJK UNIFIED IDEOGRAPH
+0x984C 0x5ECA  #CJK UNIFIED IDEOGRAPH
+0x984D 0x5F04  #CJK UNIFIED IDEOGRAPH
+0x984E 0x6717  #CJK UNIFIED IDEOGRAPH
+0x984F 0x697C  #CJK UNIFIED IDEOGRAPH
+0x9850 0x6994  #CJK UNIFIED IDEOGRAPH
+0x9851 0x6D6A  #CJK UNIFIED IDEOGRAPH
+0x9852 0x6F0F  #CJK UNIFIED IDEOGRAPH
+0x9853 0x7262  #CJK UNIFIED IDEOGRAPH
+0x9854 0x72FC  #CJK UNIFIED IDEOGRAPH
+0x9855 0x7BED  #CJK UNIFIED IDEOGRAPH
+0x9856 0x8001  #CJK UNIFIED IDEOGRAPH
+0x9857 0x807E  #CJK UNIFIED IDEOGRAPH
+0x9858 0x874B  #CJK UNIFIED IDEOGRAPH
+0x9859 0x90CE  #CJK UNIFIED IDEOGRAPH
+0x985A 0x516D  #CJK UNIFIED IDEOGRAPH
+0x985B 0x9E93  #CJK UNIFIED IDEOGRAPH
+0x985C 0x7984  #CJK UNIFIED IDEOGRAPH
+0x985D 0x808B  #CJK UNIFIED IDEOGRAPH
+0x985E 0x9332  #CJK UNIFIED IDEOGRAPH
+0x985F 0x8AD6  #CJK UNIFIED IDEOGRAPH
+0x9860 0x502D  #CJK UNIFIED IDEOGRAPH
+0x9861 0x548C  #CJK UNIFIED IDEOGRAPH
+0x9862 0x8A71  #CJK UNIFIED IDEOGRAPH
+0x9863 0x6B6A  #CJK UNIFIED IDEOGRAPH
+0x9864 0x8CC4  #CJK UNIFIED IDEOGRAPH
+0x9865 0x8107  #CJK UNIFIED IDEOGRAPH
+0x9866 0x60D1  #CJK UNIFIED IDEOGRAPH
+0x9867 0x67A0  #CJK UNIFIED IDEOGRAPH
+0x9868 0x9DF2  #CJK UNIFIED IDEOGRAPH
+0x9869 0x4E99  #CJK UNIFIED IDEOGRAPH
+0x986A 0x4E98  #CJK UNIFIED IDEOGRAPH
+0x986B 0x9C10  #CJK UNIFIED IDEOGRAPH
+0x986C 0x8A6B  #CJK UNIFIED IDEOGRAPH
+0x986D 0x85C1  #CJK UNIFIED IDEOGRAPH
+0x986E 0x8568  #CJK UNIFIED IDEOGRAPH
+0x986F 0x6900  #CJK UNIFIED IDEOGRAPH
+0x9870 0x6E7E  #CJK UNIFIED IDEOGRAPH
+0x9871 0x7897  #CJK UNIFIED IDEOGRAPH
+0x9872 0x8155  #CJK UNIFIED IDEOGRAPH
+0x989F 0x5F0C  #CJK UNIFIED IDEOGRAPH
+0x98A0 0x4E10  #CJK UNIFIED IDEOGRAPH
+0x98A1 0x4E15  #CJK UNIFIED IDEOGRAPH
+0x98A2 0x4E2A  #CJK UNIFIED IDEOGRAPH
+0x98A3 0x4E31  #CJK UNIFIED IDEOGRAPH
+0x98A4 0x4E36  #CJK UNIFIED IDEOGRAPH
+0x98A5 0x4E3C  #CJK UNIFIED IDEOGRAPH
+0x98A6 0x4E3F  #CJK UNIFIED IDEOGRAPH
+0x98A7 0x4E42  #CJK UNIFIED IDEOGRAPH
+0x98A8 0x4E56  #CJK UNIFIED IDEOGRAPH
+0x98A9 0x4E58  #CJK UNIFIED IDEOGRAPH
+0x98AA 0x4E82  #CJK UNIFIED IDEOGRAPH
+0x98AB 0x4E85  #CJK UNIFIED IDEOGRAPH
+0x98AC 0x8C6B  #CJK UNIFIED IDEOGRAPH
+0x98AD 0x4E8A  #CJK UNIFIED IDEOGRAPH
+0x98AE 0x8212  #CJK UNIFIED IDEOGRAPH
+0x98AF 0x5F0D  #CJK UNIFIED IDEOGRAPH
+0x98B0 0x4E8E  #CJK UNIFIED IDEOGRAPH
+0x98B1 0x4E9E  #CJK UNIFIED IDEOGRAPH
+0x98B2 0x4E9F  #CJK UNIFIED IDEOGRAPH
+0x98B3 0x4EA0  #CJK UNIFIED IDEOGRAPH
+0x98B4 0x4EA2  #CJK UNIFIED IDEOGRAPH
+0x98B5 0x4EB0  #CJK UNIFIED IDEOGRAPH
+0x98B6 0x4EB3  #CJK UNIFIED IDEOGRAPH
+0x98B7 0x4EB6  #CJK UNIFIED IDEOGRAPH
+0x98B8 0x4ECE  #CJK UNIFIED IDEOGRAPH
+0x98B9 0x4ECD  #CJK UNIFIED IDEOGRAPH
+0x98BA 0x4EC4  #CJK UNIFIED IDEOGRAPH
+0x98BB 0x4EC6  #CJK UNIFIED IDEOGRAPH
+0x98BC 0x4EC2  #CJK UNIFIED IDEOGRAPH
+0x98BD 0x4ED7  #CJK UNIFIED IDEOGRAPH
+0x98BE 0x4EDE  #CJK UNIFIED IDEOGRAPH
+0x98BF 0x4EED  #CJK UNIFIED IDEOGRAPH
+0x98C0 0x4EDF  #CJK UNIFIED IDEOGRAPH
+0x98C1 0x4EF7  #CJK UNIFIED IDEOGRAPH
+0x98C2 0x4F09  #CJK UNIFIED IDEOGRAPH
+0x98C3 0x4F5A  #CJK UNIFIED IDEOGRAPH
+0x98C4 0x4F30  #CJK UNIFIED IDEOGRAPH
+0x98C5 0x4F5B  #CJK UNIFIED IDEOGRAPH
+0x98C6 0x4F5D  #CJK UNIFIED IDEOGRAPH
+0x98C7 0x4F57  #CJK UNIFIED IDEOGRAPH
+0x98C8 0x4F47  #CJK UNIFIED IDEOGRAPH
+0x98C9 0x4F76  #CJK UNIFIED IDEOGRAPH
+0x98CA 0x4F88  #CJK UNIFIED IDEOGRAPH
+0x98CB 0x4F8F  #CJK UNIFIED IDEOGRAPH
+0x98CC 0x4F98  #CJK UNIFIED IDEOGRAPH
+0x98CD 0x4F7B  #CJK UNIFIED IDEOGRAPH
+0x98CE 0x4F69  #CJK UNIFIED IDEOGRAPH
+0x98CF 0x4F70  #CJK UNIFIED IDEOGRAPH
+0x98D0 0x4F91  #CJK UNIFIED IDEOGRAPH
+0x98D1 0x4F6F  #CJK UNIFIED IDEOGRAPH
+0x98D2 0x4F86  #CJK UNIFIED IDEOGRAPH
+0x98D3 0x4F96  #CJK UNIFIED IDEOGRAPH
+0x98D4 0x5118  #CJK UNIFIED IDEOGRAPH
+0x98D5 0x4FD4  #CJK UNIFIED IDEOGRAPH
+0x98D6 0x4FDF  #CJK UNIFIED IDEOGRAPH
+0x98D7 0x4FCE  #CJK UNIFIED IDEOGRAPH
+0x98D8 0x4FD8  #CJK UNIFIED IDEOGRAPH
+0x98D9 0x4FDB  #CJK UNIFIED IDEOGRAPH
+0x98DA 0x4FD1  #CJK UNIFIED IDEOGRAPH
+0x98DB 0x4FDA  #CJK UNIFIED IDEOGRAPH
+0x98DC 0x4FD0  #CJK UNIFIED IDEOGRAPH
+0x98DD 0x4FE4  #CJK UNIFIED IDEOGRAPH
+0x98DE 0x4FE5  #CJK UNIFIED IDEOGRAPH
+0x98DF 0x501A  #CJK UNIFIED IDEOGRAPH
+0x98E0 0x5028  #CJK UNIFIED IDEOGRAPH
+0x98E1 0x5014  #CJK UNIFIED IDEOGRAPH
+0x98E2 0x502A  #CJK UNIFIED IDEOGRAPH
+0x98E3 0x5025  #CJK UNIFIED IDEOGRAPH
+0x98E4 0x5005  #CJK UNIFIED IDEOGRAPH
+0x98E5 0x4F1C  #CJK UNIFIED IDEOGRAPH
+0x98E6 0x4FF6  #CJK UNIFIED IDEOGRAPH
+0x98E7 0x5021  #CJK UNIFIED IDEOGRAPH
+0x98E8 0x5029  #CJK UNIFIED IDEOGRAPH
+0x98E9 0x502C  #CJK UNIFIED IDEOGRAPH
+0x98EA 0x4FFE  #CJK UNIFIED IDEOGRAPH
+0x98EB 0x4FEF  #CJK UNIFIED IDEOGRAPH
+0x98EC 0x5011  #CJK UNIFIED IDEOGRAPH
+0x98ED 0x5006  #CJK UNIFIED IDEOGRAPH
+0x98EE 0x5043  #CJK UNIFIED IDEOGRAPH
+0x98EF 0x5047  #CJK UNIFIED IDEOGRAPH
+0x98F0 0x6703  #CJK UNIFIED IDEOGRAPH
+0x98F1 0x5055  #CJK UNIFIED IDEOGRAPH
+0x98F2 0x5050  #CJK UNIFIED IDEOGRAPH
+0x98F3 0x5048  #CJK UNIFIED IDEOGRAPH
+0x98F4 0x505A  #CJK UNIFIED IDEOGRAPH
+0x98F5 0x5056  #CJK UNIFIED IDEOGRAPH
+0x98F6 0x506C  #CJK UNIFIED IDEOGRAPH
+0x98F7 0x5078  #CJK UNIFIED IDEOGRAPH
+0x98F8 0x5080  #CJK UNIFIED IDEOGRAPH
+0x98F9 0x509A  #CJK UNIFIED IDEOGRAPH
+0x98FA 0x5085  #CJK UNIFIED IDEOGRAPH
+0x98FB 0x50B4  #CJK UNIFIED IDEOGRAPH
+0x98FC 0x50B2  #CJK UNIFIED IDEOGRAPH
+0x9940 0x50C9  #CJK UNIFIED IDEOGRAPH
+0x9941 0x50CA  #CJK UNIFIED IDEOGRAPH
+0x9942 0x50B3  #CJK UNIFIED IDEOGRAPH
+0x9943 0x50C2  #CJK UNIFIED IDEOGRAPH
+0x9944 0x50D6  #CJK UNIFIED IDEOGRAPH
+0x9945 0x50DE  #CJK UNIFIED IDEOGRAPH
+0x9946 0x50E5  #CJK UNIFIED IDEOGRAPH
+0x9947 0x50ED  #CJK UNIFIED IDEOGRAPH
+0x9948 0x50E3  #CJK UNIFIED IDEOGRAPH
+0x9949 0x50EE  #CJK UNIFIED IDEOGRAPH
+0x994A 0x50F9  #CJK UNIFIED IDEOGRAPH
+0x994B 0x50F5  #CJK UNIFIED IDEOGRAPH
+0x994C 0x5109  #CJK UNIFIED IDEOGRAPH
+0x994D 0x5101  #CJK UNIFIED IDEOGRAPH
+0x994E 0x5102  #CJK UNIFIED IDEOGRAPH
+0x994F 0x5116  #CJK UNIFIED IDEOGRAPH
+0x9950 0x5115  #CJK UNIFIED IDEOGRAPH
+0x9951 0x5114  #CJK UNIFIED IDEOGRAPH
+0x9952 0x511A  #CJK UNIFIED IDEOGRAPH
+0x9953 0x5121  #CJK UNIFIED IDEOGRAPH
+0x9954 0x513A  #CJK UNIFIED IDEOGRAPH
+0x9955 0x5137  #CJK UNIFIED IDEOGRAPH
+0x9956 0x513C  #CJK UNIFIED IDEOGRAPH
+0x9957 0x513B  #CJK UNIFIED IDEOGRAPH
+0x9958 0x513F  #CJK UNIFIED IDEOGRAPH
+0x9959 0x5140  #CJK UNIFIED IDEOGRAPH
+0x995A 0x5152  #CJK UNIFIED IDEOGRAPH
+0x995B 0x514C  #CJK UNIFIED IDEOGRAPH
+0x995C 0x5154  #CJK UNIFIED IDEOGRAPH
+0x995D 0x5162  #CJK UNIFIED IDEOGRAPH
+0x995E 0x7AF8  #CJK UNIFIED IDEOGRAPH
+0x995F 0x5169  #CJK UNIFIED IDEOGRAPH
+0x9960 0x516A  #CJK UNIFIED IDEOGRAPH
+0x9961 0x516E  #CJK UNIFIED IDEOGRAPH
+0x9962 0x5180  #CJK UNIFIED IDEOGRAPH
+0x9963 0x5182  #CJK UNIFIED IDEOGRAPH
+0x9964 0x56D8  #CJK UNIFIED IDEOGRAPH
+0x9965 0x518C  #CJK UNIFIED IDEOGRAPH
+0x9966 0x5189  #CJK UNIFIED IDEOGRAPH
+0x9967 0x518F  #CJK UNIFIED IDEOGRAPH
+0x9968 0x5191  #CJK UNIFIED IDEOGRAPH
+0x9969 0x5193  #CJK UNIFIED IDEOGRAPH
+0x996A 0x5195  #CJK UNIFIED IDEOGRAPH
+0x996B 0x5196  #CJK UNIFIED IDEOGRAPH
+0x996C 0x51A4  #CJK UNIFIED IDEOGRAPH
+0x996D 0x51A6  #CJK UNIFIED IDEOGRAPH
+0x996E 0x51A2  #CJK UNIFIED IDEOGRAPH
+0x996F 0x51A9  #CJK UNIFIED IDEOGRAPH
+0x9970 0x51AA  #CJK UNIFIED IDEOGRAPH
+0x9971 0x51AB  #CJK UNIFIED IDEOGRAPH
+0x9972 0x51B3  #CJK UNIFIED IDEOGRAPH
+0x9973 0x51B1  #CJK UNIFIED IDEOGRAPH
+0x9974 0x51B2  #CJK UNIFIED IDEOGRAPH
+0x9975 0x51B0  #CJK UNIFIED IDEOGRAPH
+0x9976 0x51B5  #CJK UNIFIED IDEOGRAPH
+0x9977 0x51BD  #CJK UNIFIED IDEOGRAPH
+0x9978 0x51C5  #CJK UNIFIED IDEOGRAPH
+0x9979 0x51C9  #CJK UNIFIED IDEOGRAPH
+0x997A 0x51DB  #CJK UNIFIED IDEOGRAPH
+0x997B 0x51E0  #CJK UNIFIED IDEOGRAPH
+0x997C 0x8655  #CJK UNIFIED IDEOGRAPH
+0x997D 0x51E9  #CJK UNIFIED IDEOGRAPH
+0x997E 0x51ED  #CJK UNIFIED IDEOGRAPH
+0x9980 0x51F0  #CJK UNIFIED IDEOGRAPH
+0x9981 0x51F5  #CJK UNIFIED IDEOGRAPH
+0x9982 0x51FE  #CJK UNIFIED IDEOGRAPH
+0x9983 0x5204  #CJK UNIFIED IDEOGRAPH
+0x9984 0x520B  #CJK UNIFIED IDEOGRAPH
+0x9985 0x5214  #CJK UNIFIED IDEOGRAPH
+0x9986 0x520E  #CJK UNIFIED IDEOGRAPH
+0x9987 0x5227  #CJK UNIFIED IDEOGRAPH
+0x9988 0x522A  #CJK UNIFIED IDEOGRAPH
+0x9989 0x522E  #CJK UNIFIED IDEOGRAPH
+0x998A 0x5233  #CJK UNIFIED IDEOGRAPH
+0x998B 0x5239  #CJK UNIFIED IDEOGRAPH
+0x998C 0x524F  #CJK UNIFIED IDEOGRAPH
+0x998D 0x5244  #CJK UNIFIED IDEOGRAPH
+0x998E 0x524B  #CJK UNIFIED IDEOGRAPH
+0x998F 0x524C  #CJK UNIFIED IDEOGRAPH
+0x9990 0x525E  #CJK UNIFIED IDEOGRAPH
+0x9991 0x5254  #CJK UNIFIED IDEOGRAPH
+0x9992 0x526A  #CJK UNIFIED IDEOGRAPH
+0x9993 0x5274  #CJK UNIFIED IDEOGRAPH
+0x9994 0x5269  #CJK UNIFIED IDEOGRAPH
+0x9995 0x5273  #CJK UNIFIED IDEOGRAPH
+0x9996 0x527F  #CJK UNIFIED IDEOGRAPH
+0x9997 0x527D  #CJK UNIFIED IDEOGRAPH
+0x9998 0x528D  #CJK UNIFIED IDEOGRAPH
+0x9999 0x5294  #CJK UNIFIED IDEOGRAPH
+0x999A 0x5292  #CJK UNIFIED IDEOGRAPH
+0x999B 0x5271  #CJK UNIFIED IDEOGRAPH
+0x999C 0x5288  #CJK UNIFIED IDEOGRAPH
+0x999D 0x5291  #CJK UNIFIED IDEOGRAPH
+0x999E 0x8FA8  #CJK UNIFIED IDEOGRAPH
+0x999F 0x8FA7  #CJK UNIFIED IDEOGRAPH
+0x99A0 0x52AC  #CJK UNIFIED IDEOGRAPH
+0x99A1 0x52AD  #CJK UNIFIED IDEOGRAPH
+0x99A2 0x52BC  #CJK UNIFIED IDEOGRAPH
+0x99A3 0x52B5  #CJK UNIFIED IDEOGRAPH
+0x99A4 0x52C1  #CJK UNIFIED IDEOGRAPH
+0x99A5 0x52CD  #CJK UNIFIED IDEOGRAPH
+0x99A6 0x52D7  #CJK UNIFIED IDEOGRAPH
+0x99A7 0x52DE  #CJK UNIFIED IDEOGRAPH
+0x99A8 0x52E3  #CJK UNIFIED IDEOGRAPH
+0x99A9 0x52E6  #CJK UNIFIED IDEOGRAPH
+0x99AA 0x98ED  #CJK UNIFIED IDEOGRAPH
+0x99AB 0x52E0  #CJK UNIFIED IDEOGRAPH
+0x99AC 0x52F3  #CJK UNIFIED IDEOGRAPH
+0x99AD 0x52F5  #CJK UNIFIED IDEOGRAPH
+0x99AE 0x52F8  #CJK UNIFIED IDEOGRAPH
+0x99AF 0x52F9  #CJK UNIFIED IDEOGRAPH
+0x99B0 0x5306  #CJK UNIFIED IDEOGRAPH
+0x99B1 0x5308  #CJK UNIFIED IDEOGRAPH
+0x99B2 0x7538  #CJK UNIFIED IDEOGRAPH
+0x99B3 0x530D  #CJK UNIFIED IDEOGRAPH
+0x99B4 0x5310  #CJK UNIFIED IDEOGRAPH
+0x99B5 0x530F  #CJK UNIFIED IDEOGRAPH
+0x99B6 0x5315  #CJK UNIFIED IDEOGRAPH
+0x99B7 0x531A  #CJK UNIFIED IDEOGRAPH
+0x99B8 0x5323  #CJK UNIFIED IDEOGRAPH
+0x99B9 0x532F  #CJK UNIFIED IDEOGRAPH
+0x99BA 0x5331  #CJK UNIFIED IDEOGRAPH
+0x99BB 0x5333  #CJK UNIFIED IDEOGRAPH
+0x99BC 0x5338  #CJK UNIFIED IDEOGRAPH
+0x99BD 0x5340  #CJK UNIFIED IDEOGRAPH
+0x99BE 0x5346  #CJK UNIFIED IDEOGRAPH
+0x99BF 0x5345  #CJK UNIFIED IDEOGRAPH
+0x99C0 0x4E17  #CJK UNIFIED IDEOGRAPH
+0x99C1 0x5349  #CJK UNIFIED IDEOGRAPH
+0x99C2 0x534D  #CJK UNIFIED IDEOGRAPH
+0x99C3 0x51D6  #CJK UNIFIED IDEOGRAPH
+0x99C4 0x535E  #CJK UNIFIED IDEOGRAPH
+0x99C5 0x5369  #CJK UNIFIED IDEOGRAPH
+0x99C6 0x536E  #CJK UNIFIED IDEOGRAPH
+0x99C7 0x5918  #CJK UNIFIED IDEOGRAPH
+0x99C8 0x537B  #CJK UNIFIED IDEOGRAPH
+0x99C9 0x5377  #CJK UNIFIED IDEOGRAPH
+0x99CA 0x5382  #CJK UNIFIED IDEOGRAPH
+0x99CB 0x5396  #CJK UNIFIED IDEOGRAPH
+0x99CC 0x53A0  #CJK UNIFIED IDEOGRAPH
+0x99CD 0x53A6  #CJK UNIFIED IDEOGRAPH
+0x99CE 0x53A5  #CJK UNIFIED IDEOGRAPH
+0x99CF 0x53AE  #CJK UNIFIED IDEOGRAPH
+0x99D0 0x53B0  #CJK UNIFIED IDEOGRAPH
+0x99D1 0x53B6  #CJK UNIFIED IDEOGRAPH
+0x99D2 0x53C3  #CJK UNIFIED IDEOGRAPH
+0x99D3 0x7C12  #CJK UNIFIED IDEOGRAPH
+0x99D4 0x96D9  #CJK UNIFIED IDEOGRAPH
+0x99D5 0x53DF  #CJK UNIFIED IDEOGRAPH
+0x99D6 0x66FC  #CJK UNIFIED IDEOGRAPH
+0x99D7 0x71EE  #CJK UNIFIED IDEOGRAPH
+0x99D8 0x53EE  #CJK UNIFIED IDEOGRAPH
+0x99D9 0x53E8  #CJK UNIFIED IDEOGRAPH
+0x99DA 0x53ED  #CJK UNIFIED IDEOGRAPH
+0x99DB 0x53FA  #CJK UNIFIED IDEOGRAPH
+0x99DC 0x5401  #CJK UNIFIED IDEOGRAPH
+0x99DD 0x543D  #CJK UNIFIED IDEOGRAPH
+0x99DE 0x5440  #CJK UNIFIED IDEOGRAPH
+0x99DF 0x542C  #CJK UNIFIED IDEOGRAPH
+0x99E0 0x542D  #CJK UNIFIED IDEOGRAPH
+0x99E1 0x543C  #CJK UNIFIED IDEOGRAPH
+0x99E2 0x542E  #CJK UNIFIED IDEOGRAPH
+0x99E3 0x5436  #CJK UNIFIED IDEOGRAPH
+0x99E4 0x5429  #CJK UNIFIED IDEOGRAPH
+0x99E5 0x541D  #CJK UNIFIED IDEOGRAPH
+0x99E6 0x544E  #CJK UNIFIED IDEOGRAPH
+0x99E7 0x548F  #CJK UNIFIED IDEOGRAPH
+0x99E8 0x5475  #CJK UNIFIED IDEOGRAPH
+0x99E9 0x548E  #CJK UNIFIED IDEOGRAPH
+0x99EA 0x545F  #CJK UNIFIED IDEOGRAPH
+0x99EB 0x5471  #CJK UNIFIED IDEOGRAPH
+0x99EC 0x5477  #CJK UNIFIED IDEOGRAPH
+0x99ED 0x5470  #CJK UNIFIED IDEOGRAPH
+0x99EE 0x5492  #CJK UNIFIED IDEOGRAPH
+0x99EF 0x547B  #CJK UNIFIED IDEOGRAPH
+0x99F0 0x5480  #CJK UNIFIED IDEOGRAPH
+0x99F1 0x5476  #CJK UNIFIED IDEOGRAPH
+0x99F2 0x5484  #CJK UNIFIED IDEOGRAPH
+0x99F3 0x5490  #CJK UNIFIED IDEOGRAPH
+0x99F4 0x5486  #CJK UNIFIED IDEOGRAPH
+0x99F5 0x54C7  #CJK UNIFIED IDEOGRAPH
+0x99F6 0x54A2  #CJK UNIFIED IDEOGRAPH
+0x99F7 0x54B8  #CJK UNIFIED IDEOGRAPH
+0x99F8 0x54A5  #CJK UNIFIED IDEOGRAPH
+0x99F9 0x54AC  #CJK UNIFIED IDEOGRAPH
+0x99FA 0x54C4  #CJK UNIFIED IDEOGRAPH
+0x99FB 0x54C8  #CJK UNIFIED IDEOGRAPH
+0x99FC 0x54A8  #CJK UNIFIED IDEOGRAPH
+0x9A40 0x54AB  #CJK UNIFIED IDEOGRAPH
+0x9A41 0x54C2  #CJK UNIFIED IDEOGRAPH
+0x9A42 0x54A4  #CJK UNIFIED IDEOGRAPH
+0x9A43 0x54BE  #CJK UNIFIED IDEOGRAPH
+0x9A44 0x54BC  #CJK UNIFIED IDEOGRAPH
+0x9A45 0x54D8  #CJK UNIFIED IDEOGRAPH
+0x9A46 0x54E5  #CJK UNIFIED IDEOGRAPH
+0x9A47 0x54E6  #CJK UNIFIED IDEOGRAPH
+0x9A48 0x550F  #CJK UNIFIED IDEOGRAPH
+0x9A49 0x5514  #CJK UNIFIED IDEOGRAPH
+0x9A4A 0x54FD  #CJK UNIFIED IDEOGRAPH
+0x9A4B 0x54EE  #CJK UNIFIED IDEOGRAPH
+0x9A4C 0x54ED  #CJK UNIFIED IDEOGRAPH
+0x9A4D 0x54FA  #CJK UNIFIED IDEOGRAPH
+0x9A4E 0x54E2  #CJK UNIFIED IDEOGRAPH
+0x9A4F 0x5539  #CJK UNIFIED IDEOGRAPH
+0x9A50 0x5540  #CJK UNIFIED IDEOGRAPH
+0x9A51 0x5563  #CJK UNIFIED IDEOGRAPH
+0x9A52 0x554C  #CJK UNIFIED IDEOGRAPH
+0x9A53 0x552E  #CJK UNIFIED IDEOGRAPH
+0x9A54 0x555C  #CJK UNIFIED IDEOGRAPH
+0x9A55 0x5545  #CJK UNIFIED IDEOGRAPH
+0x9A56 0x5556  #CJK UNIFIED IDEOGRAPH
+0x9A57 0x5557  #CJK UNIFIED IDEOGRAPH
+0x9A58 0x5538  #CJK UNIFIED IDEOGRAPH
+0x9A59 0x5533  #CJK UNIFIED IDEOGRAPH
+0x9A5A 0x555D  #CJK UNIFIED IDEOGRAPH
+0x9A5B 0x5599  #CJK UNIFIED IDEOGRAPH
+0x9A5C 0x5580  #CJK UNIFIED IDEOGRAPH
+0x9A5D 0x54AF  #CJK UNIFIED IDEOGRAPH
+0x9A5E 0x558A  #CJK UNIFIED IDEOGRAPH
+0x9A5F 0x559F  #CJK UNIFIED IDEOGRAPH
+0x9A60 0x557B  #CJK UNIFIED IDEOGRAPH
+0x9A61 0x557E  #CJK UNIFIED IDEOGRAPH
+0x9A62 0x5598  #CJK UNIFIED IDEOGRAPH
+0x9A63 0x559E  #CJK UNIFIED IDEOGRAPH
+0x9A64 0x55AE  #CJK UNIFIED IDEOGRAPH
+0x9A65 0x557C  #CJK UNIFIED IDEOGRAPH
+0x9A66 0x5583  #CJK UNIFIED IDEOGRAPH
+0x9A67 0x55A9  #CJK UNIFIED IDEOGRAPH
+0x9A68 0x5587  #CJK UNIFIED IDEOGRAPH
+0x9A69 0x55A8  #CJK UNIFIED IDEOGRAPH
+0x9A6A 0x55DA  #CJK UNIFIED IDEOGRAPH
+0x9A6B 0x55C5  #CJK UNIFIED IDEOGRAPH
+0x9A6C 0x55DF  #CJK UNIFIED IDEOGRAPH
+0x9A6D 0x55C4  #CJK UNIFIED IDEOGRAPH
+0x9A6E 0x55DC  #CJK UNIFIED IDEOGRAPH
+0x9A6F 0x55E4  #CJK UNIFIED IDEOGRAPH
+0x9A70 0x55D4  #CJK UNIFIED IDEOGRAPH
+0x9A71 0x5614  #CJK UNIFIED IDEOGRAPH
+0x9A72 0x55F7  #CJK UNIFIED IDEOGRAPH
+0x9A73 0x5616  #CJK UNIFIED IDEOGRAPH
+0x9A74 0x55FE  #CJK UNIFIED IDEOGRAPH
+0x9A75 0x55FD  #CJK UNIFIED IDEOGRAPH
+0x9A76 0x561B  #CJK UNIFIED IDEOGRAPH
+0x9A77 0x55F9  #CJK UNIFIED IDEOGRAPH
+0x9A78 0x564E  #CJK UNIFIED IDEOGRAPH
+0x9A79 0x5650  #CJK UNIFIED IDEOGRAPH
+0x9A7A 0x71DF  #CJK UNIFIED IDEOGRAPH
+0x9A7B 0x5634  #CJK UNIFIED IDEOGRAPH
+0x9A7C 0x5636  #CJK UNIFIED IDEOGRAPH
+0x9A7D 0x5632  #CJK UNIFIED IDEOGRAPH
+0x9A7E 0x5638  #CJK UNIFIED IDEOGRAPH
+0x9A80 0x566B  #CJK UNIFIED IDEOGRAPH
+0x9A81 0x5664  #CJK UNIFIED IDEOGRAPH
+0x9A82 0x562F  #CJK UNIFIED IDEOGRAPH
+0x9A83 0x566C  #CJK UNIFIED IDEOGRAPH
+0x9A84 0x566A  #CJK UNIFIED IDEOGRAPH
+0x9A85 0x5686  #CJK UNIFIED IDEOGRAPH
+0x9A86 0x5680  #CJK UNIFIED IDEOGRAPH
+0x9A87 0x568A  #CJK UNIFIED IDEOGRAPH
+0x9A88 0x56A0  #CJK UNIFIED IDEOGRAPH
+0x9A89 0x5694  #CJK UNIFIED IDEOGRAPH
+0x9A8A 0x568F  #CJK UNIFIED IDEOGRAPH
+0x9A8B 0x56A5  #CJK UNIFIED IDEOGRAPH
+0x9A8C 0x56AE  #CJK UNIFIED IDEOGRAPH
+0x9A8D 0x56B6  #CJK UNIFIED IDEOGRAPH
+0x9A8E 0x56B4  #CJK UNIFIED IDEOGRAPH
+0x9A8F 0x56C2  #CJK UNIFIED IDEOGRAPH
+0x9A90 0x56BC  #CJK UNIFIED IDEOGRAPH
+0x9A91 0x56C1  #CJK UNIFIED IDEOGRAPH
+0x9A92 0x56C3  #CJK UNIFIED IDEOGRAPH
+0x9A93 0x56C0  #CJK UNIFIED IDEOGRAPH
+0x9A94 0x56C8  #CJK UNIFIED IDEOGRAPH
+0x9A95 0x56CE  #CJK UNIFIED IDEOGRAPH
+0x9A96 0x56D1  #CJK UNIFIED IDEOGRAPH
+0x9A97 0x56D3  #CJK UNIFIED IDEOGRAPH
+0x9A98 0x56D7  #CJK UNIFIED IDEOGRAPH
+0x9A99 0x56EE  #CJK UNIFIED IDEOGRAPH
+0x9A9A 0x56F9  #CJK UNIFIED IDEOGRAPH
+0x9A9B 0x5700  #CJK UNIFIED IDEOGRAPH
+0x9A9C 0x56FF  #CJK UNIFIED IDEOGRAPH
+0x9A9D 0x5704  #CJK UNIFIED IDEOGRAPH
+0x9A9E 0x5709  #CJK UNIFIED IDEOGRAPH
+0x9A9F 0x5708  #CJK UNIFIED IDEOGRAPH
+0x9AA0 0x570B  #CJK UNIFIED IDEOGRAPH
+0x9AA1 0x570D  #CJK UNIFIED IDEOGRAPH
+0x9AA2 0x5713  #CJK UNIFIED IDEOGRAPH
+0x9AA3 0x5718  #CJK UNIFIED IDEOGRAPH
+0x9AA4 0x5716  #CJK UNIFIED IDEOGRAPH
+0x9AA5 0x55C7  #CJK UNIFIED IDEOGRAPH
+0x9AA6 0x571C  #CJK UNIFIED IDEOGRAPH
+0x9AA7 0x5726  #CJK UNIFIED IDEOGRAPH
+0x9AA8 0x5737  #CJK UNIFIED IDEOGRAPH
+0x9AA9 0x5738  #CJK UNIFIED IDEOGRAPH
+0x9AAA 0x574E  #CJK UNIFIED IDEOGRAPH
+0x9AAB 0x573B  #CJK UNIFIED IDEOGRAPH
+0x9AAC 0x5740  #CJK UNIFIED IDEOGRAPH
+0x9AAD 0x574F  #CJK UNIFIED IDEOGRAPH
+0x9AAE 0x5769  #CJK UNIFIED IDEOGRAPH
+0x9AAF 0x57C0  #CJK UNIFIED IDEOGRAPH
+0x9AB0 0x5788  #CJK UNIFIED IDEOGRAPH
+0x9AB1 0x5761  #CJK UNIFIED IDEOGRAPH
+0x9AB2 0x577F  #CJK UNIFIED IDEOGRAPH
+0x9AB3 0x5789  #CJK UNIFIED IDEOGRAPH
+0x9AB4 0x5793  #CJK UNIFIED IDEOGRAPH
+0x9AB5 0x57A0  #CJK UNIFIED IDEOGRAPH
+0x9AB6 0x57B3  #CJK UNIFIED IDEOGRAPH
+0x9AB7 0x57A4  #CJK UNIFIED IDEOGRAPH
+0x9AB8 0x57AA  #CJK UNIFIED IDEOGRAPH
+0x9AB9 0x57B0  #CJK UNIFIED IDEOGRAPH
+0x9ABA 0x57C3  #CJK UNIFIED IDEOGRAPH
+0x9ABB 0x57C6  #CJK UNIFIED IDEOGRAPH
+0x9ABC 0x57D4  #CJK UNIFIED IDEOGRAPH
+0x9ABD 0x57D2  #CJK UNIFIED IDEOGRAPH
+0x9ABE 0x57D3  #CJK UNIFIED IDEOGRAPH
+0x9ABF 0x580A  #CJK UNIFIED IDEOGRAPH
+0x9AC0 0x57D6  #CJK UNIFIED IDEOGRAPH
+0x9AC1 0x57E3  #CJK UNIFIED IDEOGRAPH
+0x9AC2 0x580B  #CJK UNIFIED IDEOGRAPH
+0x9AC3 0x5819  #CJK UNIFIED IDEOGRAPH
+0x9AC4 0x581D  #CJK UNIFIED IDEOGRAPH
+0x9AC5 0x5872  #CJK UNIFIED IDEOGRAPH
+0x9AC6 0x5821  #CJK UNIFIED IDEOGRAPH
+0x9AC7 0x5862  #CJK UNIFIED IDEOGRAPH
+0x9AC8 0x584B  #CJK UNIFIED IDEOGRAPH
+0x9AC9 0x5870  #CJK UNIFIED IDEOGRAPH
+0x9ACA 0x6BC0  #CJK UNIFIED IDEOGRAPH
+0x9ACB 0x5852  #CJK UNIFIED IDEOGRAPH
+0x9ACC 0x583D  #CJK UNIFIED IDEOGRAPH
+0x9ACD 0x5879  #CJK UNIFIED IDEOGRAPH
+0x9ACE 0x5885  #CJK UNIFIED IDEOGRAPH
+0x9ACF 0x58B9  #CJK UNIFIED IDEOGRAPH
+0x9AD0 0x589F  #CJK UNIFIED IDEOGRAPH
+0x9AD1 0x58AB  #CJK UNIFIED IDEOGRAPH
+0x9AD2 0x58BA  #CJK UNIFIED IDEOGRAPH
+0x9AD3 0x58DE  #CJK UNIFIED IDEOGRAPH
+0x9AD4 0x58BB  #CJK UNIFIED IDEOGRAPH
+0x9AD5 0x58B8  #CJK UNIFIED IDEOGRAPH
+0x9AD6 0x58AE  #CJK UNIFIED IDEOGRAPH
+0x9AD7 0x58C5  #CJK UNIFIED IDEOGRAPH
+0x9AD8 0x58D3  #CJK UNIFIED IDEOGRAPH
+0x9AD9 0x58D1  #CJK UNIFIED IDEOGRAPH
+0x9ADA 0x58D7  #CJK UNIFIED IDEOGRAPH
+0x9ADB 0x58D9  #CJK UNIFIED IDEOGRAPH
+0x9ADC 0x58D8  #CJK UNIFIED IDEOGRAPH
+0x9ADD 0x58E5  #CJK UNIFIED IDEOGRAPH
+0x9ADE 0x58DC  #CJK UNIFIED IDEOGRAPH
+0x9ADF 0x58E4  #CJK UNIFIED IDEOGRAPH
+0x9AE0 0x58DF  #CJK UNIFIED IDEOGRAPH
+0x9AE1 0x58EF  #CJK UNIFIED IDEOGRAPH
+0x9AE2 0x58FA  #CJK UNIFIED IDEOGRAPH
+0x9AE3 0x58F9  #CJK UNIFIED IDEOGRAPH
+0x9AE4 0x58FB  #CJK UNIFIED IDEOGRAPH
+0x9AE5 0x58FC  #CJK UNIFIED IDEOGRAPH
+0x9AE6 0x58FD  #CJK UNIFIED IDEOGRAPH
+0x9AE7 0x5902  #CJK UNIFIED IDEOGRAPH
+0x9AE8 0x590A  #CJK UNIFIED IDEOGRAPH
+0x9AE9 0x5910  #CJK UNIFIED IDEOGRAPH
+0x9AEA 0x591B  #CJK UNIFIED IDEOGRAPH
+0x9AEB 0x68A6  #CJK UNIFIED IDEOGRAPH
+0x9AEC 0x5925  #CJK UNIFIED IDEOGRAPH
+0x9AED 0x592C  #CJK UNIFIED IDEOGRAPH
+0x9AEE 0x592D  #CJK UNIFIED IDEOGRAPH
+0x9AEF 0x5932  #CJK UNIFIED IDEOGRAPH
+0x9AF0 0x5938  #CJK UNIFIED IDEOGRAPH
+0x9AF1 0x593E  #CJK UNIFIED IDEOGRAPH
+0x9AF2 0x7AD2  #CJK UNIFIED IDEOGRAPH
+0x9AF3 0x5955  #CJK UNIFIED IDEOGRAPH
+0x9AF4 0x5950  #CJK UNIFIED IDEOGRAPH
+0x9AF5 0x594E  #CJK UNIFIED IDEOGRAPH
+0x9AF6 0x595A  #CJK UNIFIED IDEOGRAPH
+0x9AF7 0x5958  #CJK UNIFIED IDEOGRAPH
+0x9AF8 0x5962  #CJK UNIFIED IDEOGRAPH
+0x9AF9 0x5960  #CJK UNIFIED IDEOGRAPH
+0x9AFA 0x5967  #CJK UNIFIED IDEOGRAPH
+0x9AFB 0x596C  #CJK UNIFIED IDEOGRAPH
+0x9AFC 0x5969  #CJK UNIFIED IDEOGRAPH
+0x9B40 0x5978  #CJK UNIFIED IDEOGRAPH
+0x9B41 0x5981  #CJK UNIFIED IDEOGRAPH
+0x9B42 0x599D  #CJK UNIFIED IDEOGRAPH
+0x9B43 0x4F5E  #CJK UNIFIED IDEOGRAPH
+0x9B44 0x4FAB  #CJK UNIFIED IDEOGRAPH
+0x9B45 0x59A3  #CJK UNIFIED IDEOGRAPH
+0x9B46 0x59B2  #CJK UNIFIED IDEOGRAPH
+0x9B47 0x59C6  #CJK UNIFIED IDEOGRAPH
+0x9B48 0x59E8  #CJK UNIFIED IDEOGRAPH
+0x9B49 0x59DC  #CJK UNIFIED IDEOGRAPH
+0x9B4A 0x598D  #CJK UNIFIED IDEOGRAPH
+0x9B4B 0x59D9  #CJK UNIFIED IDEOGRAPH
+0x9B4C 0x59DA  #CJK UNIFIED IDEOGRAPH
+0x9B4D 0x5A25  #CJK UNIFIED IDEOGRAPH
+0x9B4E 0x5A1F  #CJK UNIFIED IDEOGRAPH
+0x9B4F 0x5A11  #CJK UNIFIED IDEOGRAPH
+0x9B50 0x5A1C  #CJK UNIFIED IDEOGRAPH
+0x9B51 0x5A09  #CJK UNIFIED IDEOGRAPH
+0x9B52 0x5A1A  #CJK UNIFIED IDEOGRAPH
+0x9B53 0x5A40  #CJK UNIFIED IDEOGRAPH
+0x9B54 0x5A6C  #CJK UNIFIED IDEOGRAPH
+0x9B55 0x5A49  #CJK UNIFIED IDEOGRAPH
+0x9B56 0x5A35  #CJK UNIFIED IDEOGRAPH
+0x9B57 0x5A36  #CJK UNIFIED IDEOGRAPH
+0x9B58 0x5A62  #CJK UNIFIED IDEOGRAPH
+0x9B59 0x5A6A  #CJK UNIFIED IDEOGRAPH
+0x9B5A 0x5A9A  #CJK UNIFIED IDEOGRAPH
+0x9B5B 0x5ABC  #CJK UNIFIED IDEOGRAPH
+0x9B5C 0x5ABE  #CJK UNIFIED IDEOGRAPH
+0x9B5D 0x5ACB  #CJK UNIFIED IDEOGRAPH
+0x9B5E 0x5AC2  #CJK UNIFIED IDEOGRAPH
+0x9B5F 0x5ABD  #CJK UNIFIED IDEOGRAPH
+0x9B60 0x5AE3  #CJK UNIFIED IDEOGRAPH
+0x9B61 0x5AD7  #CJK UNIFIED IDEOGRAPH
+0x9B62 0x5AE6  #CJK UNIFIED IDEOGRAPH
+0x9B63 0x5AE9  #CJK UNIFIED IDEOGRAPH
+0x9B64 0x5AD6  #CJK UNIFIED IDEOGRAPH
+0x9B65 0x5AFA  #CJK UNIFIED IDEOGRAPH
+0x9B66 0x5AFB  #CJK UNIFIED IDEOGRAPH
+0x9B67 0x5B0C  #CJK UNIFIED IDEOGRAPH
+0x9B68 0x5B0B  #CJK UNIFIED IDEOGRAPH
+0x9B69 0x5B16  #CJK UNIFIED IDEOGRAPH
+0x9B6A 0x5B32  #CJK UNIFIED IDEOGRAPH
+0x9B6B 0x5AD0  #CJK UNIFIED IDEOGRAPH
+0x9B6C 0x5B2A  #CJK UNIFIED IDEOGRAPH
+0x9B6D 0x5B36  #CJK UNIFIED IDEOGRAPH
+0x9B6E 0x5B3E  #CJK UNIFIED IDEOGRAPH
+0x9B6F 0x5B43  #CJK UNIFIED IDEOGRAPH
+0x9B70 0x5B45  #CJK UNIFIED IDEOGRAPH
+0x9B71 0x5B40  #CJK UNIFIED IDEOGRAPH
+0x9B72 0x5B51  #CJK UNIFIED IDEOGRAPH
+0x9B73 0x5B55  #CJK UNIFIED IDEOGRAPH
+0x9B74 0x5B5A  #CJK UNIFIED IDEOGRAPH
+0x9B75 0x5B5B  #CJK UNIFIED IDEOGRAPH
+0x9B76 0x5B65  #CJK UNIFIED IDEOGRAPH
+0x9B77 0x5B69  #CJK UNIFIED IDEOGRAPH
+0x9B78 0x5B70  #CJK UNIFIED IDEOGRAPH
+0x9B79 0x5B73  #CJK UNIFIED IDEOGRAPH
+0x9B7A 0x5B75  #CJK UNIFIED IDEOGRAPH
+0x9B7B 0x5B78  #CJK UNIFIED IDEOGRAPH
+0x9B7C 0x6588  #CJK UNIFIED IDEOGRAPH
+0x9B7D 0x5B7A  #CJK UNIFIED IDEOGRAPH
+0x9B7E 0x5B80  #CJK UNIFIED IDEOGRAPH
+0x9B80 0x5B83  #CJK UNIFIED IDEOGRAPH
+0x9B81 0x5BA6  #CJK UNIFIED IDEOGRAPH
+0x9B82 0x5BB8  #CJK UNIFIED IDEOGRAPH
+0x9B83 0x5BC3  #CJK UNIFIED IDEOGRAPH
+0x9B84 0x5BC7  #CJK UNIFIED IDEOGRAPH
+0x9B85 0x5BC9  #CJK UNIFIED IDEOGRAPH
+0x9B86 0x5BD4  #CJK UNIFIED IDEOGRAPH
+0x9B87 0x5BD0  #CJK UNIFIED IDEOGRAPH
+0x9B88 0x5BE4  #CJK UNIFIED IDEOGRAPH
+0x9B89 0x5BE6  #CJK UNIFIED IDEOGRAPH
+0x9B8A 0x5BE2  #CJK UNIFIED IDEOGRAPH
+0x9B8B 0x5BDE  #CJK UNIFIED IDEOGRAPH
+0x9B8C 0x5BE5  #CJK UNIFIED IDEOGRAPH
+0x9B8D 0x5BEB  #CJK UNIFIED IDEOGRAPH
+0x9B8E 0x5BF0  #CJK UNIFIED IDEOGRAPH
+0x9B8F 0x5BF6  #CJK UNIFIED IDEOGRAPH
+0x9B90 0x5BF3  #CJK UNIFIED IDEOGRAPH
+0x9B91 0x5C05  #CJK UNIFIED IDEOGRAPH
+0x9B92 0x5C07  #CJK UNIFIED IDEOGRAPH
+0x9B93 0x5C08  #CJK UNIFIED IDEOGRAPH
+0x9B94 0x5C0D  #CJK UNIFIED IDEOGRAPH
+0x9B95 0x5C13  #CJK UNIFIED IDEOGRAPH
+0x9B96 0x5C20  #CJK UNIFIED IDEOGRAPH
+0x9B97 0x5C22  #CJK UNIFIED IDEOGRAPH
+0x9B98 0x5C28  #CJK UNIFIED IDEOGRAPH
+0x9B99 0x5C38  #CJK UNIFIED IDEOGRAPH
+0x9B9A 0x5C39  #CJK UNIFIED IDEOGRAPH
+0x9B9B 0x5C41  #CJK UNIFIED IDEOGRAPH
+0x9B9C 0x5C46  #CJK UNIFIED IDEOGRAPH
+0x9B9D 0x5C4E  #CJK UNIFIED IDEOGRAPH
+0x9B9E 0x5C53  #CJK UNIFIED IDEOGRAPH
+0x9B9F 0x5C50  #CJK UNIFIED IDEOGRAPH
+0x9BA0 0x5C4F  #CJK UNIFIED IDEOGRAPH
+0x9BA1 0x5B71  #CJK UNIFIED IDEOGRAPH
+0x9BA2 0x5C6C  #CJK UNIFIED IDEOGRAPH
+0x9BA3 0x5C6E  #CJK UNIFIED IDEOGRAPH
+0x9BA4 0x4E62  #CJK UNIFIED IDEOGRAPH
+0x9BA5 0x5C76  #CJK UNIFIED IDEOGRAPH
+0x9BA6 0x5C79  #CJK UNIFIED IDEOGRAPH
+0x9BA7 0x5C8C  #CJK UNIFIED IDEOGRAPH
+0x9BA8 0x5C91  #CJK UNIFIED IDEOGRAPH
+0x9BA9 0x5C94  #CJK UNIFIED IDEOGRAPH
+0x9BAA 0x599B  #CJK UNIFIED IDEOGRAPH
+0x9BAB 0x5CAB  #CJK UNIFIED IDEOGRAPH
+0x9BAC 0x5CBB  #CJK UNIFIED IDEOGRAPH
+0x9BAD 0x5CB6  #CJK UNIFIED IDEOGRAPH
+0x9BAE 0x5CBC  #CJK UNIFIED IDEOGRAPH
+0x9BAF 0x5CB7  #CJK UNIFIED IDEOGRAPH
+0x9BB0 0x5CC5  #CJK UNIFIED IDEOGRAPH
+0x9BB1 0x5CBE  #CJK UNIFIED IDEOGRAPH
+0x9BB2 0x5CC7  #CJK UNIFIED IDEOGRAPH
+0x9BB3 0x5CD9  #CJK UNIFIED IDEOGRAPH
+0x9BB4 0x5CE9  #CJK UNIFIED IDEOGRAPH
+0x9BB5 0x5CFD  #CJK UNIFIED IDEOGRAPH
+0x9BB6 0x5CFA  #CJK UNIFIED IDEOGRAPH
+0x9BB7 0x5CED  #CJK UNIFIED IDEOGRAPH
+0x9BB8 0x5D8C  #CJK UNIFIED IDEOGRAPH
+0x9BB9 0x5CEA  #CJK UNIFIED IDEOGRAPH
+0x9BBA 0x5D0B  #CJK UNIFIED IDEOGRAPH
+0x9BBB 0x5D15  #CJK UNIFIED IDEOGRAPH
+0x9BBC 0x5D17  #CJK UNIFIED IDEOGRAPH
+0x9BBD 0x5D5C  #CJK UNIFIED IDEOGRAPH
+0x9BBE 0x5D1F  #CJK UNIFIED IDEOGRAPH
+0x9BBF 0x5D1B  #CJK UNIFIED IDEOGRAPH
+0x9BC0 0x5D11  #CJK UNIFIED IDEOGRAPH
+0x9BC1 0x5D14  #CJK UNIFIED IDEOGRAPH
+0x9BC2 0x5D22  #CJK UNIFIED IDEOGRAPH
+0x9BC3 0x5D1A  #CJK UNIFIED IDEOGRAPH
+0x9BC4 0x5D19  #CJK UNIFIED IDEOGRAPH
+0x9BC5 0x5D18  #CJK UNIFIED IDEOGRAPH
+0x9BC6 0x5D4C  #CJK UNIFIED IDEOGRAPH
+0x9BC7 0x5D52  #CJK UNIFIED IDEOGRAPH
+0x9BC8 0x5D4E  #CJK UNIFIED IDEOGRAPH
+0x9BC9 0x5D4B  #CJK UNIFIED IDEOGRAPH
+0x9BCA 0x5D6C  #CJK UNIFIED IDEOGRAPH
+0x9BCB 0x5D73  #CJK UNIFIED IDEOGRAPH
+0x9BCC 0x5D76  #CJK UNIFIED IDEOGRAPH
+0x9BCD 0x5D87  #CJK UNIFIED IDEOGRAPH
+0x9BCE 0x5D84  #CJK UNIFIED IDEOGRAPH
+0x9BCF 0x5D82  #CJK UNIFIED IDEOGRAPH
+0x9BD0 0x5DA2  #CJK UNIFIED IDEOGRAPH
+0x9BD1 0x5D9D  #CJK UNIFIED IDEOGRAPH
+0x9BD2 0x5DAC  #CJK UNIFIED IDEOGRAPH
+0x9BD3 0x5DAE  #CJK UNIFIED IDEOGRAPH
+0x9BD4 0x5DBD  #CJK UNIFIED IDEOGRAPH
+0x9BD5 0x5D90  #CJK UNIFIED IDEOGRAPH
+0x9BD6 0x5DB7  #CJK UNIFIED IDEOGRAPH
+0x9BD7 0x5DBC  #CJK UNIFIED IDEOGRAPH
+0x9BD8 0x5DC9  #CJK UNIFIED IDEOGRAPH
+0x9BD9 0x5DCD  #CJK UNIFIED IDEOGRAPH
+0x9BDA 0x5DD3  #CJK UNIFIED IDEOGRAPH
+0x9BDB 0x5DD2  #CJK UNIFIED IDEOGRAPH
+0x9BDC 0x5DD6  #CJK UNIFIED IDEOGRAPH
+0x9BDD 0x5DDB  #CJK UNIFIED IDEOGRAPH
+0x9BDE 0x5DEB  #CJK UNIFIED IDEOGRAPH
+0x9BDF 0x5DF2  #CJK UNIFIED IDEOGRAPH
+0x9BE0 0x5DF5  #CJK UNIFIED IDEOGRAPH
+0x9BE1 0x5E0B  #CJK UNIFIED IDEOGRAPH
+0x9BE2 0x5E1A  #CJK UNIFIED IDEOGRAPH
+0x9BE3 0x5E19  #CJK UNIFIED IDEOGRAPH
+0x9BE4 0x5E11  #CJK UNIFIED IDEOGRAPH
+0x9BE5 0x5E1B  #CJK UNIFIED IDEOGRAPH
+0x9BE6 0x5E36  #CJK UNIFIED IDEOGRAPH
+0x9BE7 0x5E37  #CJK UNIFIED IDEOGRAPH
+0x9BE8 0x5E44  #CJK UNIFIED IDEOGRAPH
+0x9BE9 0x5E43  #CJK UNIFIED IDEOGRAPH
+0x9BEA 0x5E40  #CJK UNIFIED IDEOGRAPH
+0x9BEB 0x5E4E  #CJK UNIFIED IDEOGRAPH
+0x9BEC 0x5E57  #CJK UNIFIED IDEOGRAPH
+0x9BED 0x5E54  #CJK UNIFIED IDEOGRAPH
+0x9BEE 0x5E5F  #CJK UNIFIED IDEOGRAPH
+0x9BEF 0x5E62  #CJK UNIFIED IDEOGRAPH
+0x9BF0 0x5E64  #CJK UNIFIED IDEOGRAPH
+0x9BF1 0x5E47  #CJK UNIFIED IDEOGRAPH
+0x9BF2 0x5E75  #CJK UNIFIED IDEOGRAPH
+0x9BF3 0x5E76  #CJK UNIFIED IDEOGRAPH
+0x9BF4 0x5E7A  #CJK UNIFIED IDEOGRAPH
+0x9BF5 0x9EBC  #CJK UNIFIED IDEOGRAPH
+0x9BF6 0x5E7F  #CJK UNIFIED IDEOGRAPH
+0x9BF7 0x5EA0  #CJK UNIFIED IDEOGRAPH
+0x9BF8 0x5EC1  #CJK UNIFIED IDEOGRAPH
+0x9BF9 0x5EC2  #CJK UNIFIED IDEOGRAPH
+0x9BFA 0x5EC8  #CJK UNIFIED IDEOGRAPH
+0x9BFB 0x5ED0  #CJK UNIFIED IDEOGRAPH
+0x9BFC 0x5ECF  #CJK UNIFIED IDEOGRAPH
+0x9C40 0x5ED6  #CJK UNIFIED IDEOGRAPH
+0x9C41 0x5EE3  #CJK UNIFIED IDEOGRAPH
+0x9C42 0x5EDD  #CJK UNIFIED IDEOGRAPH
+0x9C43 0x5EDA  #CJK UNIFIED IDEOGRAPH
+0x9C44 0x5EDB  #CJK UNIFIED IDEOGRAPH
+0x9C45 0x5EE2  #CJK UNIFIED IDEOGRAPH
+0x9C46 0x5EE1  #CJK UNIFIED IDEOGRAPH
+0x9C47 0x5EE8  #CJK UNIFIED IDEOGRAPH
+0x9C48 0x5EE9  #CJK UNIFIED IDEOGRAPH
+0x9C49 0x5EEC  #CJK UNIFIED IDEOGRAPH
+0x9C4A 0x5EF1  #CJK UNIFIED IDEOGRAPH
+0x9C4B 0x5EF3  #CJK UNIFIED IDEOGRAPH
+0x9C4C 0x5EF0  #CJK UNIFIED IDEOGRAPH
+0x9C4D 0x5EF4  #CJK UNIFIED IDEOGRAPH
+0x9C4E 0x5EF8  #CJK UNIFIED IDEOGRAPH
+0x9C4F 0x5EFE  #CJK UNIFIED IDEOGRAPH
+0x9C50 0x5F03  #CJK UNIFIED IDEOGRAPH
+0x9C51 0x5F09  #CJK UNIFIED IDEOGRAPH
+0x9C52 0x5F5D  #CJK UNIFIED IDEOGRAPH
+0x9C53 0x5F5C  #CJK UNIFIED IDEOGRAPH
+0x9C54 0x5F0B  #CJK UNIFIED IDEOGRAPH
+0x9C55 0x5F11  #CJK UNIFIED IDEOGRAPH
+0x9C56 0x5F16  #CJK UNIFIED IDEOGRAPH
+0x9C57 0x5F29  #CJK UNIFIED IDEOGRAPH
+0x9C58 0x5F2D  #CJK UNIFIED IDEOGRAPH
+0x9C59 0x5F38  #CJK UNIFIED IDEOGRAPH
+0x9C5A 0x5F41  #CJK UNIFIED IDEOGRAPH
+0x9C5B 0x5F48  #CJK UNIFIED IDEOGRAPH
+0x9C5C 0x5F4C  #CJK UNIFIED IDEOGRAPH
+0x9C5D 0x5F4E  #CJK UNIFIED IDEOGRAPH
+0x9C5E 0x5F2F  #CJK UNIFIED IDEOGRAPH
+0x9C5F 0x5F51  #CJK UNIFIED IDEOGRAPH
+0x9C60 0x5F56  #CJK UNIFIED IDEOGRAPH
+0x9C61 0x5F57  #CJK UNIFIED IDEOGRAPH
+0x9C62 0x5F59  #CJK UNIFIED IDEOGRAPH
+0x9C63 0x5F61  #CJK UNIFIED IDEOGRAPH
+0x9C64 0x5F6D  #CJK UNIFIED IDEOGRAPH
+0x9C65 0x5F73  #CJK UNIFIED IDEOGRAPH
+0x9C66 0x5F77  #CJK UNIFIED IDEOGRAPH
+0x9C67 0x5F83  #CJK UNIFIED IDEOGRAPH
+0x9C68 0x5F82  #CJK UNIFIED IDEOGRAPH
+0x9C69 0x5F7F  #CJK UNIFIED IDEOGRAPH
+0x9C6A 0x5F8A  #CJK UNIFIED IDEOGRAPH
+0x9C6B 0x5F88  #CJK UNIFIED IDEOGRAPH
+0x9C6C 0x5F91  #CJK UNIFIED IDEOGRAPH
+0x9C6D 0x5F87  #CJK UNIFIED IDEOGRAPH
+0x9C6E 0x5F9E  #CJK UNIFIED IDEOGRAPH
+0x9C6F 0x5F99  #CJK UNIFIED IDEOGRAPH
+0x9C70 0x5F98  #CJK UNIFIED IDEOGRAPH
+0x9C71 0x5FA0  #CJK UNIFIED IDEOGRAPH
+0x9C72 0x5FA8  #CJK UNIFIED IDEOGRAPH
+0x9C73 0x5FAD  #CJK UNIFIED IDEOGRAPH
+0x9C74 0x5FBC  #CJK UNIFIED IDEOGRAPH
+0x9C75 0x5FD6  #CJK UNIFIED IDEOGRAPH
+0x9C76 0x5FFB  #CJK UNIFIED IDEOGRAPH
+0x9C77 0x5FE4  #CJK UNIFIED IDEOGRAPH
+0x9C78 0x5FF8  #CJK UNIFIED IDEOGRAPH
+0x9C79 0x5FF1  #CJK UNIFIED IDEOGRAPH
+0x9C7A 0x5FDD  #CJK UNIFIED IDEOGRAPH
+0x9C7B 0x60B3  #CJK UNIFIED IDEOGRAPH
+0x9C7C 0x5FFF  #CJK UNIFIED IDEOGRAPH
+0x9C7D 0x6021  #CJK UNIFIED IDEOGRAPH
+0x9C7E 0x6060  #CJK UNIFIED IDEOGRAPH
+0x9C80 0x6019  #CJK UNIFIED IDEOGRAPH
+0x9C81 0x6010  #CJK UNIFIED IDEOGRAPH
+0x9C82 0x6029  #CJK UNIFIED IDEOGRAPH
+0x9C83 0x600E  #CJK UNIFIED IDEOGRAPH
+0x9C84 0x6031  #CJK UNIFIED IDEOGRAPH
+0x9C85 0x601B  #CJK UNIFIED IDEOGRAPH
+0x9C86 0x6015  #CJK UNIFIED IDEOGRAPH
+0x9C87 0x602B  #CJK UNIFIED IDEOGRAPH
+0x9C88 0x6026  #CJK UNIFIED IDEOGRAPH
+0x9C89 0x600F  #CJK UNIFIED IDEOGRAPH
+0x9C8A 0x603A  #CJK UNIFIED IDEOGRAPH
+0x9C8B 0x605A  #CJK UNIFIED IDEOGRAPH
+0x9C8C 0x6041  #CJK UNIFIED IDEOGRAPH
+0x9C8D 0x606A  #CJK UNIFIED IDEOGRAPH
+0x9C8E 0x6077  #CJK UNIFIED IDEOGRAPH
+0x9C8F 0x605F  #CJK UNIFIED IDEOGRAPH
+0x9C90 0x604A  #CJK UNIFIED IDEOGRAPH
+0x9C91 0x6046  #CJK UNIFIED IDEOGRAPH
+0x9C92 0x604D  #CJK UNIFIED IDEOGRAPH
+0x9C93 0x6063  #CJK UNIFIED IDEOGRAPH
+0x9C94 0x6043  #CJK UNIFIED IDEOGRAPH
+0x9C95 0x6064  #CJK UNIFIED IDEOGRAPH
+0x9C96 0x6042  #CJK UNIFIED IDEOGRAPH
+0x9C97 0x606C  #CJK UNIFIED IDEOGRAPH
+0x9C98 0x606B  #CJK UNIFIED IDEOGRAPH
+0x9C99 0x6059  #CJK UNIFIED IDEOGRAPH
+0x9C9A 0x6081  #CJK UNIFIED IDEOGRAPH
+0x9C9B 0x608D  #CJK UNIFIED IDEOGRAPH
+0x9C9C 0x60E7  #CJK UNIFIED IDEOGRAPH
+0x9C9D 0x6083  #CJK UNIFIED IDEOGRAPH
+0x9C9E 0x609A  #CJK UNIFIED IDEOGRAPH
+0x9C9F 0x6084  #CJK UNIFIED IDEOGRAPH
+0x9CA0 0x609B  #CJK UNIFIED IDEOGRAPH
+0x9CA1 0x6096  #CJK UNIFIED IDEOGRAPH
+0x9CA2 0x6097  #CJK UNIFIED IDEOGRAPH
+0x9CA3 0x6092  #CJK UNIFIED IDEOGRAPH
+0x9CA4 0x60A7  #CJK UNIFIED IDEOGRAPH
+0x9CA5 0x608B  #CJK UNIFIED IDEOGRAPH
+0x9CA6 0x60E1  #CJK UNIFIED IDEOGRAPH
+0x9CA7 0x60B8  #CJK UNIFIED IDEOGRAPH
+0x9CA8 0x60E0  #CJK UNIFIED IDEOGRAPH
+0x9CA9 0x60D3  #CJK UNIFIED IDEOGRAPH
+0x9CAA 0x60B4  #CJK UNIFIED IDEOGRAPH
+0x9CAB 0x5FF0  #CJK UNIFIED IDEOGRAPH
+0x9CAC 0x60BD  #CJK UNIFIED IDEOGRAPH
+0x9CAD 0x60C6  #CJK UNIFIED IDEOGRAPH
+0x9CAE 0x60B5  #CJK UNIFIED IDEOGRAPH
+0x9CAF 0x60D8  #CJK UNIFIED IDEOGRAPH
+0x9CB0 0x614D  #CJK UNIFIED IDEOGRAPH
+0x9CB1 0x6115  #CJK UNIFIED IDEOGRAPH
+0x9CB2 0x6106  #CJK UNIFIED IDEOGRAPH
+0x9CB3 0x60F6  #CJK UNIFIED IDEOGRAPH
+0x9CB4 0x60F7  #CJK UNIFIED IDEOGRAPH
+0x9CB5 0x6100  #CJK UNIFIED IDEOGRAPH
+0x9CB6 0x60F4  #CJK UNIFIED IDEOGRAPH
+0x9CB7 0x60FA  #CJK UNIFIED IDEOGRAPH
+0x9CB8 0x6103  #CJK UNIFIED IDEOGRAPH
+0x9CB9 0x6121  #CJK UNIFIED IDEOGRAPH
+0x9CBA 0x60FB  #CJK UNIFIED IDEOGRAPH
+0x9CBB 0x60F1  #CJK UNIFIED IDEOGRAPH
+0x9CBC 0x610D  #CJK UNIFIED IDEOGRAPH
+0x9CBD 0x610E  #CJK UNIFIED IDEOGRAPH
+0x9CBE 0x6147  #CJK UNIFIED IDEOGRAPH
+0x9CBF 0x613E  #CJK UNIFIED IDEOGRAPH
+0x9CC0 0x6128  #CJK UNIFIED IDEOGRAPH
+0x9CC1 0x6127  #CJK UNIFIED IDEOGRAPH
+0x9CC2 0x614A  #CJK UNIFIED IDEOGRAPH
+0x9CC3 0x613F  #CJK UNIFIED IDEOGRAPH
+0x9CC4 0x613C  #CJK UNIFIED IDEOGRAPH
+0x9CC5 0x612C  #CJK UNIFIED IDEOGRAPH
+0x9CC6 0x6134  #CJK UNIFIED IDEOGRAPH
+0x9CC7 0x613D  #CJK UNIFIED IDEOGRAPH
+0x9CC8 0x6142  #CJK UNIFIED IDEOGRAPH
+0x9CC9 0x6144  #CJK UNIFIED IDEOGRAPH
+0x9CCA 0x6173  #CJK UNIFIED IDEOGRAPH
+0x9CCB 0x6177  #CJK UNIFIED IDEOGRAPH
+0x9CCC 0x6158  #CJK UNIFIED IDEOGRAPH
+0x9CCD 0x6159  #CJK UNIFIED IDEOGRAPH
+0x9CCE 0x615A  #CJK UNIFIED IDEOGRAPH
+0x9CCF 0x616B  #CJK UNIFIED IDEOGRAPH
+0x9CD0 0x6174  #CJK UNIFIED IDEOGRAPH
+0x9CD1 0x616F  #CJK UNIFIED IDEOGRAPH
+0x9CD2 0x6165  #CJK UNIFIED IDEOGRAPH
+0x9CD3 0x6171  #CJK UNIFIED IDEOGRAPH
+0x9CD4 0x615F  #CJK UNIFIED IDEOGRAPH
+0x9CD5 0x615D  #CJK UNIFIED IDEOGRAPH
+0x9CD6 0x6153  #CJK UNIFIED IDEOGRAPH
+0x9CD7 0x6175  #CJK UNIFIED IDEOGRAPH
+0x9CD8 0x6199  #CJK UNIFIED IDEOGRAPH
+0x9CD9 0x6196  #CJK UNIFIED IDEOGRAPH
+0x9CDA 0x6187  #CJK UNIFIED IDEOGRAPH
+0x9CDB 0x61AC  #CJK UNIFIED IDEOGRAPH
+0x9CDC 0x6194  #CJK UNIFIED IDEOGRAPH
+0x9CDD 0x619A  #CJK UNIFIED IDEOGRAPH
+0x9CDE 0x618A  #CJK UNIFIED IDEOGRAPH
+0x9CDF 0x6191  #CJK UNIFIED IDEOGRAPH
+0x9CE0 0x61AB  #CJK UNIFIED IDEOGRAPH
+0x9CE1 0x61AE  #CJK UNIFIED IDEOGRAPH
+0x9CE2 0x61CC  #CJK UNIFIED IDEOGRAPH
+0x9CE3 0x61CA  #CJK UNIFIED IDEOGRAPH
+0x9CE4 0x61C9  #CJK UNIFIED IDEOGRAPH
+0x9CE5 0x61F7  #CJK UNIFIED IDEOGRAPH
+0x9CE6 0x61C8  #CJK UNIFIED IDEOGRAPH
+0x9CE7 0x61C3  #CJK UNIFIED IDEOGRAPH
+0x9CE8 0x61C6  #CJK UNIFIED IDEOGRAPH
+0x9CE9 0x61BA  #CJK UNIFIED IDEOGRAPH
+0x9CEA 0x61CB  #CJK UNIFIED IDEOGRAPH
+0x9CEB 0x7F79  #CJK UNIFIED IDEOGRAPH
+0x9CEC 0x61CD  #CJK UNIFIED IDEOGRAPH
+0x9CED 0x61E6  #CJK UNIFIED IDEOGRAPH
+0x9CEE 0x61E3  #CJK UNIFIED IDEOGRAPH
+0x9CEF 0x61F6  #CJK UNIFIED IDEOGRAPH
+0x9CF0 0x61FA  #CJK UNIFIED IDEOGRAPH
+0x9CF1 0x61F4  #CJK UNIFIED IDEOGRAPH
+0x9CF2 0x61FF  #CJK UNIFIED IDEOGRAPH
+0x9CF3 0x61FD  #CJK UNIFIED IDEOGRAPH
+0x9CF4 0x61FC  #CJK UNIFIED IDEOGRAPH
+0x9CF5 0x61FE  #CJK UNIFIED IDEOGRAPH
+0x9CF6 0x6200  #CJK UNIFIED IDEOGRAPH
+0x9CF7 0x6208  #CJK UNIFIED IDEOGRAPH
+0x9CF8 0x6209  #CJK UNIFIED IDEOGRAPH
+0x9CF9 0x620D  #CJK UNIFIED IDEOGRAPH
+0x9CFA 0x620C  #CJK UNIFIED IDEOGRAPH
+0x9CFB 0x6214  #CJK UNIFIED IDEOGRAPH
+0x9CFC 0x621B  #CJK UNIFIED IDEOGRAPH
+0x9D40 0x621E  #CJK UNIFIED IDEOGRAPH
+0x9D41 0x6221  #CJK UNIFIED IDEOGRAPH
+0x9D42 0x622A  #CJK UNIFIED IDEOGRAPH
+0x9D43 0x622E  #CJK UNIFIED IDEOGRAPH
+0x9D44 0x6230  #CJK UNIFIED IDEOGRAPH
+0x9D45 0x6232  #CJK UNIFIED IDEOGRAPH
+0x9D46 0x6233  #CJK UNIFIED IDEOGRAPH
+0x9D47 0x6241  #CJK UNIFIED IDEOGRAPH
+0x9D48 0x624E  #CJK UNIFIED IDEOGRAPH
+0x9D49 0x625E  #CJK UNIFIED IDEOGRAPH
+0x9D4A 0x6263  #CJK UNIFIED IDEOGRAPH
+0x9D4B 0x625B  #CJK UNIFIED IDEOGRAPH
+0x9D4C 0x6260  #CJK UNIFIED IDEOGRAPH
+0x9D4D 0x6268  #CJK UNIFIED IDEOGRAPH
+0x9D4E 0x627C  #CJK UNIFIED IDEOGRAPH
+0x9D4F 0x6282  #CJK UNIFIED IDEOGRAPH
+0x9D50 0x6289  #CJK UNIFIED IDEOGRAPH
+0x9D51 0x627E  #CJK UNIFIED IDEOGRAPH
+0x9D52 0x6292  #CJK UNIFIED IDEOGRAPH
+0x9D53 0x6293  #CJK UNIFIED IDEOGRAPH
+0x9D54 0x6296  #CJK UNIFIED IDEOGRAPH
+0x9D55 0x62D4  #CJK UNIFIED IDEOGRAPH
+0x9D56 0x6283  #CJK UNIFIED IDEOGRAPH
+0x9D57 0x6294  #CJK UNIFIED IDEOGRAPH
+0x9D58 0x62D7  #CJK UNIFIED IDEOGRAPH
+0x9D59 0x62D1  #CJK UNIFIED IDEOGRAPH
+0x9D5A 0x62BB  #CJK UNIFIED IDEOGRAPH
+0x9D5B 0x62CF  #CJK UNIFIED IDEOGRAPH
+0x9D5C 0x62FF  #CJK UNIFIED IDEOGRAPH
+0x9D5D 0x62C6  #CJK UNIFIED IDEOGRAPH
+0x9D5E 0x64D4  #CJK UNIFIED IDEOGRAPH
+0x9D5F 0x62C8  #CJK UNIFIED IDEOGRAPH
+0x9D60 0x62DC  #CJK UNIFIED IDEOGRAPH
+0x9D61 0x62CC  #CJK UNIFIED IDEOGRAPH
+0x9D62 0x62CA  #CJK UNIFIED IDEOGRAPH
+0x9D63 0x62C2  #CJK UNIFIED IDEOGRAPH
+0x9D64 0x62C7  #CJK UNIFIED IDEOGRAPH
+0x9D65 0x629B  #CJK UNIFIED IDEOGRAPH
+0x9D66 0x62C9  #CJK UNIFIED IDEOGRAPH
+0x9D67 0x630C  #CJK UNIFIED IDEOGRAPH
+0x9D68 0x62EE  #CJK UNIFIED IDEOGRAPH
+0x9D69 0x62F1  #CJK UNIFIED IDEOGRAPH
+0x9D6A 0x6327  #CJK UNIFIED IDEOGRAPH
+0x9D6B 0x6302  #CJK UNIFIED IDEOGRAPH
+0x9D6C 0x6308  #CJK UNIFIED IDEOGRAPH
+0x9D6D 0x62EF  #CJK UNIFIED IDEOGRAPH
+0x9D6E 0x62F5  #CJK UNIFIED IDEOGRAPH
+0x9D6F 0x6350  #CJK UNIFIED IDEOGRAPH
+0x9D70 0x633E  #CJK UNIFIED IDEOGRAPH
+0x9D71 0x634D  #CJK UNIFIED IDEOGRAPH
+0x9D72 0x641C  #CJK UNIFIED IDEOGRAPH
+0x9D73 0x634F  #CJK UNIFIED IDEOGRAPH
+0x9D74 0x6396  #CJK UNIFIED IDEOGRAPH
+0x9D75 0x638E  #CJK UNIFIED IDEOGRAPH
+0x9D76 0x6380  #CJK UNIFIED IDEOGRAPH
+0x9D77 0x63AB  #CJK UNIFIED IDEOGRAPH
+0x9D78 0x6376  #CJK UNIFIED IDEOGRAPH
+0x9D79 0x63A3  #CJK UNIFIED IDEOGRAPH
+0x9D7A 0x638F  #CJK UNIFIED IDEOGRAPH
+0x9D7B 0x6389  #CJK UNIFIED IDEOGRAPH
+0x9D7C 0x639F  #CJK UNIFIED IDEOGRAPH
+0x9D7D 0x63B5  #CJK UNIFIED IDEOGRAPH
+0x9D7E 0x636B  #CJK UNIFIED IDEOGRAPH
+0x9D80 0x6369  #CJK UNIFIED IDEOGRAPH
+0x9D81 0x63BE  #CJK UNIFIED IDEOGRAPH
+0x9D82 0x63E9  #CJK UNIFIED IDEOGRAPH
+0x9D83 0x63C0  #CJK UNIFIED IDEOGRAPH
+0x9D84 0x63C6  #CJK UNIFIED IDEOGRAPH
+0x9D85 0x63E3  #CJK UNIFIED IDEOGRAPH
+0x9D86 0x63C9  #CJK UNIFIED IDEOGRAPH
+0x9D87 0x63D2  #CJK UNIFIED IDEOGRAPH
+0x9D88 0x63F6  #CJK UNIFIED IDEOGRAPH
+0x9D89 0x63C4  #CJK UNIFIED IDEOGRAPH
+0x9D8A 0x6416  #CJK UNIFIED IDEOGRAPH
+0x9D8B 0x6434  #CJK UNIFIED IDEOGRAPH
+0x9D8C 0x6406  #CJK UNIFIED IDEOGRAPH
+0x9D8D 0x6413  #CJK UNIFIED IDEOGRAPH
+0x9D8E 0x6426  #CJK UNIFIED IDEOGRAPH
+0x9D8F 0x6436  #CJK UNIFIED IDEOGRAPH
+0x9D90 0x651D  #CJK UNIFIED IDEOGRAPH
+0x9D91 0x6417  #CJK UNIFIED IDEOGRAPH
+0x9D92 0x6428  #CJK UNIFIED IDEOGRAPH
+0x9D93 0x640F  #CJK UNIFIED IDEOGRAPH
+0x9D94 0x6467  #CJK UNIFIED IDEOGRAPH
+0x9D95 0x646F  #CJK UNIFIED IDEOGRAPH
+0x9D96 0x6476  #CJK UNIFIED IDEOGRAPH
+0x9D97 0x644E  #CJK UNIFIED IDEOGRAPH
+0x9D98 0x652A  #CJK UNIFIED IDEOGRAPH
+0x9D99 0x6495  #CJK UNIFIED IDEOGRAPH
+0x9D9A 0x6493  #CJK UNIFIED IDEOGRAPH
+0x9D9B 0x64A5  #CJK UNIFIED IDEOGRAPH
+0x9D9C 0x64A9  #CJK UNIFIED IDEOGRAPH
+0x9D9D 0x6488  #CJK UNIFIED IDEOGRAPH
+0x9D9E 0x64BC  #CJK UNIFIED IDEOGRAPH
+0x9D9F 0x64DA  #CJK UNIFIED IDEOGRAPH
+0x9DA0 0x64D2  #CJK UNIFIED IDEOGRAPH
+0x9DA1 0x64C5  #CJK UNIFIED IDEOGRAPH
+0x9DA2 0x64C7  #CJK UNIFIED IDEOGRAPH
+0x9DA3 0x64BB  #CJK UNIFIED IDEOGRAPH
+0x9DA4 0x64D8  #CJK UNIFIED IDEOGRAPH
+0x9DA5 0x64C2  #CJK UNIFIED IDEOGRAPH
+0x9DA6 0x64F1  #CJK UNIFIED IDEOGRAPH
+0x9DA7 0x64E7  #CJK UNIFIED IDEOGRAPH
+0x9DA8 0x8209  #CJK UNIFIED IDEOGRAPH
+0x9DA9 0x64E0  #CJK UNIFIED IDEOGRAPH
+0x9DAA 0x64E1  #CJK UNIFIED IDEOGRAPH
+0x9DAB 0x62AC  #CJK UNIFIED IDEOGRAPH
+0x9DAC 0x64E3  #CJK UNIFIED IDEOGRAPH
+0x9DAD 0x64EF  #CJK UNIFIED IDEOGRAPH
+0x9DAE 0x652C  #CJK UNIFIED IDEOGRAPH
+0x9DAF 0x64F6  #CJK UNIFIED IDEOGRAPH
+0x9DB0 0x64F4  #CJK UNIFIED IDEOGRAPH
+0x9DB1 0x64F2  #CJK UNIFIED IDEOGRAPH
+0x9DB2 0x64FA  #CJK UNIFIED IDEOGRAPH
+0x9DB3 0x6500  #CJK UNIFIED IDEOGRAPH
+0x9DB4 0x64FD  #CJK UNIFIED IDEOGRAPH
+0x9DB5 0x6518  #CJK UNIFIED IDEOGRAPH
+0x9DB6 0x651C  #CJK UNIFIED IDEOGRAPH
+0x9DB7 0x6505  #CJK UNIFIED IDEOGRAPH
+0x9DB8 0x6524  #CJK UNIFIED IDEOGRAPH
+0x9DB9 0x6523  #CJK UNIFIED IDEOGRAPH
+0x9DBA 0x652B  #CJK UNIFIED IDEOGRAPH
+0x9DBB 0x6534  #CJK UNIFIED IDEOGRAPH
+0x9DBC 0x6535  #CJK UNIFIED IDEOGRAPH
+0x9DBD 0x6537  #CJK UNIFIED IDEOGRAPH
+0x9DBE 0x6536  #CJK UNIFIED IDEOGRAPH
+0x9DBF 0x6538  #CJK UNIFIED IDEOGRAPH
+0x9DC0 0x754B  #CJK UNIFIED IDEOGRAPH
+0x9DC1 0x6548  #CJK UNIFIED IDEOGRAPH
+0x9DC2 0x6556  #CJK UNIFIED IDEOGRAPH
+0x9DC3 0x6555  #CJK UNIFIED IDEOGRAPH
+0x9DC4 0x654D  #CJK UNIFIED IDEOGRAPH
+0x9DC5 0x6558  #CJK UNIFIED IDEOGRAPH
+0x9DC6 0x655E  #CJK UNIFIED IDEOGRAPH
+0x9DC7 0x655D  #CJK UNIFIED IDEOGRAPH
+0x9DC8 0x6572  #CJK UNIFIED IDEOGRAPH
+0x9DC9 0x6578  #CJK UNIFIED IDEOGRAPH
+0x9DCA 0x6582  #CJK UNIFIED IDEOGRAPH
+0x9DCB 0x6583  #CJK UNIFIED IDEOGRAPH
+0x9DCC 0x8B8A  #CJK UNIFIED IDEOGRAPH
+0x9DCD 0x659B  #CJK UNIFIED IDEOGRAPH
+0x9DCE 0x659F  #CJK UNIFIED IDEOGRAPH
+0x9DCF 0x65AB  #CJK UNIFIED IDEOGRAPH
+0x9DD0 0x65B7  #CJK UNIFIED IDEOGRAPH
+0x9DD1 0x65C3  #CJK UNIFIED IDEOGRAPH
+0x9DD2 0x65C6  #CJK UNIFIED IDEOGRAPH
+0x9DD3 0x65C1  #CJK UNIFIED IDEOGRAPH
+0x9DD4 0x65C4  #CJK UNIFIED IDEOGRAPH
+0x9DD5 0x65CC  #CJK UNIFIED IDEOGRAPH
+0x9DD6 0x65D2  #CJK UNIFIED IDEOGRAPH
+0x9DD7 0x65DB  #CJK UNIFIED IDEOGRAPH
+0x9DD8 0x65D9  #CJK UNIFIED IDEOGRAPH
+0x9DD9 0x65E0  #CJK UNIFIED IDEOGRAPH
+0x9DDA 0x65E1  #CJK UNIFIED IDEOGRAPH
+0x9DDB 0x65F1  #CJK UNIFIED IDEOGRAPH
+0x9DDC 0x6772  #CJK UNIFIED IDEOGRAPH
+0x9DDD 0x660A  #CJK UNIFIED IDEOGRAPH
+0x9DDE 0x6603  #CJK UNIFIED IDEOGRAPH
+0x9DDF 0x65FB  #CJK UNIFIED IDEOGRAPH
+0x9DE0 0x6773  #CJK UNIFIED IDEOGRAPH
+0x9DE1 0x6635  #CJK UNIFIED IDEOGRAPH
+0x9DE2 0x6636  #CJK UNIFIED IDEOGRAPH
+0x9DE3 0x6634  #CJK UNIFIED IDEOGRAPH
+0x9DE4 0x661C  #CJK UNIFIED IDEOGRAPH
+0x9DE5 0x664F  #CJK UNIFIED IDEOGRAPH
+0x9DE6 0x6644  #CJK UNIFIED IDEOGRAPH
+0x9DE7 0x6649  #CJK UNIFIED IDEOGRAPH
+0x9DE8 0x6641  #CJK UNIFIED IDEOGRAPH
+0x9DE9 0x665E  #CJK UNIFIED IDEOGRAPH
+0x9DEA 0x665D  #CJK UNIFIED IDEOGRAPH
+0x9DEB 0x6664  #CJK UNIFIED IDEOGRAPH
+0x9DEC 0x6667  #CJK UNIFIED IDEOGRAPH
+0x9DED 0x6668  #CJK UNIFIED IDEOGRAPH
+0x9DEE 0x665F  #CJK UNIFIED IDEOGRAPH
+0x9DEF 0x6662  #CJK UNIFIED IDEOGRAPH
+0x9DF0 0x6670  #CJK UNIFIED IDEOGRAPH
+0x9DF1 0x6683  #CJK UNIFIED IDEOGRAPH
+0x9DF2 0x6688  #CJK UNIFIED IDEOGRAPH
+0x9DF3 0x668E  #CJK UNIFIED IDEOGRAPH
+0x9DF4 0x6689  #CJK UNIFIED IDEOGRAPH
+0x9DF5 0x6684  #CJK UNIFIED IDEOGRAPH
+0x9DF6 0x6698  #CJK UNIFIED IDEOGRAPH
+0x9DF7 0x669D  #CJK UNIFIED IDEOGRAPH
+0x9DF8 0x66C1  #CJK UNIFIED IDEOGRAPH
+0x9DF9 0x66B9  #CJK UNIFIED IDEOGRAPH
+0x9DFA 0x66C9  #CJK UNIFIED IDEOGRAPH
+0x9DFB 0x66BE  #CJK UNIFIED IDEOGRAPH
+0x9DFC 0x66BC  #CJK UNIFIED IDEOGRAPH
+0x9E40 0x66C4  #CJK UNIFIED IDEOGRAPH
+0x9E41 0x66B8  #CJK UNIFIED IDEOGRAPH
+0x9E42 0x66D6  #CJK UNIFIED IDEOGRAPH
+0x9E43 0x66DA  #CJK UNIFIED IDEOGRAPH
+0x9E44 0x66E0  #CJK UNIFIED IDEOGRAPH
+0x9E45 0x663F  #CJK UNIFIED IDEOGRAPH
+0x9E46 0x66E6  #CJK UNIFIED IDEOGRAPH
+0x9E47 0x66E9  #CJK UNIFIED IDEOGRAPH
+0x9E48 0x66F0  #CJK UNIFIED IDEOGRAPH
+0x9E49 0x66F5  #CJK UNIFIED IDEOGRAPH
+0x9E4A 0x66F7  #CJK UNIFIED IDEOGRAPH
+0x9E4B 0x670F  #CJK UNIFIED IDEOGRAPH
+0x9E4C 0x6716  #CJK UNIFIED IDEOGRAPH
+0x9E4D 0x671E  #CJK UNIFIED IDEOGRAPH
+0x9E4E 0x6726  #CJK UNIFIED IDEOGRAPH
+0x9E4F 0x6727  #CJK UNIFIED IDEOGRAPH
+0x9E50 0x9738  #CJK UNIFIED IDEOGRAPH
+0x9E51 0x672E  #CJK UNIFIED IDEOGRAPH
+0x9E52 0x673F  #CJK UNIFIED IDEOGRAPH
+0x9E53 0x6736  #CJK UNIFIED IDEOGRAPH
+0x9E54 0x6741  #CJK UNIFIED IDEOGRAPH
+0x9E55 0x6738  #CJK UNIFIED IDEOGRAPH
+0x9E56 0x6737  #CJK UNIFIED IDEOGRAPH
+0x9E57 0x6746  #CJK UNIFIED IDEOGRAPH
+0x9E58 0x675E  #CJK UNIFIED IDEOGRAPH
+0x9E59 0x6760  #CJK UNIFIED IDEOGRAPH
+0x9E5A 0x6759  #CJK UNIFIED IDEOGRAPH
+0x9E5B 0x6763  #CJK UNIFIED IDEOGRAPH
+0x9E5C 0x6764  #CJK UNIFIED IDEOGRAPH
+0x9E5D 0x6789  #CJK UNIFIED IDEOGRAPH
+0x9E5E 0x6770  #CJK UNIFIED IDEOGRAPH
+0x9E5F 0x67A9  #CJK UNIFIED IDEOGRAPH
+0x9E60 0x677C  #CJK UNIFIED IDEOGRAPH
+0x9E61 0x676A  #CJK UNIFIED IDEOGRAPH
+0x9E62 0x678C  #CJK UNIFIED IDEOGRAPH
+0x9E63 0x678B  #CJK UNIFIED IDEOGRAPH
+0x9E64 0x67A6  #CJK UNIFIED IDEOGRAPH
+0x9E65 0x67A1  #CJK UNIFIED IDEOGRAPH
+0x9E66 0x6785  #CJK UNIFIED IDEOGRAPH
+0x9E67 0x67B7  #CJK UNIFIED IDEOGRAPH
+0x9E68 0x67EF  #CJK UNIFIED IDEOGRAPH
+0x9E69 0x67B4  #CJK UNIFIED IDEOGRAPH
+0x9E6A 0x67EC  #CJK UNIFIED IDEOGRAPH
+0x9E6B 0x67B3  #CJK UNIFIED IDEOGRAPH
+0x9E6C 0x67E9  #CJK UNIFIED IDEOGRAPH
+0x9E6D 0x67B8  #CJK UNIFIED IDEOGRAPH
+0x9E6E 0x67E4  #CJK UNIFIED IDEOGRAPH
+0x9E6F 0x67DE  #CJK UNIFIED IDEOGRAPH
+0x9E70 0x67DD  #CJK UNIFIED IDEOGRAPH
+0x9E71 0x67E2  #CJK UNIFIED IDEOGRAPH
+0x9E72 0x67EE  #CJK UNIFIED IDEOGRAPH
+0x9E73 0x67B9  #CJK UNIFIED IDEOGRAPH
+0x9E74 0x67CE  #CJK UNIFIED IDEOGRAPH
+0x9E75 0x67C6  #CJK UNIFIED IDEOGRAPH
+0x9E76 0x67E7  #CJK UNIFIED IDEOGRAPH
+0x9E77 0x6A9C  #CJK UNIFIED IDEOGRAPH
+0x9E78 0x681E  #CJK UNIFIED IDEOGRAPH
+0x9E79 0x6846  #CJK UNIFIED IDEOGRAPH
+0x9E7A 0x6829  #CJK UNIFIED IDEOGRAPH
+0x9E7B 0x6840  #CJK UNIFIED IDEOGRAPH
+0x9E7C 0x684D  #CJK UNIFIED IDEOGRAPH
+0x9E7D 0x6832  #CJK UNIFIED IDEOGRAPH
+0x9E7E 0x684E  #CJK UNIFIED IDEOGRAPH
+0x9E80 0x68B3  #CJK UNIFIED IDEOGRAPH
+0x9E81 0x682B  #CJK UNIFIED IDEOGRAPH
+0x9E82 0x6859  #CJK UNIFIED IDEOGRAPH
+0x9E83 0x6863  #CJK UNIFIED IDEOGRAPH
+0x9E84 0x6877  #CJK UNIFIED IDEOGRAPH
+0x9E85 0x687F  #CJK UNIFIED IDEOGRAPH
+0x9E86 0x689F  #CJK UNIFIED IDEOGRAPH
+0x9E87 0x688F  #CJK UNIFIED IDEOGRAPH
+0x9E88 0x68AD  #CJK UNIFIED IDEOGRAPH
+0x9E89 0x6894  #CJK UNIFIED IDEOGRAPH
+0x9E8A 0x689D  #CJK UNIFIED IDEOGRAPH
+0x9E8B 0x689B  #CJK UNIFIED IDEOGRAPH
+0x9E8C 0x6883  #CJK UNIFIED IDEOGRAPH
+0x9E8D 0x6AAE  #CJK UNIFIED IDEOGRAPH
+0x9E8E 0x68B9  #CJK UNIFIED IDEOGRAPH
+0x9E8F 0x6874  #CJK UNIFIED IDEOGRAPH
+0x9E90 0x68B5  #CJK UNIFIED IDEOGRAPH
+0x9E91 0x68A0  #CJK UNIFIED IDEOGRAPH
+0x9E92 0x68BA  #CJK UNIFIED IDEOGRAPH
+0x9E93 0x690F  #CJK UNIFIED IDEOGRAPH
+0x9E94 0x688D  #CJK UNIFIED IDEOGRAPH
+0x9E95 0x687E  #CJK UNIFIED IDEOGRAPH
+0x9E96 0x6901  #CJK UNIFIED IDEOGRAPH
+0x9E97 0x68CA  #CJK UNIFIED IDEOGRAPH
+0x9E98 0x6908  #CJK UNIFIED IDEOGRAPH
+0x9E99 0x68D8  #CJK UNIFIED IDEOGRAPH
+0x9E9A 0x6922  #CJK UNIFIED IDEOGRAPH
+0x9E9B 0x6926  #CJK UNIFIED IDEOGRAPH
+0x9E9C 0x68E1  #CJK UNIFIED IDEOGRAPH
+0x9E9D 0x690C  #CJK UNIFIED IDEOGRAPH
+0x9E9E 0x68CD  #CJK UNIFIED IDEOGRAPH
+0x9E9F 0x68D4  #CJK UNIFIED IDEOGRAPH
+0x9EA0 0x68E7  #CJK UNIFIED IDEOGRAPH
+0x9EA1 0x68D5  #CJK UNIFIED IDEOGRAPH
+0x9EA2 0x6936  #CJK UNIFIED IDEOGRAPH
+0x9EA3 0x6912  #CJK UNIFIED IDEOGRAPH
+0x9EA4 0x6904  #CJK UNIFIED IDEOGRAPH
+0x9EA5 0x68D7  #CJK UNIFIED IDEOGRAPH
+0x9EA6 0x68E3  #CJK UNIFIED IDEOGRAPH
+0x9EA7 0x6925  #CJK UNIFIED IDEOGRAPH
+0x9EA8 0x68F9  #CJK UNIFIED IDEOGRAPH
+0x9EA9 0x68E0  #CJK UNIFIED IDEOGRAPH
+0x9EAA 0x68EF  #CJK UNIFIED IDEOGRAPH
+0x9EAB 0x6928  #CJK UNIFIED IDEOGRAPH
+0x9EAC 0x692A  #CJK UNIFIED IDEOGRAPH
+0x9EAD 0x691A  #CJK UNIFIED IDEOGRAPH
+0x9EAE 0x6923  #CJK UNIFIED IDEOGRAPH
+0x9EAF 0x6921  #CJK UNIFIED IDEOGRAPH
+0x9EB0 0x68C6  #CJK UNIFIED IDEOGRAPH
+0x9EB1 0x6979  #CJK UNIFIED IDEOGRAPH
+0x9EB2 0x6977  #CJK UNIFIED IDEOGRAPH
+0x9EB3 0x695C  #CJK UNIFIED IDEOGRAPH
+0x9EB4 0x6978  #CJK UNIFIED IDEOGRAPH
+0x9EB5 0x696B  #CJK UNIFIED IDEOGRAPH
+0x9EB6 0x6954  #CJK UNIFIED IDEOGRAPH
+0x9EB7 0x697E  #CJK UNIFIED IDEOGRAPH
+0x9EB8 0x696E  #CJK UNIFIED IDEOGRAPH
+0x9EB9 0x6939  #CJK UNIFIED IDEOGRAPH
+0x9EBA 0x6974  #CJK UNIFIED IDEOGRAPH
+0x9EBB 0x693D  #CJK UNIFIED IDEOGRAPH
+0x9EBC 0x6959  #CJK UNIFIED IDEOGRAPH
+0x9EBD 0x6930  #CJK UNIFIED IDEOGRAPH
+0x9EBE 0x6961  #CJK UNIFIED IDEOGRAPH
+0x9EBF 0x695E  #CJK UNIFIED IDEOGRAPH
+0x9EC0 0x695D  #CJK UNIFIED IDEOGRAPH
+0x9EC1 0x6981  #CJK UNIFIED IDEOGRAPH
+0x9EC2 0x696A  #CJK UNIFIED IDEOGRAPH
+0x9EC3 0x69B2  #CJK UNIFIED IDEOGRAPH
+0x9EC4 0x69AE  #CJK UNIFIED IDEOGRAPH
+0x9EC5 0x69D0  #CJK UNIFIED IDEOGRAPH
+0x9EC6 0x69BF  #CJK UNIFIED IDEOGRAPH
+0x9EC7 0x69C1  #CJK UNIFIED IDEOGRAPH
+0x9EC8 0x69D3  #CJK UNIFIED IDEOGRAPH
+0x9EC9 0x69BE  #CJK UNIFIED IDEOGRAPH
+0x9ECA 0x69CE  #CJK UNIFIED IDEOGRAPH
+0x9ECB 0x5BE8  #CJK UNIFIED IDEOGRAPH
+0x9ECC 0x69CA  #CJK UNIFIED IDEOGRAPH
+0x9ECD 0x69DD  #CJK UNIFIED IDEOGRAPH
+0x9ECE 0x69BB  #CJK UNIFIED IDEOGRAPH
+0x9ECF 0x69C3  #CJK UNIFIED IDEOGRAPH
+0x9ED0 0x69A7  #CJK UNIFIED IDEOGRAPH
+0x9ED1 0x6A2E  #CJK UNIFIED IDEOGRAPH
+0x9ED2 0x6991  #CJK UNIFIED IDEOGRAPH
+0x9ED3 0x69A0  #CJK UNIFIED IDEOGRAPH
+0x9ED4 0x699C  #CJK UNIFIED IDEOGRAPH
+0x9ED5 0x6995  #CJK UNIFIED IDEOGRAPH
+0x9ED6 0x69B4  #CJK UNIFIED IDEOGRAPH
+0x9ED7 0x69DE  #CJK UNIFIED IDEOGRAPH
+0x9ED8 0x69E8  #CJK UNIFIED IDEOGRAPH
+0x9ED9 0x6A02  #CJK UNIFIED IDEOGRAPH
+0x9EDA 0x6A1B  #CJK UNIFIED IDEOGRAPH
+0x9EDB 0x69FF  #CJK UNIFIED IDEOGRAPH
+0x9EDC 0x6B0A  #CJK UNIFIED IDEOGRAPH
+0x9EDD 0x69F9  #CJK UNIFIED IDEOGRAPH
+0x9EDE 0x69F2  #CJK UNIFIED IDEOGRAPH
+0x9EDF 0x69E7  #CJK UNIFIED IDEOGRAPH
+0x9EE0 0x6A05  #CJK UNIFIED IDEOGRAPH
+0x9EE1 0x69B1  #CJK UNIFIED IDEOGRAPH
+0x9EE2 0x6A1E  #CJK UNIFIED IDEOGRAPH
+0x9EE3 0x69ED  #CJK UNIFIED IDEOGRAPH
+0x9EE4 0x6A14  #CJK UNIFIED IDEOGRAPH
+0x9EE5 0x69EB  #CJK UNIFIED IDEOGRAPH
+0x9EE6 0x6A0A  #CJK UNIFIED IDEOGRAPH
+0x9EE7 0x6A12  #CJK UNIFIED IDEOGRAPH
+0x9EE8 0x6AC1  #CJK UNIFIED IDEOGRAPH
+0x9EE9 0x6A23  #CJK UNIFIED IDEOGRAPH
+0x9EEA 0x6A13  #CJK UNIFIED IDEOGRAPH
+0x9EEB 0x6A44  #CJK UNIFIED IDEOGRAPH
+0x9EEC 0x6A0C  #CJK UNIFIED IDEOGRAPH
+0x9EED 0x6A72  #CJK UNIFIED IDEOGRAPH
+0x9EEE 0x6A36  #CJK UNIFIED IDEOGRAPH
+0x9EEF 0x6A78  #CJK UNIFIED IDEOGRAPH
+0x9EF0 0x6A47  #CJK UNIFIED IDEOGRAPH
+0x9EF1 0x6A62  #CJK UNIFIED IDEOGRAPH
+0x9EF2 0x6A59  #CJK UNIFIED IDEOGRAPH
+0x9EF3 0x6A66  #CJK UNIFIED IDEOGRAPH
+0x9EF4 0x6A48  #CJK UNIFIED IDEOGRAPH
+0x9EF5 0x6A38  #CJK UNIFIED IDEOGRAPH
+0x9EF6 0x6A22  #CJK UNIFIED IDEOGRAPH
+0x9EF7 0x6A90  #CJK UNIFIED IDEOGRAPH
+0x9EF8 0x6A8D  #CJK UNIFIED IDEOGRAPH
+0x9EF9 0x6AA0  #CJK UNIFIED IDEOGRAPH
+0x9EFA 0x6A84  #CJK UNIFIED IDEOGRAPH
+0x9EFB 0x6AA2  #CJK UNIFIED IDEOGRAPH
+0x9EFC 0x6AA3  #CJK UNIFIED IDEOGRAPH
+0x9F40 0x6A97  #CJK UNIFIED IDEOGRAPH
+0x9F41 0x8617  #CJK UNIFIED IDEOGRAPH
+0x9F42 0x6ABB  #CJK UNIFIED IDEOGRAPH
+0x9F43 0x6AC3  #CJK UNIFIED IDEOGRAPH
+0x9F44 0x6AC2  #CJK UNIFIED IDEOGRAPH
+0x9F45 0x6AB8  #CJK UNIFIED IDEOGRAPH
+0x9F46 0x6AB3  #CJK UNIFIED IDEOGRAPH
+0x9F47 0x6AAC  #CJK UNIFIED IDEOGRAPH
+0x9F48 0x6ADE  #CJK UNIFIED IDEOGRAPH
+0x9F49 0x6AD1  #CJK UNIFIED IDEOGRAPH
+0x9F4A 0x6ADF  #CJK UNIFIED IDEOGRAPH
+0x9F4B 0x6AAA  #CJK UNIFIED IDEOGRAPH
+0x9F4C 0x6ADA  #CJK UNIFIED IDEOGRAPH
+0x9F4D 0x6AEA  #CJK UNIFIED IDEOGRAPH
+0x9F4E 0x6AFB  #CJK UNIFIED IDEOGRAPH
+0x9F4F 0x6B05  #CJK UNIFIED IDEOGRAPH
+0x9F50 0x8616  #CJK UNIFIED IDEOGRAPH
+0x9F51 0x6AFA  #CJK UNIFIED IDEOGRAPH
+0x9F52 0x6B12  #CJK UNIFIED IDEOGRAPH
+0x9F53 0x6B16  #CJK UNIFIED IDEOGRAPH
+0x9F54 0x9B31  #CJK UNIFIED IDEOGRAPH
+0x9F55 0x6B1F  #CJK UNIFIED IDEOGRAPH
+0x9F56 0x6B38  #CJK UNIFIED IDEOGRAPH
+0x9F57 0x6B37  #CJK UNIFIED IDEOGRAPH
+0x9F58 0x76DC  #CJK UNIFIED IDEOGRAPH
+0x9F59 0x6B39  #CJK UNIFIED IDEOGRAPH
+0x9F5A 0x98EE  #CJK UNIFIED IDEOGRAPH
+0x9F5B 0x6B47  #CJK UNIFIED IDEOGRAPH
+0x9F5C 0x6B43  #CJK UNIFIED IDEOGRAPH
+0x9F5D 0x6B49  #CJK UNIFIED IDEOGRAPH
+0x9F5E 0x6B50  #CJK UNIFIED IDEOGRAPH
+0x9F5F 0x6B59  #CJK UNIFIED IDEOGRAPH
+0x9F60 0x6B54  #CJK UNIFIED IDEOGRAPH
+0x9F61 0x6B5B  #CJK UNIFIED IDEOGRAPH
+0x9F62 0x6B5F  #CJK UNIFIED IDEOGRAPH
+0x9F63 0x6B61  #CJK UNIFIED IDEOGRAPH
+0x9F64 0x6B78  #CJK UNIFIED IDEOGRAPH
+0x9F65 0x6B79  #CJK UNIFIED IDEOGRAPH
+0x9F66 0x6B7F  #CJK UNIFIED IDEOGRAPH
+0x9F67 0x6B80  #CJK UNIFIED IDEOGRAPH
+0x9F68 0x6B84  #CJK UNIFIED IDEOGRAPH
+0x9F69 0x6B83  #CJK UNIFIED IDEOGRAPH
+0x9F6A 0x6B8D  #CJK UNIFIED IDEOGRAPH
+0x9F6B 0x6B98  #CJK UNIFIED IDEOGRAPH
+0x9F6C 0x6B95  #CJK UNIFIED IDEOGRAPH
+0x9F6D 0x6B9E  #CJK UNIFIED IDEOGRAPH
+0x9F6E 0x6BA4  #CJK UNIFIED IDEOGRAPH
+0x9F6F 0x6BAA  #CJK UNIFIED IDEOGRAPH
+0x9F70 0x6BAB  #CJK UNIFIED IDEOGRAPH
+0x9F71 0x6BAF  #CJK UNIFIED IDEOGRAPH
+0x9F72 0x6BB2  #CJK UNIFIED IDEOGRAPH
+0x9F73 0x6BB1  #CJK UNIFIED IDEOGRAPH
+0x9F74 0x6BB3  #CJK UNIFIED IDEOGRAPH
+0x9F75 0x6BB7  #CJK UNIFIED IDEOGRAPH
+0x9F76 0x6BBC  #CJK UNIFIED IDEOGRAPH
+0x9F77 0x6BC6  #CJK UNIFIED IDEOGRAPH
+0x9F78 0x6BCB  #CJK UNIFIED IDEOGRAPH
+0x9F79 0x6BD3  #CJK UNIFIED IDEOGRAPH
+0x9F7A 0x6BDF  #CJK UNIFIED IDEOGRAPH
+0x9F7B 0x6BEC  #CJK UNIFIED IDEOGRAPH
+0x9F7C 0x6BEB  #CJK UNIFIED IDEOGRAPH
+0x9F7D 0x6BF3  #CJK UNIFIED IDEOGRAPH
+0x9F7E 0x6BEF  #CJK UNIFIED IDEOGRAPH
+0x9F80 0x9EBE  #CJK UNIFIED IDEOGRAPH
+0x9F81 0x6C08  #CJK UNIFIED IDEOGRAPH
+0x9F82 0x6C13  #CJK UNIFIED IDEOGRAPH
+0x9F83 0x6C14  #CJK UNIFIED IDEOGRAPH
+0x9F84 0x6C1B  #CJK UNIFIED IDEOGRAPH
+0x9F85 0x6C24  #CJK UNIFIED IDEOGRAPH
+0x9F86 0x6C23  #CJK UNIFIED IDEOGRAPH
+0x9F87 0x6C5E  #CJK UNIFIED IDEOGRAPH
+0x9F88 0x6C55  #CJK UNIFIED IDEOGRAPH
+0x9F89 0x6C62  #CJK UNIFIED IDEOGRAPH
+0x9F8A 0x6C6A  #CJK UNIFIED IDEOGRAPH
+0x9F8B 0x6C82  #CJK UNIFIED IDEOGRAPH
+0x9F8C 0x6C8D  #CJK UNIFIED IDEOGRAPH
+0x9F8D 0x6C9A  #CJK UNIFIED IDEOGRAPH
+0x9F8E 0x6C81  #CJK UNIFIED IDEOGRAPH
+0x9F8F 0x6C9B  #CJK UNIFIED IDEOGRAPH
+0x9F90 0x6C7E  #CJK UNIFIED IDEOGRAPH
+0x9F91 0x6C68  #CJK UNIFIED IDEOGRAPH
+0x9F92 0x6C73  #CJK UNIFIED IDEOGRAPH
+0x9F93 0x6C92  #CJK UNIFIED IDEOGRAPH
+0x9F94 0x6C90  #CJK UNIFIED IDEOGRAPH
+0x9F95 0x6CC4  #CJK UNIFIED IDEOGRAPH
+0x9F96 0x6CF1  #CJK UNIFIED IDEOGRAPH
+0x9F97 0x6CD3  #CJK UNIFIED IDEOGRAPH
+0x9F98 0x6CBD  #CJK UNIFIED IDEOGRAPH
+0x9F99 0x6CD7  #CJK UNIFIED IDEOGRAPH
+0x9F9A 0x6CC5  #CJK UNIFIED IDEOGRAPH
+0x9F9B 0x6CDD  #CJK UNIFIED IDEOGRAPH
+0x9F9C 0x6CAE  #CJK UNIFIED IDEOGRAPH
+0x9F9D 0x6CB1  #CJK UNIFIED IDEOGRAPH
+0x9F9E 0x6CBE  #CJK UNIFIED IDEOGRAPH
+0x9F9F 0x6CBA  #CJK UNIFIED IDEOGRAPH
+0x9FA0 0x6CDB  #CJK UNIFIED IDEOGRAPH
+0x9FA1 0x6CEF  #CJK UNIFIED IDEOGRAPH
+0x9FA2 0x6CD9  #CJK UNIFIED IDEOGRAPH
+0x9FA3 0x6CEA  #CJK UNIFIED IDEOGRAPH
+0x9FA4 0x6D1F  #CJK UNIFIED IDEOGRAPH
+0x9FA5 0x884D  #CJK UNIFIED IDEOGRAPH
+0x9FA6 0x6D36  #CJK UNIFIED IDEOGRAPH
+0x9FA7 0x6D2B  #CJK UNIFIED IDEOGRAPH
+0x9FA8 0x6D3D  #CJK UNIFIED IDEOGRAPH
+0x9FA9 0x6D38  #CJK UNIFIED IDEOGRAPH
+0x9FAA 0x6D19  #CJK UNIFIED IDEOGRAPH
+0x9FAB 0x6D35  #CJK UNIFIED IDEOGRAPH
+0x9FAC 0x6D33  #CJK UNIFIED IDEOGRAPH
+0x9FAD 0x6D12  #CJK UNIFIED IDEOGRAPH
+0x9FAE 0x6D0C  #CJK UNIFIED IDEOGRAPH
+0x9FAF 0x6D63  #CJK UNIFIED IDEOGRAPH
+0x9FB0 0x6D93  #CJK UNIFIED IDEOGRAPH
+0x9FB1 0x6D64  #CJK UNIFIED IDEOGRAPH
+0x9FB2 0x6D5A  #CJK UNIFIED IDEOGRAPH
+0x9FB3 0x6D79  #CJK UNIFIED IDEOGRAPH
+0x9FB4 0x6D59  #CJK UNIFIED IDEOGRAPH
+0x9FB5 0x6D8E  #CJK UNIFIED IDEOGRAPH
+0x9FB6 0x6D95  #CJK UNIFIED IDEOGRAPH
+0x9FB7 0x6FE4  #CJK UNIFIED IDEOGRAPH
+0x9FB8 0x6D85  #CJK UNIFIED IDEOGRAPH
+0x9FB9 0x6DF9  #CJK UNIFIED IDEOGRAPH
+0x9FBA 0x6E15  #CJK UNIFIED IDEOGRAPH
+0x9FBB 0x6E0A  #CJK UNIFIED IDEOGRAPH
+0x9FBC 0x6DB5  #CJK UNIFIED IDEOGRAPH
+0x9FBD 0x6DC7  #CJK UNIFIED IDEOGRAPH
+0x9FBE 0x6DE6  #CJK UNIFIED IDEOGRAPH
+0x9FBF 0x6DB8  #CJK UNIFIED IDEOGRAPH
+0x9FC0 0x6DC6  #CJK UNIFIED IDEOGRAPH
+0x9FC1 0x6DEC  #CJK UNIFIED IDEOGRAPH
+0x9FC2 0x6DDE  #CJK UNIFIED IDEOGRAPH
+0x9FC3 0x6DCC  #CJK UNIFIED IDEOGRAPH
+0x9FC4 0x6DE8  #CJK UNIFIED IDEOGRAPH
+0x9FC5 0x6DD2  #CJK UNIFIED IDEOGRAPH
+0x9FC6 0x6DC5  #CJK UNIFIED IDEOGRAPH
+0x9FC7 0x6DFA  #CJK UNIFIED IDEOGRAPH
+0x9FC8 0x6DD9  #CJK UNIFIED IDEOGRAPH
+0x9FC9 0x6DE4  #CJK UNIFIED IDEOGRAPH
+0x9FCA 0x6DD5  #CJK UNIFIED IDEOGRAPH
+0x9FCB 0x6DEA  #CJK UNIFIED IDEOGRAPH
+0x9FCC 0x6DEE  #CJK UNIFIED IDEOGRAPH
+0x9FCD 0x6E2D  #CJK UNIFIED IDEOGRAPH
+0x9FCE 0x6E6E  #CJK UNIFIED IDEOGRAPH
+0x9FCF 0x6E2E  #CJK UNIFIED IDEOGRAPH
+0x9FD0 0x6E19  #CJK UNIFIED IDEOGRAPH
+0x9FD1 0x6E72  #CJK UNIFIED IDEOGRAPH
+0x9FD2 0x6E5F  #CJK UNIFIED IDEOGRAPH
+0x9FD3 0x6E3E  #CJK UNIFIED IDEOGRAPH
+0x9FD4 0x6E23  #CJK UNIFIED IDEOGRAPH
+0x9FD5 0x6E6B  #CJK UNIFIED IDEOGRAPH
+0x9FD6 0x6E2B  #CJK UNIFIED IDEOGRAPH
+0x9FD7 0x6E76  #CJK UNIFIED IDEOGRAPH
+0x9FD8 0x6E4D  #CJK UNIFIED IDEOGRAPH
+0x9FD9 0x6E1F  #CJK UNIFIED IDEOGRAPH
+0x9FDA 0x6E43  #CJK UNIFIED IDEOGRAPH
+0x9FDB 0x6E3A  #CJK UNIFIED IDEOGRAPH
+0x9FDC 0x6E4E  #CJK UNIFIED IDEOGRAPH
+0x9FDD 0x6E24  #CJK UNIFIED IDEOGRAPH
+0x9FDE 0x6EFF  #CJK UNIFIED IDEOGRAPH
+0x9FDF 0x6E1D  #CJK UNIFIED IDEOGRAPH
+0x9FE0 0x6E38  #CJK UNIFIED IDEOGRAPH
+0x9FE1 0x6E82  #CJK UNIFIED IDEOGRAPH
+0x9FE2 0x6EAA  #CJK UNIFIED IDEOGRAPH
+0x9FE3 0x6E98  #CJK UNIFIED IDEOGRAPH
+0x9FE4 0x6EC9  #CJK UNIFIED IDEOGRAPH
+0x9FE5 0x6EB7  #CJK UNIFIED IDEOGRAPH
+0x9FE6 0x6ED3  #CJK UNIFIED IDEOGRAPH
+0x9FE7 0x6EBD  #CJK UNIFIED IDEOGRAPH
+0x9FE8 0x6EAF  #CJK UNIFIED IDEOGRAPH
+0x9FE9 0x6EC4  #CJK UNIFIED IDEOGRAPH
+0x9FEA 0x6EB2  #CJK UNIFIED IDEOGRAPH
+0x9FEB 0x6ED4  #CJK UNIFIED IDEOGRAPH
+0x9FEC 0x6ED5  #CJK UNIFIED IDEOGRAPH
+0x9FED 0x6E8F  #CJK UNIFIED IDEOGRAPH
+0x9FEE 0x6EA5  #CJK UNIFIED IDEOGRAPH
+0x9FEF 0x6EC2  #CJK UNIFIED IDEOGRAPH
+0x9FF0 0x6E9F  #CJK UNIFIED IDEOGRAPH
+0x9FF1 0x6F41  #CJK UNIFIED IDEOGRAPH
+0x9FF2 0x6F11  #CJK UNIFIED IDEOGRAPH
+0x9FF3 0x704C  #CJK UNIFIED IDEOGRAPH
+0x9FF4 0x6EEC  #CJK UNIFIED IDEOGRAPH
+0x9FF5 0x6EF8  #CJK UNIFIED IDEOGRAPH
+0x9FF6 0x6EFE  #CJK UNIFIED IDEOGRAPH
+0x9FF7 0x6F3F  #CJK UNIFIED IDEOGRAPH
+0x9FF8 0x6EF2  #CJK UNIFIED IDEOGRAPH
+0x9FF9 0x6F31  #CJK UNIFIED IDEOGRAPH
+0x9FFA 0x6EEF  #CJK UNIFIED IDEOGRAPH
+0x9FFB 0x6F32  #CJK UNIFIED IDEOGRAPH
+0x9FFC 0x6ECC  #CJK UNIFIED IDEOGRAPH
+0xE040 0x6F3E  #CJK UNIFIED IDEOGRAPH
+0xE041 0x6F13  #CJK UNIFIED IDEOGRAPH
+0xE042 0x6EF7  #CJK UNIFIED IDEOGRAPH
+0xE043 0x6F86  #CJK UNIFIED IDEOGRAPH
+0xE044 0x6F7A  #CJK UNIFIED IDEOGRAPH
+0xE045 0x6F78  #CJK UNIFIED IDEOGRAPH
+0xE046 0x6F81  #CJK UNIFIED IDEOGRAPH
+0xE047 0x6F80  #CJK UNIFIED IDEOGRAPH
+0xE048 0x6F6F  #CJK UNIFIED IDEOGRAPH
+0xE049 0x6F5B  #CJK UNIFIED IDEOGRAPH
+0xE04A 0x6FF3  #CJK UNIFIED IDEOGRAPH
+0xE04B 0x6F6D  #CJK UNIFIED IDEOGRAPH
+0xE04C 0x6F82  #CJK UNIFIED IDEOGRAPH
+0xE04D 0x6F7C  #CJK UNIFIED IDEOGRAPH
+0xE04E 0x6F58  #CJK UNIFIED IDEOGRAPH
+0xE04F 0x6F8E  #CJK UNIFIED IDEOGRAPH
+0xE050 0x6F91  #CJK UNIFIED IDEOGRAPH
+0xE051 0x6FC2  #CJK UNIFIED IDEOGRAPH
+0xE052 0x6F66  #CJK UNIFIED IDEOGRAPH
+0xE053 0x6FB3  #CJK UNIFIED IDEOGRAPH
+0xE054 0x6FA3  #CJK UNIFIED IDEOGRAPH
+0xE055 0x6FA1  #CJK UNIFIED IDEOGRAPH
+0xE056 0x6FA4  #CJK UNIFIED IDEOGRAPH
+0xE057 0x6FB9  #CJK UNIFIED IDEOGRAPH
+0xE058 0x6FC6  #CJK UNIFIED IDEOGRAPH
+0xE059 0x6FAA  #CJK UNIFIED IDEOGRAPH
+0xE05A 0x6FDF  #CJK UNIFIED IDEOGRAPH
+0xE05B 0x6FD5  #CJK UNIFIED IDEOGRAPH
+0xE05C 0x6FEC  #CJK UNIFIED IDEOGRAPH
+0xE05D 0x6FD4  #CJK UNIFIED IDEOGRAPH
+0xE05E 0x6FD8  #CJK UNIFIED IDEOGRAPH
+0xE05F 0x6FF1  #CJK UNIFIED IDEOGRAPH
+0xE060 0x6FEE  #CJK UNIFIED IDEOGRAPH
+0xE061 0x6FDB  #CJK UNIFIED IDEOGRAPH
+0xE062 0x7009  #CJK UNIFIED IDEOGRAPH
+0xE063 0x700B  #CJK UNIFIED IDEOGRAPH
+0xE064 0x6FFA  #CJK UNIFIED IDEOGRAPH
+0xE065 0x7011  #CJK UNIFIED IDEOGRAPH
+0xE066 0x7001  #CJK UNIFIED IDEOGRAPH
+0xE067 0x700F  #CJK UNIFIED IDEOGRAPH
+0xE068 0x6FFE  #CJK UNIFIED IDEOGRAPH
+0xE069 0x701B  #CJK UNIFIED IDEOGRAPH
+0xE06A 0x701A  #CJK UNIFIED IDEOGRAPH
+0xE06B 0x6F74  #CJK UNIFIED IDEOGRAPH
+0xE06C 0x701D  #CJK UNIFIED IDEOGRAPH
+0xE06D 0x7018  #CJK UNIFIED IDEOGRAPH
+0xE06E 0x701F  #CJK UNIFIED IDEOGRAPH
+0xE06F 0x7030  #CJK UNIFIED IDEOGRAPH
+0xE070 0x703E  #CJK UNIFIED IDEOGRAPH
+0xE071 0x7032  #CJK UNIFIED IDEOGRAPH
+0xE072 0x7051  #CJK UNIFIED IDEOGRAPH
+0xE073 0x7063  #CJK UNIFIED IDEOGRAPH
+0xE074 0x7099  #CJK UNIFIED IDEOGRAPH
+0xE075 0x7092  #CJK UNIFIED IDEOGRAPH
+0xE076 0x70AF  #CJK UNIFIED IDEOGRAPH
+0xE077 0x70F1  #CJK UNIFIED IDEOGRAPH
+0xE078 0x70AC  #CJK UNIFIED IDEOGRAPH
+0xE079 0x70B8  #CJK UNIFIED IDEOGRAPH
+0xE07A 0x70B3  #CJK UNIFIED IDEOGRAPH
+0xE07B 0x70AE  #CJK UNIFIED IDEOGRAPH
+0xE07C 0x70DF  #CJK UNIFIED IDEOGRAPH
+0xE07D 0x70CB  #CJK UNIFIED IDEOGRAPH
+0xE07E 0x70DD  #CJK UNIFIED IDEOGRAPH
+0xE080 0x70D9  #CJK UNIFIED IDEOGRAPH
+0xE081 0x7109  #CJK UNIFIED IDEOGRAPH
+0xE082 0x70FD  #CJK UNIFIED IDEOGRAPH
+0xE083 0x711C  #CJK UNIFIED IDEOGRAPH
+0xE084 0x7119  #CJK UNIFIED IDEOGRAPH
+0xE085 0x7165  #CJK UNIFIED IDEOGRAPH
+0xE086 0x7155  #CJK UNIFIED IDEOGRAPH
+0xE087 0x7188  #CJK UNIFIED IDEOGRAPH
+0xE088 0x7166  #CJK UNIFIED IDEOGRAPH
+0xE089 0x7162  #CJK UNIFIED IDEOGRAPH
+0xE08A 0x714C  #CJK UNIFIED IDEOGRAPH
+0xE08B 0x7156  #CJK UNIFIED IDEOGRAPH
+0xE08C 0x716C  #CJK UNIFIED IDEOGRAPH
+0xE08D 0x718F  #CJK UNIFIED IDEOGRAPH
+0xE08E 0x71FB  #CJK UNIFIED IDEOGRAPH
+0xE08F 0x7184  #CJK UNIFIED IDEOGRAPH
+0xE090 0x7195  #CJK UNIFIED IDEOGRAPH
+0xE091 0x71A8  #CJK UNIFIED IDEOGRAPH
+0xE092 0x71AC  #CJK UNIFIED IDEOGRAPH
+0xE093 0x71D7  #CJK UNIFIED IDEOGRAPH
+0xE094 0x71B9  #CJK UNIFIED IDEOGRAPH
+0xE095 0x71BE  #CJK UNIFIED IDEOGRAPH
+0xE096 0x71D2  #CJK UNIFIED IDEOGRAPH
+0xE097 0x71C9  #CJK UNIFIED IDEOGRAPH
+0xE098 0x71D4  #CJK UNIFIED IDEOGRAPH
+0xE099 0x71CE  #CJK UNIFIED IDEOGRAPH
+0xE09A 0x71E0  #CJK UNIFIED IDEOGRAPH
+0xE09B 0x71EC  #CJK UNIFIED IDEOGRAPH
+0xE09C 0x71E7  #CJK UNIFIED IDEOGRAPH
+0xE09D 0x71F5  #CJK UNIFIED IDEOGRAPH
+0xE09E 0x71FC  #CJK UNIFIED IDEOGRAPH
+0xE09F 0x71F9  #CJK UNIFIED IDEOGRAPH
+0xE0A0 0x71FF  #CJK UNIFIED IDEOGRAPH
+0xE0A1 0x720D  #CJK UNIFIED IDEOGRAPH
+0xE0A2 0x7210  #CJK UNIFIED IDEOGRAPH
+0xE0A3 0x721B  #CJK UNIFIED IDEOGRAPH
+0xE0A4 0x7228  #CJK UNIFIED IDEOGRAPH
+0xE0A5 0x722D  #CJK UNIFIED IDEOGRAPH
+0xE0A6 0x722C  #CJK UNIFIED IDEOGRAPH
+0xE0A7 0x7230  #CJK UNIFIED IDEOGRAPH
+0xE0A8 0x7232  #CJK UNIFIED IDEOGRAPH
+0xE0A9 0x723B  #CJK UNIFIED IDEOGRAPH
+0xE0AA 0x723C  #CJK UNIFIED IDEOGRAPH
+0xE0AB 0x723F  #CJK UNIFIED IDEOGRAPH
+0xE0AC 0x7240  #CJK UNIFIED IDEOGRAPH
+0xE0AD 0x7246  #CJK UNIFIED IDEOGRAPH
+0xE0AE 0x724B  #CJK UNIFIED IDEOGRAPH
+0xE0AF 0x7258  #CJK UNIFIED IDEOGRAPH
+0xE0B0 0x7274  #CJK UNIFIED IDEOGRAPH
+0xE0B1 0x727E  #CJK UNIFIED IDEOGRAPH
+0xE0B2 0x7282  #CJK UNIFIED IDEOGRAPH
+0xE0B3 0x7281  #CJK UNIFIED IDEOGRAPH
+0xE0B4 0x7287  #CJK UNIFIED IDEOGRAPH
+0xE0B5 0x7292  #CJK UNIFIED IDEOGRAPH
+0xE0B6 0x7296  #CJK UNIFIED IDEOGRAPH
+0xE0B7 0x72A2  #CJK UNIFIED IDEOGRAPH
+0xE0B8 0x72A7  #CJK UNIFIED IDEOGRAPH
+0xE0B9 0x72B9  #CJK UNIFIED IDEOGRAPH
+0xE0BA 0x72B2  #CJK UNIFIED IDEOGRAPH
+0xE0BB 0x72C3  #CJK UNIFIED IDEOGRAPH
+0xE0BC 0x72C6  #CJK UNIFIED IDEOGRAPH
+0xE0BD 0x72C4  #CJK UNIFIED IDEOGRAPH
+0xE0BE 0x72CE  #CJK UNIFIED IDEOGRAPH
+0xE0BF 0x72D2  #CJK UNIFIED IDEOGRAPH
+0xE0C0 0x72E2  #CJK UNIFIED IDEOGRAPH
+0xE0C1 0x72E0  #CJK UNIFIED IDEOGRAPH
+0xE0C2 0x72E1  #CJK UNIFIED IDEOGRAPH
+0xE0C3 0x72F9  #CJK UNIFIED IDEOGRAPH
+0xE0C4 0x72F7  #CJK UNIFIED IDEOGRAPH
+0xE0C5 0x500F  #CJK UNIFIED IDEOGRAPH
+0xE0C6 0x7317  #CJK UNIFIED IDEOGRAPH
+0xE0C7 0x730A  #CJK UNIFIED IDEOGRAPH
+0xE0C8 0x731C  #CJK UNIFIED IDEOGRAPH
+0xE0C9 0x7316  #CJK UNIFIED IDEOGRAPH
+0xE0CA 0x731D  #CJK UNIFIED IDEOGRAPH
+0xE0CB 0x7334  #CJK UNIFIED IDEOGRAPH
+0xE0CC 0x732F  #CJK UNIFIED IDEOGRAPH
+0xE0CD 0x7329  #CJK UNIFIED IDEOGRAPH
+0xE0CE 0x7325  #CJK UNIFIED IDEOGRAPH
+0xE0CF 0x733E  #CJK UNIFIED IDEOGRAPH
+0xE0D0 0x734E  #CJK UNIFIED IDEOGRAPH
+0xE0D1 0x734F  #CJK UNIFIED IDEOGRAPH
+0xE0D2 0x9ED8  #CJK UNIFIED IDEOGRAPH
+0xE0D3 0x7357  #CJK UNIFIED IDEOGRAPH
+0xE0D4 0x736A  #CJK UNIFIED IDEOGRAPH
+0xE0D5 0x7368  #CJK UNIFIED IDEOGRAPH
+0xE0D6 0x7370  #CJK UNIFIED IDEOGRAPH
+0xE0D7 0x7378  #CJK UNIFIED IDEOGRAPH
+0xE0D8 0x7375  #CJK UNIFIED IDEOGRAPH
+0xE0D9 0x737B  #CJK UNIFIED IDEOGRAPH
+0xE0DA 0x737A  #CJK UNIFIED IDEOGRAPH
+0xE0DB 0x73C8  #CJK UNIFIED IDEOGRAPH
+0xE0DC 0x73B3  #CJK UNIFIED IDEOGRAPH
+0xE0DD 0x73CE  #CJK UNIFIED IDEOGRAPH
+0xE0DE 0x73BB  #CJK UNIFIED IDEOGRAPH
+0xE0DF 0x73C0  #CJK UNIFIED IDEOGRAPH
+0xE0E0 0x73E5  #CJK UNIFIED IDEOGRAPH
+0xE0E1 0x73EE  #CJK UNIFIED IDEOGRAPH
+0xE0E2 0x73DE  #CJK UNIFIED IDEOGRAPH
+0xE0E3 0x74A2  #CJK UNIFIED IDEOGRAPH
+0xE0E4 0x7405  #CJK UNIFIED IDEOGRAPH
+0xE0E5 0x746F  #CJK UNIFIED IDEOGRAPH
+0xE0E6 0x7425  #CJK UNIFIED IDEOGRAPH
+0xE0E7 0x73F8  #CJK UNIFIED IDEOGRAPH
+0xE0E8 0x7432  #CJK UNIFIED IDEOGRAPH
+0xE0E9 0x743A  #CJK UNIFIED IDEOGRAPH
+0xE0EA 0x7455  #CJK UNIFIED IDEOGRAPH
+0xE0EB 0x743F  #CJK UNIFIED IDEOGRAPH
+0xE0EC 0x745F  #CJK UNIFIED IDEOGRAPH
+0xE0ED 0x7459  #CJK UNIFIED IDEOGRAPH
+0xE0EE 0x7441  #CJK UNIFIED IDEOGRAPH
+0xE0EF 0x745C  #CJK UNIFIED IDEOGRAPH
+0xE0F0 0x7469  #CJK UNIFIED IDEOGRAPH
+0xE0F1 0x7470  #CJK UNIFIED IDEOGRAPH
+0xE0F2 0x7463  #CJK UNIFIED IDEOGRAPH
+0xE0F3 0x746A  #CJK UNIFIED IDEOGRAPH
+0xE0F4 0x7476  #CJK UNIFIED IDEOGRAPH
+0xE0F5 0x747E  #CJK UNIFIED IDEOGRAPH
+0xE0F6 0x748B  #CJK UNIFIED IDEOGRAPH
+0xE0F7 0x749E  #CJK UNIFIED IDEOGRAPH
+0xE0F8 0x74A7  #CJK UNIFIED IDEOGRAPH
+0xE0F9 0x74CA  #CJK UNIFIED IDEOGRAPH
+0xE0FA 0x74CF  #CJK UNIFIED IDEOGRAPH
+0xE0FB 0x74D4  #CJK UNIFIED IDEOGRAPH
+0xE0FC 0x73F1  #CJK UNIFIED IDEOGRAPH
+0xE140 0x74E0  #CJK UNIFIED IDEOGRAPH
+0xE141 0x74E3  #CJK UNIFIED IDEOGRAPH
+0xE142 0x74E7  #CJK UNIFIED IDEOGRAPH
+0xE143 0x74E9  #CJK UNIFIED IDEOGRAPH
+0xE144 0x74EE  #CJK UNIFIED IDEOGRAPH
+0xE145 0x74F2  #CJK UNIFIED IDEOGRAPH
+0xE146 0x74F0  #CJK UNIFIED IDEOGRAPH
+0xE147 0x74F1  #CJK UNIFIED IDEOGRAPH
+0xE148 0x74F8  #CJK UNIFIED IDEOGRAPH
+0xE149 0x74F7  #CJK UNIFIED IDEOGRAPH
+0xE14A 0x7504  #CJK UNIFIED IDEOGRAPH
+0xE14B 0x7503  #CJK UNIFIED IDEOGRAPH
+0xE14C 0x7505  #CJK UNIFIED IDEOGRAPH
+0xE14D 0x750C  #CJK UNIFIED IDEOGRAPH
+0xE14E 0x750E  #CJK UNIFIED IDEOGRAPH
+0xE14F 0x750D  #CJK UNIFIED IDEOGRAPH
+0xE150 0x7515  #CJK UNIFIED IDEOGRAPH
+0xE151 0x7513  #CJK UNIFIED IDEOGRAPH
+0xE152 0x751E  #CJK UNIFIED IDEOGRAPH
+0xE153 0x7526  #CJK UNIFIED IDEOGRAPH
+0xE154 0x752C  #CJK UNIFIED IDEOGRAPH
+0xE155 0x753C  #CJK UNIFIED IDEOGRAPH
+0xE156 0x7544  #CJK UNIFIED IDEOGRAPH
+0xE157 0x754D  #CJK UNIFIED IDEOGRAPH
+0xE158 0x754A  #CJK UNIFIED IDEOGRAPH
+0xE159 0x7549  #CJK UNIFIED IDEOGRAPH
+0xE15A 0x755B  #CJK UNIFIED IDEOGRAPH
+0xE15B 0x7546  #CJK UNIFIED IDEOGRAPH
+0xE15C 0x755A  #CJK UNIFIED IDEOGRAPH
+0xE15D 0x7569  #CJK UNIFIED IDEOGRAPH
+0xE15E 0x7564  #CJK UNIFIED IDEOGRAPH
+0xE15F 0x7567  #CJK UNIFIED IDEOGRAPH
+0xE160 0x756B  #CJK UNIFIED IDEOGRAPH
+0xE161 0x756D  #CJK UNIFIED IDEOGRAPH
+0xE162 0x7578  #CJK UNIFIED IDEOGRAPH
+0xE163 0x7576  #CJK UNIFIED IDEOGRAPH
+0xE164 0x7586  #CJK UNIFIED IDEOGRAPH
+0xE165 0x7587  #CJK UNIFIED IDEOGRAPH
+0xE166 0x7574  #CJK UNIFIED IDEOGRAPH
+0xE167 0x758A  #CJK UNIFIED IDEOGRAPH
+0xE168 0x7589  #CJK UNIFIED IDEOGRAPH
+0xE169 0x7582  #CJK UNIFIED IDEOGRAPH
+0xE16A 0x7594  #CJK UNIFIED IDEOGRAPH
+0xE16B 0x759A  #CJK UNIFIED IDEOGRAPH
+0xE16C 0x759D  #CJK UNIFIED IDEOGRAPH
+0xE16D 0x75A5  #CJK UNIFIED IDEOGRAPH
+0xE16E 0x75A3  #CJK UNIFIED IDEOGRAPH
+0xE16F 0x75C2  #CJK UNIFIED IDEOGRAPH
+0xE170 0x75B3  #CJK UNIFIED IDEOGRAPH
+0xE171 0x75C3  #CJK UNIFIED IDEOGRAPH
+0xE172 0x75B5  #CJK UNIFIED IDEOGRAPH
+0xE173 0x75BD  #CJK UNIFIED IDEOGRAPH
+0xE174 0x75B8  #CJK UNIFIED IDEOGRAPH
+0xE175 0x75BC  #CJK UNIFIED IDEOGRAPH
+0xE176 0x75B1  #CJK UNIFIED IDEOGRAPH
+0xE177 0x75CD  #CJK UNIFIED IDEOGRAPH
+0xE178 0x75CA  #CJK UNIFIED IDEOGRAPH
+0xE179 0x75D2  #CJK UNIFIED IDEOGRAPH
+0xE17A 0x75D9  #CJK UNIFIED IDEOGRAPH
+0xE17B 0x75E3  #CJK UNIFIED IDEOGRAPH
+0xE17C 0x75DE  #CJK UNIFIED IDEOGRAPH
+0xE17D 0x75FE  #CJK UNIFIED IDEOGRAPH
+0xE17E 0x75FF  #CJK UNIFIED IDEOGRAPH
+0xE180 0x75FC  #CJK UNIFIED IDEOGRAPH
+0xE181 0x7601  #CJK UNIFIED IDEOGRAPH
+0xE182 0x75F0  #CJK UNIFIED IDEOGRAPH
+0xE183 0x75FA  #CJK UNIFIED IDEOGRAPH
+0xE184 0x75F2  #CJK UNIFIED IDEOGRAPH
+0xE185 0x75F3  #CJK UNIFIED IDEOGRAPH
+0xE186 0x760B  #CJK UNIFIED IDEOGRAPH
+0xE187 0x760D  #CJK UNIFIED IDEOGRAPH
+0xE188 0x7609  #CJK UNIFIED IDEOGRAPH
+0xE189 0x761F  #CJK UNIFIED IDEOGRAPH
+0xE18A 0x7627  #CJK UNIFIED IDEOGRAPH
+0xE18B 0x7620  #CJK UNIFIED IDEOGRAPH
+0xE18C 0x7621  #CJK UNIFIED IDEOGRAPH
+0xE18D 0x7622  #CJK UNIFIED IDEOGRAPH
+0xE18E 0x7624  #CJK UNIFIED IDEOGRAPH
+0xE18F 0x7634  #CJK UNIFIED IDEOGRAPH
+0xE190 0x7630  #CJK UNIFIED IDEOGRAPH
+0xE191 0x763B  #CJK UNIFIED IDEOGRAPH
+0xE192 0x7647  #CJK UNIFIED IDEOGRAPH
+0xE193 0x7648  #CJK UNIFIED IDEOGRAPH
+0xE194 0x7646  #CJK UNIFIED IDEOGRAPH
+0xE195 0x765C  #CJK UNIFIED IDEOGRAPH
+0xE196 0x7658  #CJK UNIFIED IDEOGRAPH
+0xE197 0x7661  #CJK UNIFIED IDEOGRAPH
+0xE198 0x7662  #CJK UNIFIED IDEOGRAPH
+0xE199 0x7668  #CJK UNIFIED IDEOGRAPH
+0xE19A 0x7669  #CJK UNIFIED IDEOGRAPH
+0xE19B 0x766A  #CJK UNIFIED IDEOGRAPH
+0xE19C 0x7667  #CJK UNIFIED IDEOGRAPH
+0xE19D 0x766C  #CJK UNIFIED IDEOGRAPH
+0xE19E 0x7670  #CJK UNIFIED IDEOGRAPH
+0xE19F 0x7672  #CJK UNIFIED IDEOGRAPH
+0xE1A0 0x7676  #CJK UNIFIED IDEOGRAPH
+0xE1A1 0x7678  #CJK UNIFIED IDEOGRAPH
+0xE1A2 0x767C  #CJK UNIFIED IDEOGRAPH
+0xE1A3 0x7680  #CJK UNIFIED IDEOGRAPH
+0xE1A4 0x7683  #CJK UNIFIED IDEOGRAPH
+0xE1A5 0x7688  #CJK UNIFIED IDEOGRAPH
+0xE1A6 0x768B  #CJK UNIFIED IDEOGRAPH
+0xE1A7 0x768E  #CJK UNIFIED IDEOGRAPH
+0xE1A8 0x7696  #CJK UNIFIED IDEOGRAPH
+0xE1A9 0x7693  #CJK UNIFIED IDEOGRAPH
+0xE1AA 0x7699  #CJK UNIFIED IDEOGRAPH
+0xE1AB 0x769A  #CJK UNIFIED IDEOGRAPH
+0xE1AC 0x76B0  #CJK UNIFIED IDEOGRAPH
+0xE1AD 0x76B4  #CJK UNIFIED IDEOGRAPH
+0xE1AE 0x76B8  #CJK UNIFIED IDEOGRAPH
+0xE1AF 0x76B9  #CJK UNIFIED IDEOGRAPH
+0xE1B0 0x76BA  #CJK UNIFIED IDEOGRAPH
+0xE1B1 0x76C2  #CJK UNIFIED IDEOGRAPH
+0xE1B2 0x76CD  #CJK UNIFIED IDEOGRAPH
+0xE1B3 0x76D6  #CJK UNIFIED IDEOGRAPH
+0xE1B4 0x76D2  #CJK UNIFIED IDEOGRAPH
+0xE1B5 0x76DE  #CJK UNIFIED IDEOGRAPH
+0xE1B6 0x76E1  #CJK UNIFIED IDEOGRAPH
+0xE1B7 0x76E5  #CJK UNIFIED IDEOGRAPH
+0xE1B8 0x76E7  #CJK UNIFIED IDEOGRAPH
+0xE1B9 0x76EA  #CJK UNIFIED IDEOGRAPH
+0xE1BA 0x862F  #CJK UNIFIED IDEOGRAPH
+0xE1BB 0x76FB  #CJK UNIFIED IDEOGRAPH
+0xE1BC 0x7708  #CJK UNIFIED IDEOGRAPH
+0xE1BD 0x7707  #CJK UNIFIED IDEOGRAPH
+0xE1BE 0x7704  #CJK UNIFIED IDEOGRAPH
+0xE1BF 0x7729  #CJK UNIFIED IDEOGRAPH
+0xE1C0 0x7724  #CJK UNIFIED IDEOGRAPH
+0xE1C1 0x771E  #CJK UNIFIED IDEOGRAPH
+0xE1C2 0x7725  #CJK UNIFIED IDEOGRAPH
+0xE1C3 0x7726  #CJK UNIFIED IDEOGRAPH
+0xE1C4 0x771B  #CJK UNIFIED IDEOGRAPH
+0xE1C5 0x7737  #CJK UNIFIED IDEOGRAPH
+0xE1C6 0x7738  #CJK UNIFIED IDEOGRAPH
+0xE1C7 0x7747  #CJK UNIFIED IDEOGRAPH
+0xE1C8 0x775A  #CJK UNIFIED IDEOGRAPH
+0xE1C9 0x7768  #CJK UNIFIED IDEOGRAPH
+0xE1CA 0x776B  #CJK UNIFIED IDEOGRAPH
+0xE1CB 0x775B  #CJK UNIFIED IDEOGRAPH
+0xE1CC 0x7765  #CJK UNIFIED IDEOGRAPH
+0xE1CD 0x777F  #CJK UNIFIED IDEOGRAPH
+0xE1CE 0x777E  #CJK UNIFIED IDEOGRAPH
+0xE1CF 0x7779  #CJK UNIFIED IDEOGRAPH
+0xE1D0 0x778E  #CJK UNIFIED IDEOGRAPH
+0xE1D1 0x778B  #CJK UNIFIED IDEOGRAPH
+0xE1D2 0x7791  #CJK UNIFIED IDEOGRAPH
+0xE1D3 0x77A0  #CJK UNIFIED IDEOGRAPH
+0xE1D4 0x779E  #CJK UNIFIED IDEOGRAPH
+0xE1D5 0x77B0  #CJK UNIFIED IDEOGRAPH
+0xE1D6 0x77B6  #CJK UNIFIED IDEOGRAPH
+0xE1D7 0x77B9  #CJK UNIFIED IDEOGRAPH
+0xE1D8 0x77BF  #CJK UNIFIED IDEOGRAPH
+0xE1D9 0x77BC  #CJK UNIFIED IDEOGRAPH
+0xE1DA 0x77BD  #CJK UNIFIED IDEOGRAPH
+0xE1DB 0x77BB  #CJK UNIFIED IDEOGRAPH
+0xE1DC 0x77C7  #CJK UNIFIED IDEOGRAPH
+0xE1DD 0x77CD  #CJK UNIFIED IDEOGRAPH
+0xE1DE 0x77D7  #CJK UNIFIED IDEOGRAPH
+0xE1DF 0x77DA  #CJK UNIFIED IDEOGRAPH
+0xE1E0 0x77DC  #CJK UNIFIED IDEOGRAPH
+0xE1E1 0x77E3  #CJK UNIFIED IDEOGRAPH
+0xE1E2 0x77EE  #CJK UNIFIED IDEOGRAPH
+0xE1E3 0x77FC  #CJK UNIFIED IDEOGRAPH
+0xE1E4 0x780C  #CJK UNIFIED IDEOGRAPH
+0xE1E5 0x7812  #CJK UNIFIED IDEOGRAPH
+0xE1E6 0x7926  #CJK UNIFIED IDEOGRAPH
+0xE1E7 0x7820  #CJK UNIFIED IDEOGRAPH
+0xE1E8 0x792A  #CJK UNIFIED IDEOGRAPH
+0xE1E9 0x7845  #CJK UNIFIED IDEOGRAPH
+0xE1EA 0x788E  #CJK UNIFIED IDEOGRAPH
+0xE1EB 0x7874  #CJK UNIFIED IDEOGRAPH
+0xE1EC 0x7886  #CJK UNIFIED IDEOGRAPH
+0xE1ED 0x787C  #CJK UNIFIED IDEOGRAPH
+0xE1EE 0x789A  #CJK UNIFIED IDEOGRAPH
+0xE1EF 0x788C  #CJK UNIFIED IDEOGRAPH
+0xE1F0 0x78A3  #CJK UNIFIED IDEOGRAPH
+0xE1F1 0x78B5  #CJK UNIFIED IDEOGRAPH
+0xE1F2 0x78AA  #CJK UNIFIED IDEOGRAPH
+0xE1F3 0x78AF  #CJK UNIFIED IDEOGRAPH
+0xE1F4 0x78D1  #CJK UNIFIED IDEOGRAPH
+0xE1F5 0x78C6  #CJK UNIFIED IDEOGRAPH
+0xE1F6 0x78CB  #CJK UNIFIED IDEOGRAPH
+0xE1F7 0x78D4  #CJK UNIFIED IDEOGRAPH
+0xE1F8 0x78BE  #CJK UNIFIED IDEOGRAPH
+0xE1F9 0x78BC  #CJK UNIFIED IDEOGRAPH
+0xE1FA 0x78C5  #CJK UNIFIED IDEOGRAPH
+0xE1FB 0x78CA  #CJK UNIFIED IDEOGRAPH
+0xE1FC 0x78EC  #CJK UNIFIED IDEOGRAPH
+0xE240 0x78E7  #CJK UNIFIED IDEOGRAPH
+0xE241 0x78DA  #CJK UNIFIED IDEOGRAPH
+0xE242 0x78FD  #CJK UNIFIED IDEOGRAPH
+0xE243 0x78F4  #CJK UNIFIED IDEOGRAPH
+0xE244 0x7907  #CJK UNIFIED IDEOGRAPH
+0xE245 0x7912  #CJK UNIFIED IDEOGRAPH
+0xE246 0x7911  #CJK UNIFIED IDEOGRAPH
+0xE247 0x7919  #CJK UNIFIED IDEOGRAPH
+0xE248 0x792C  #CJK UNIFIED IDEOGRAPH
+0xE249 0x792B  #CJK UNIFIED IDEOGRAPH
+0xE24A 0x7940  #CJK UNIFIED IDEOGRAPH
+0xE24B 0x7960  #CJK UNIFIED IDEOGRAPH
+0xE24C 0x7957  #CJK UNIFIED IDEOGRAPH
+0xE24D 0x795F  #CJK UNIFIED IDEOGRAPH
+0xE24E 0x795A  #CJK UNIFIED IDEOGRAPH
+0xE24F 0x7955  #CJK UNIFIED IDEOGRAPH
+0xE250 0x7953  #CJK UNIFIED IDEOGRAPH
+0xE251 0x797A  #CJK UNIFIED IDEOGRAPH
+0xE252 0x797F  #CJK UNIFIED IDEOGRAPH
+0xE253 0x798A  #CJK UNIFIED IDEOGRAPH
+0xE254 0x799D  #CJK UNIFIED IDEOGRAPH
+0xE255 0x79A7  #CJK UNIFIED IDEOGRAPH
+0xE256 0x9F4B  #CJK UNIFIED IDEOGRAPH
+0xE257 0x79AA  #CJK UNIFIED IDEOGRAPH
+0xE258 0x79AE  #CJK UNIFIED IDEOGRAPH
+0xE259 0x79B3  #CJK UNIFIED IDEOGRAPH
+0xE25A 0x79B9  #CJK UNIFIED IDEOGRAPH
+0xE25B 0x79BA  #CJK UNIFIED IDEOGRAPH
+0xE25C 0x79C9  #CJK UNIFIED IDEOGRAPH
+0xE25D 0x79D5  #CJK UNIFIED IDEOGRAPH
+0xE25E 0x79E7  #CJK UNIFIED IDEOGRAPH
+0xE25F 0x79EC  #CJK UNIFIED IDEOGRAPH
+0xE260 0x79E1  #CJK UNIFIED IDEOGRAPH
+0xE261 0x79E3  #CJK UNIFIED IDEOGRAPH
+0xE262 0x7A08  #CJK UNIFIED IDEOGRAPH
+0xE263 0x7A0D  #CJK UNIFIED IDEOGRAPH
+0xE264 0x7A18  #CJK UNIFIED IDEOGRAPH
+0xE265 0x7A19  #CJK UNIFIED IDEOGRAPH
+0xE266 0x7A20  #CJK UNIFIED IDEOGRAPH
+0xE267 0x7A1F  #CJK UNIFIED IDEOGRAPH
+0xE268 0x7980  #CJK UNIFIED IDEOGRAPH
+0xE269 0x7A31  #CJK UNIFIED IDEOGRAPH
+0xE26A 0x7A3B  #CJK UNIFIED IDEOGRAPH
+0xE26B 0x7A3E  #CJK UNIFIED IDEOGRAPH
+0xE26C 0x7A37  #CJK UNIFIED IDEOGRAPH
+0xE26D 0x7A43  #CJK UNIFIED IDEOGRAPH
+0xE26E 0x7A57  #CJK UNIFIED IDEOGRAPH
+0xE26F 0x7A49  #CJK UNIFIED IDEOGRAPH
+0xE270 0x7A61  #CJK UNIFIED IDEOGRAPH
+0xE271 0x7A62  #CJK UNIFIED IDEOGRAPH
+0xE272 0x7A69  #CJK UNIFIED IDEOGRAPH
+0xE273 0x9F9D  #CJK UNIFIED IDEOGRAPH
+0xE274 0x7A70  #CJK UNIFIED IDEOGRAPH
+0xE275 0x7A79  #CJK UNIFIED IDEOGRAPH
+0xE276 0x7A7D  #CJK UNIFIED IDEOGRAPH
+0xE277 0x7A88  #CJK UNIFIED IDEOGRAPH
+0xE278 0x7A97  #CJK UNIFIED IDEOGRAPH
+0xE279 0x7A95  #CJK UNIFIED IDEOGRAPH
+0xE27A 0x7A98  #CJK UNIFIED IDEOGRAPH
+0xE27B 0x7A96  #CJK UNIFIED IDEOGRAPH
+0xE27C 0x7AA9  #CJK UNIFIED IDEOGRAPH
+0xE27D 0x7AC8  #CJK UNIFIED IDEOGRAPH
+0xE27E 0x7AB0  #CJK UNIFIED IDEOGRAPH
+0xE280 0x7AB6  #CJK UNIFIED IDEOGRAPH
+0xE281 0x7AC5  #CJK UNIFIED IDEOGRAPH
+0xE282 0x7AC4  #CJK UNIFIED IDEOGRAPH
+0xE283 0x7ABF  #CJK UNIFIED IDEOGRAPH
+0xE284 0x9083  #CJK UNIFIED IDEOGRAPH
+0xE285 0x7AC7  #CJK UNIFIED IDEOGRAPH
+0xE286 0x7ACA  #CJK UNIFIED IDEOGRAPH
+0xE287 0x7ACD  #CJK UNIFIED IDEOGRAPH
+0xE288 0x7ACF  #CJK UNIFIED IDEOGRAPH
+0xE289 0x7AD5  #CJK UNIFIED IDEOGRAPH
+0xE28A 0x7AD3  #CJK UNIFIED IDEOGRAPH
+0xE28B 0x7AD9  #CJK UNIFIED IDEOGRAPH
+0xE28C 0x7ADA  #CJK UNIFIED IDEOGRAPH
+0xE28D 0x7ADD  #CJK UNIFIED IDEOGRAPH
+0xE28E 0x7AE1  #CJK UNIFIED IDEOGRAPH
+0xE28F 0x7AE2  #CJK UNIFIED IDEOGRAPH
+0xE290 0x7AE6  #CJK UNIFIED IDEOGRAPH
+0xE291 0x7AED  #CJK UNIFIED IDEOGRAPH
+0xE292 0x7AF0  #CJK UNIFIED IDEOGRAPH
+0xE293 0x7B02  #CJK UNIFIED IDEOGRAPH
+0xE294 0x7B0F  #CJK UNIFIED IDEOGRAPH
+0xE295 0x7B0A  #CJK UNIFIED IDEOGRAPH
+0xE296 0x7B06  #CJK UNIFIED IDEOGRAPH
+0xE297 0x7B33  #CJK UNIFIED IDEOGRAPH
+0xE298 0x7B18  #CJK UNIFIED IDEOGRAPH
+0xE299 0x7B19  #CJK UNIFIED IDEOGRAPH
+0xE29A 0x7B1E  #CJK UNIFIED IDEOGRAPH
+0xE29B 0x7B35  #CJK UNIFIED IDEOGRAPH
+0xE29C 0x7B28  #CJK UNIFIED IDEOGRAPH
+0xE29D 0x7B36  #CJK UNIFIED IDEOGRAPH
+0xE29E 0x7B50  #CJK UNIFIED IDEOGRAPH
+0xE29F 0x7B7A  #CJK UNIFIED IDEOGRAPH
+0xE2A0 0x7B04  #CJK UNIFIED IDEOGRAPH
+0xE2A1 0x7B4D  #CJK UNIFIED IDEOGRAPH
+0xE2A2 0x7B0B  #CJK UNIFIED IDEOGRAPH
+0xE2A3 0x7B4C  #CJK UNIFIED IDEOGRAPH
+0xE2A4 0x7B45  #CJK UNIFIED IDEOGRAPH
+0xE2A5 0x7B75  #CJK UNIFIED IDEOGRAPH
+0xE2A6 0x7B65  #CJK UNIFIED IDEOGRAPH
+0xE2A7 0x7B74  #CJK UNIFIED IDEOGRAPH
+0xE2A8 0x7B67  #CJK UNIFIED IDEOGRAPH
+0xE2A9 0x7B70  #CJK UNIFIED IDEOGRAPH
+0xE2AA 0x7B71  #CJK UNIFIED IDEOGRAPH
+0xE2AB 0x7B6C  #CJK UNIFIED IDEOGRAPH
+0xE2AC 0x7B6E  #CJK UNIFIED IDEOGRAPH
+0xE2AD 0x7B9D  #CJK UNIFIED IDEOGRAPH
+0xE2AE 0x7B98  #CJK UNIFIED IDEOGRAPH
+0xE2AF 0x7B9F  #CJK UNIFIED IDEOGRAPH
+0xE2B0 0x7B8D  #CJK UNIFIED IDEOGRAPH
+0xE2B1 0x7B9C  #CJK UNIFIED IDEOGRAPH
+0xE2B2 0x7B9A  #CJK UNIFIED IDEOGRAPH
+0xE2B3 0x7B8B  #CJK UNIFIED IDEOGRAPH
+0xE2B4 0x7B92  #CJK UNIFIED IDEOGRAPH
+0xE2B5 0x7B8F  #CJK UNIFIED IDEOGRAPH
+0xE2B6 0x7B5D  #CJK UNIFIED IDEOGRAPH
+0xE2B7 0x7B99  #CJK UNIFIED IDEOGRAPH
+0xE2B8 0x7BCB  #CJK UNIFIED IDEOGRAPH
+0xE2B9 0x7BC1  #CJK UNIFIED IDEOGRAPH
+0xE2BA 0x7BCC  #CJK UNIFIED IDEOGRAPH
+0xE2BB 0x7BCF  #CJK UNIFIED IDEOGRAPH
+0xE2BC 0x7BB4  #CJK UNIFIED IDEOGRAPH
+0xE2BD 0x7BC6  #CJK UNIFIED IDEOGRAPH
+0xE2BE 0x7BDD  #CJK UNIFIED IDEOGRAPH
+0xE2BF 0x7BE9  #CJK UNIFIED IDEOGRAPH
+0xE2C0 0x7C11  #CJK UNIFIED IDEOGRAPH
+0xE2C1 0x7C14  #CJK UNIFIED IDEOGRAPH
+0xE2C2 0x7BE6  #CJK UNIFIED IDEOGRAPH
+0xE2C3 0x7BE5  #CJK UNIFIED IDEOGRAPH
+0xE2C4 0x7C60  #CJK UNIFIED IDEOGRAPH
+0xE2C5 0x7C00  #CJK UNIFIED IDEOGRAPH
+0xE2C6 0x7C07  #CJK UNIFIED IDEOGRAPH
+0xE2C7 0x7C13  #CJK UNIFIED IDEOGRAPH
+0xE2C8 0x7BF3  #CJK UNIFIED IDEOGRAPH
+0xE2C9 0x7BF7  #CJK UNIFIED IDEOGRAPH
+0xE2CA 0x7C17  #CJK UNIFIED IDEOGRAPH
+0xE2CB 0x7C0D  #CJK UNIFIED IDEOGRAPH
+0xE2CC 0x7BF6  #CJK UNIFIED IDEOGRAPH
+0xE2CD 0x7C23  #CJK UNIFIED IDEOGRAPH
+0xE2CE 0x7C27  #CJK UNIFIED IDEOGRAPH
+0xE2CF 0x7C2A  #CJK UNIFIED IDEOGRAPH
+0xE2D0 0x7C1F  #CJK UNIFIED IDEOGRAPH
+0xE2D1 0x7C37  #CJK UNIFIED IDEOGRAPH
+0xE2D2 0x7C2B  #CJK UNIFIED IDEOGRAPH
+0xE2D3 0x7C3D  #CJK UNIFIED IDEOGRAPH
+0xE2D4 0x7C4C  #CJK UNIFIED IDEOGRAPH
+0xE2D5 0x7C43  #CJK UNIFIED IDEOGRAPH
+0xE2D6 0x7C54  #CJK UNIFIED IDEOGRAPH
+0xE2D7 0x7C4F  #CJK UNIFIED IDEOGRAPH
+0xE2D8 0x7C40  #CJK UNIFIED IDEOGRAPH
+0xE2D9 0x7C50  #CJK UNIFIED IDEOGRAPH
+0xE2DA 0x7C58  #CJK UNIFIED IDEOGRAPH
+0xE2DB 0x7C5F  #CJK UNIFIED IDEOGRAPH
+0xE2DC 0x7C64  #CJK UNIFIED IDEOGRAPH
+0xE2DD 0x7C56  #CJK UNIFIED IDEOGRAPH
+0xE2DE 0x7C65  #CJK UNIFIED IDEOGRAPH
+0xE2DF 0x7C6C  #CJK UNIFIED IDEOGRAPH
+0xE2E0 0x7C75  #CJK UNIFIED IDEOGRAPH
+0xE2E1 0x7C83  #CJK UNIFIED IDEOGRAPH
+0xE2E2 0x7C90  #CJK UNIFIED IDEOGRAPH
+0xE2E3 0x7CA4  #CJK UNIFIED IDEOGRAPH
+0xE2E4 0x7CAD  #CJK UNIFIED IDEOGRAPH
+0xE2E5 0x7CA2  #CJK UNIFIED IDEOGRAPH
+0xE2E6 0x7CAB  #CJK UNIFIED IDEOGRAPH
+0xE2E7 0x7CA1  #CJK UNIFIED IDEOGRAPH
+0xE2E8 0x7CA8  #CJK UNIFIED IDEOGRAPH
+0xE2E9 0x7CB3  #CJK UNIFIED IDEOGRAPH
+0xE2EA 0x7CB2  #CJK UNIFIED IDEOGRAPH
+0xE2EB 0x7CB1  #CJK UNIFIED IDEOGRAPH
+0xE2EC 0x7CAE  #CJK UNIFIED IDEOGRAPH
+0xE2ED 0x7CB9  #CJK UNIFIED IDEOGRAPH
+0xE2EE 0x7CBD  #CJK UNIFIED IDEOGRAPH
+0xE2EF 0x7CC0  #CJK UNIFIED IDEOGRAPH
+0xE2F0 0x7CC5  #CJK UNIFIED IDEOGRAPH
+0xE2F1 0x7CC2  #CJK UNIFIED IDEOGRAPH
+0xE2F2 0x7CD8  #CJK UNIFIED IDEOGRAPH
+0xE2F3 0x7CD2  #CJK UNIFIED IDEOGRAPH
+0xE2F4 0x7CDC  #CJK UNIFIED IDEOGRAPH
+0xE2F5 0x7CE2  #CJK UNIFIED IDEOGRAPH
+0xE2F6 0x9B3B  #CJK UNIFIED IDEOGRAPH
+0xE2F7 0x7CEF  #CJK UNIFIED IDEOGRAPH
+0xE2F8 0x7CF2  #CJK UNIFIED IDEOGRAPH
+0xE2F9 0x7CF4  #CJK UNIFIED IDEOGRAPH
+0xE2FA 0x7CF6  #CJK UNIFIED IDEOGRAPH
+0xE2FB 0x7CFA  #CJK UNIFIED IDEOGRAPH
+0xE2FC 0x7D06  #CJK UNIFIED IDEOGRAPH
+0xE340 0x7D02  #CJK UNIFIED IDEOGRAPH
+0xE341 0x7D1C  #CJK UNIFIED IDEOGRAPH
+0xE342 0x7D15  #CJK UNIFIED IDEOGRAPH
+0xE343 0x7D0A  #CJK UNIFIED IDEOGRAPH
+0xE344 0x7D45  #CJK UNIFIED IDEOGRAPH
+0xE345 0x7D4B  #CJK UNIFIED IDEOGRAPH
+0xE346 0x7D2E  #CJK UNIFIED IDEOGRAPH
+0xE347 0x7D32  #CJK UNIFIED IDEOGRAPH
+0xE348 0x7D3F  #CJK UNIFIED IDEOGRAPH
+0xE349 0x7D35  #CJK UNIFIED IDEOGRAPH
+0xE34A 0x7D46  #CJK UNIFIED IDEOGRAPH
+0xE34B 0x7D73  #CJK UNIFIED IDEOGRAPH
+0xE34C 0x7D56  #CJK UNIFIED IDEOGRAPH
+0xE34D 0x7D4E  #CJK UNIFIED IDEOGRAPH
+0xE34E 0x7D72  #CJK UNIFIED IDEOGRAPH
+0xE34F 0x7D68  #CJK UNIFIED IDEOGRAPH
+0xE350 0x7D6E  #CJK UNIFIED IDEOGRAPH
+0xE351 0x7D4F  #CJK UNIFIED IDEOGRAPH
+0xE352 0x7D63  #CJK UNIFIED IDEOGRAPH
+0xE353 0x7D93  #CJK UNIFIED IDEOGRAPH
+0xE354 0x7D89  #CJK UNIFIED IDEOGRAPH
+0xE355 0x7D5B  #CJK UNIFIED IDEOGRAPH
+0xE356 0x7D8F  #CJK UNIFIED IDEOGRAPH
+0xE357 0x7D7D  #CJK UNIFIED IDEOGRAPH
+0xE358 0x7D9B  #CJK UNIFIED IDEOGRAPH
+0xE359 0x7DBA  #CJK UNIFIED IDEOGRAPH
+0xE35A 0x7DAE  #CJK UNIFIED IDEOGRAPH
+0xE35B 0x7DA3  #CJK UNIFIED IDEOGRAPH
+0xE35C 0x7DB5  #CJK UNIFIED IDEOGRAPH
+0xE35D 0x7DC7  #CJK UNIFIED IDEOGRAPH
+0xE35E 0x7DBD  #CJK UNIFIED IDEOGRAPH
+0xE35F 0x7DAB  #CJK UNIFIED IDEOGRAPH
+0xE360 0x7E3D  #CJK UNIFIED IDEOGRAPH
+0xE361 0x7DA2  #CJK UNIFIED IDEOGRAPH
+0xE362 0x7DAF  #CJK UNIFIED IDEOGRAPH
+0xE363 0x7DDC  #CJK UNIFIED IDEOGRAPH
+0xE364 0x7DB8  #CJK UNIFIED IDEOGRAPH
+0xE365 0x7D9F  #CJK UNIFIED IDEOGRAPH
+0xE366 0x7DB0  #CJK UNIFIED IDEOGRAPH
+0xE367 0x7DD8  #CJK UNIFIED IDEOGRAPH
+0xE368 0x7DDD  #CJK UNIFIED IDEOGRAPH
+0xE369 0x7DE4  #CJK UNIFIED IDEOGRAPH
+0xE36A 0x7DDE  #CJK UNIFIED IDEOGRAPH
+0xE36B 0x7DFB  #CJK UNIFIED IDEOGRAPH
+0xE36C 0x7DF2  #CJK UNIFIED IDEOGRAPH
+0xE36D 0x7DE1  #CJK UNIFIED IDEOGRAPH
+0xE36E 0x7E05  #CJK UNIFIED IDEOGRAPH
+0xE36F 0x7E0A  #CJK UNIFIED IDEOGRAPH
+0xE370 0x7E23  #CJK UNIFIED IDEOGRAPH
+0xE371 0x7E21  #CJK UNIFIED IDEOGRAPH
+0xE372 0x7E12  #CJK UNIFIED IDEOGRAPH
+0xE373 0x7E31  #CJK UNIFIED IDEOGRAPH
+0xE374 0x7E1F  #CJK UNIFIED IDEOGRAPH
+0xE375 0x7E09  #CJK UNIFIED IDEOGRAPH
+0xE376 0x7E0B  #CJK UNIFIED IDEOGRAPH
+0xE377 0x7E22  #CJK UNIFIED IDEOGRAPH
+0xE378 0x7E46  #CJK UNIFIED IDEOGRAPH
+0xE379 0x7E66  #CJK UNIFIED IDEOGRAPH
+0xE37A 0x7E3B  #CJK UNIFIED IDEOGRAPH
+0xE37B 0x7E35  #CJK UNIFIED IDEOGRAPH
+0xE37C 0x7E39  #CJK UNIFIED IDEOGRAPH
+0xE37D 0x7E43  #CJK UNIFIED IDEOGRAPH
+0xE37E 0x7E37  #CJK UNIFIED IDEOGRAPH
+0xE380 0x7E32  #CJK UNIFIED IDEOGRAPH
+0xE381 0x7E3A  #CJK UNIFIED IDEOGRAPH
+0xE382 0x7E67  #CJK UNIFIED IDEOGRAPH
+0xE383 0x7E5D  #CJK UNIFIED IDEOGRAPH
+0xE384 0x7E56  #CJK UNIFIED IDEOGRAPH
+0xE385 0x7E5E  #CJK UNIFIED IDEOGRAPH
+0xE386 0x7E59  #CJK UNIFIED IDEOGRAPH
+0xE387 0x7E5A  #CJK UNIFIED IDEOGRAPH
+0xE388 0x7E79  #CJK UNIFIED IDEOGRAPH
+0xE389 0x7E6A  #CJK UNIFIED IDEOGRAPH
+0xE38A 0x7E69  #CJK UNIFIED IDEOGRAPH
+0xE38B 0x7E7C  #CJK UNIFIED IDEOGRAPH
+0xE38C 0x7E7B  #CJK UNIFIED IDEOGRAPH
+0xE38D 0x7E83  #CJK UNIFIED IDEOGRAPH
+0xE38E 0x7DD5  #CJK UNIFIED IDEOGRAPH
+0xE38F 0x7E7D  #CJK UNIFIED IDEOGRAPH
+0xE390 0x8FAE  #CJK UNIFIED IDEOGRAPH
+0xE391 0x7E7F  #CJK UNIFIED IDEOGRAPH
+0xE392 0x7E88  #CJK UNIFIED IDEOGRAPH
+0xE393 0x7E89  #CJK UNIFIED IDEOGRAPH
+0xE394 0x7E8C  #CJK UNIFIED IDEOGRAPH
+0xE395 0x7E92  #CJK UNIFIED IDEOGRAPH
+0xE396 0x7E90  #CJK UNIFIED IDEOGRAPH
+0xE397 0x7E93  #CJK UNIFIED IDEOGRAPH
+0xE398 0x7E94  #CJK UNIFIED IDEOGRAPH
+0xE399 0x7E96  #CJK UNIFIED IDEOGRAPH
+0xE39A 0x7E8E  #CJK UNIFIED IDEOGRAPH
+0xE39B 0x7E9B  #CJK UNIFIED IDEOGRAPH
+0xE39C 0x7E9C  #CJK UNIFIED IDEOGRAPH
+0xE39D 0x7F38  #CJK UNIFIED IDEOGRAPH
+0xE39E 0x7F3A  #CJK UNIFIED IDEOGRAPH
+0xE39F 0x7F45  #CJK UNIFIED IDEOGRAPH
+0xE3A0 0x7F4C  #CJK UNIFIED IDEOGRAPH
+0xE3A1 0x7F4D  #CJK UNIFIED IDEOGRAPH
+0xE3A2 0x7F4E  #CJK UNIFIED IDEOGRAPH
+0xE3A3 0x7F50  #CJK UNIFIED IDEOGRAPH
+0xE3A4 0x7F51  #CJK UNIFIED IDEOGRAPH
+0xE3A5 0x7F55  #CJK UNIFIED IDEOGRAPH
+0xE3A6 0x7F54  #CJK UNIFIED IDEOGRAPH
+0xE3A7 0x7F58  #CJK UNIFIED IDEOGRAPH
+0xE3A8 0x7F5F  #CJK UNIFIED IDEOGRAPH
+0xE3A9 0x7F60  #CJK UNIFIED IDEOGRAPH
+0xE3AA 0x7F68  #CJK UNIFIED IDEOGRAPH
+0xE3AB 0x7F69  #CJK UNIFIED IDEOGRAPH
+0xE3AC 0x7F67  #CJK UNIFIED IDEOGRAPH
+0xE3AD 0x7F78  #CJK UNIFIED IDEOGRAPH
+0xE3AE 0x7F82  #CJK UNIFIED IDEOGRAPH
+0xE3AF 0x7F86  #CJK UNIFIED IDEOGRAPH
+0xE3B0 0x7F83  #CJK UNIFIED IDEOGRAPH
+0xE3B1 0x7F88  #CJK UNIFIED IDEOGRAPH
+0xE3B2 0x7F87  #CJK UNIFIED IDEOGRAPH
+0xE3B3 0x7F8C  #CJK UNIFIED IDEOGRAPH
+0xE3B4 0x7F94  #CJK UNIFIED IDEOGRAPH
+0xE3B5 0x7F9E  #CJK UNIFIED IDEOGRAPH
+0xE3B6 0x7F9D  #CJK UNIFIED IDEOGRAPH
+0xE3B7 0x7F9A  #CJK UNIFIED IDEOGRAPH
+0xE3B8 0x7FA3  #CJK UNIFIED IDEOGRAPH
+0xE3B9 0x7FAF  #CJK UNIFIED IDEOGRAPH
+0xE3BA 0x7FB2  #CJK UNIFIED IDEOGRAPH
+0xE3BB 0x7FB9  #CJK UNIFIED IDEOGRAPH
+0xE3BC 0x7FAE  #CJK UNIFIED IDEOGRAPH
+0xE3BD 0x7FB6  #CJK UNIFIED IDEOGRAPH
+0xE3BE 0x7FB8  #CJK UNIFIED IDEOGRAPH
+0xE3BF 0x8B71  #CJK UNIFIED IDEOGRAPH
+0xE3C0 0x7FC5  #CJK UNIFIED IDEOGRAPH
+0xE3C1 0x7FC6  #CJK UNIFIED IDEOGRAPH
+0xE3C2 0x7FCA  #CJK UNIFIED IDEOGRAPH
+0xE3C3 0x7FD5  #CJK UNIFIED IDEOGRAPH
+0xE3C4 0x7FD4  #CJK UNIFIED IDEOGRAPH
+0xE3C5 0x7FE1  #CJK UNIFIED IDEOGRAPH
+0xE3C6 0x7FE6  #CJK UNIFIED IDEOGRAPH
+0xE3C7 0x7FE9  #CJK UNIFIED IDEOGRAPH
+0xE3C8 0x7FF3  #CJK UNIFIED IDEOGRAPH
+0xE3C9 0x7FF9  #CJK UNIFIED IDEOGRAPH
+0xE3CA 0x98DC  #CJK UNIFIED IDEOGRAPH
+0xE3CB 0x8006  #CJK UNIFIED IDEOGRAPH
+0xE3CC 0x8004  #CJK UNIFIED IDEOGRAPH
+0xE3CD 0x800B  #CJK UNIFIED IDEOGRAPH
+0xE3CE 0x8012  #CJK UNIFIED IDEOGRAPH
+0xE3CF 0x8018  #CJK UNIFIED IDEOGRAPH
+0xE3D0 0x8019  #CJK UNIFIED IDEOGRAPH
+0xE3D1 0x801C  #CJK UNIFIED IDEOGRAPH
+0xE3D2 0x8021  #CJK UNIFIED IDEOGRAPH
+0xE3D3 0x8028  #CJK UNIFIED IDEOGRAPH
+0xE3D4 0x803F  #CJK UNIFIED IDEOGRAPH
+0xE3D5 0x803B  #CJK UNIFIED IDEOGRAPH
+0xE3D6 0x804A  #CJK UNIFIED IDEOGRAPH
+0xE3D7 0x8046  #CJK UNIFIED IDEOGRAPH
+0xE3D8 0x8052  #CJK UNIFIED IDEOGRAPH
+0xE3D9 0x8058  #CJK UNIFIED IDEOGRAPH
+0xE3DA 0x805A  #CJK UNIFIED IDEOGRAPH
+0xE3DB 0x805F  #CJK UNIFIED IDEOGRAPH
+0xE3DC 0x8062  #CJK UNIFIED IDEOGRAPH
+0xE3DD 0x8068  #CJK UNIFIED IDEOGRAPH
+0xE3DE 0x8073  #CJK UNIFIED IDEOGRAPH
+0xE3DF 0x8072  #CJK UNIFIED IDEOGRAPH
+0xE3E0 0x8070  #CJK UNIFIED IDEOGRAPH
+0xE3E1 0x8076  #CJK UNIFIED IDEOGRAPH
+0xE3E2 0x8079  #CJK UNIFIED IDEOGRAPH
+0xE3E3 0x807D  #CJK UNIFIED IDEOGRAPH
+0xE3E4 0x807F  #CJK UNIFIED IDEOGRAPH
+0xE3E5 0x8084  #CJK UNIFIED IDEOGRAPH
+0xE3E6 0x8086  #CJK UNIFIED IDEOGRAPH
+0xE3E7 0x8085  #CJK UNIFIED IDEOGRAPH
+0xE3E8 0x809B  #CJK UNIFIED IDEOGRAPH
+0xE3E9 0x8093  #CJK UNIFIED IDEOGRAPH
+0xE3EA 0x809A  #CJK UNIFIED IDEOGRAPH
+0xE3EB 0x80AD  #CJK UNIFIED IDEOGRAPH
+0xE3EC 0x5190  #CJK UNIFIED IDEOGRAPH
+0xE3ED 0x80AC  #CJK UNIFIED IDEOGRAPH
+0xE3EE 0x80DB  #CJK UNIFIED IDEOGRAPH
+0xE3EF 0x80E5  #CJK UNIFIED IDEOGRAPH
+0xE3F0 0x80D9  #CJK UNIFIED IDEOGRAPH
+0xE3F1 0x80DD  #CJK UNIFIED IDEOGRAPH
+0xE3F2 0x80C4  #CJK UNIFIED IDEOGRAPH
+0xE3F3 0x80DA  #CJK UNIFIED IDEOGRAPH
+0xE3F4 0x80D6  #CJK UNIFIED IDEOGRAPH
+0xE3F5 0x8109  #CJK UNIFIED IDEOGRAPH
+0xE3F6 0x80EF  #CJK UNIFIED IDEOGRAPH
+0xE3F7 0x80F1  #CJK UNIFIED IDEOGRAPH
+0xE3F8 0x811B  #CJK UNIFIED IDEOGRAPH
+0xE3F9 0x8129  #CJK UNIFIED IDEOGRAPH
+0xE3FA 0x8123  #CJK UNIFIED IDEOGRAPH
+0xE3FB 0x812F  #CJK UNIFIED IDEOGRAPH
+0xE3FC 0x814B  #CJK UNIFIED IDEOGRAPH
+0xE440 0x968B  #CJK UNIFIED IDEOGRAPH
+0xE441 0x8146  #CJK UNIFIED IDEOGRAPH
+0xE442 0x813E  #CJK UNIFIED IDEOGRAPH
+0xE443 0x8153  #CJK UNIFIED IDEOGRAPH
+0xE444 0x8151  #CJK UNIFIED IDEOGRAPH
+0xE445 0x80FC  #CJK UNIFIED IDEOGRAPH
+0xE446 0x8171  #CJK UNIFIED IDEOGRAPH
+0xE447 0x816E  #CJK UNIFIED IDEOGRAPH
+0xE448 0x8165  #CJK UNIFIED IDEOGRAPH
+0xE449 0x8166  #CJK UNIFIED IDEOGRAPH
+0xE44A 0x8174  #CJK UNIFIED IDEOGRAPH
+0xE44B 0x8183  #CJK UNIFIED IDEOGRAPH
+0xE44C 0x8188  #CJK UNIFIED IDEOGRAPH
+0xE44D 0x818A  #CJK UNIFIED IDEOGRAPH
+0xE44E 0x8180  #CJK UNIFIED IDEOGRAPH
+0xE44F 0x8182  #CJK UNIFIED IDEOGRAPH
+0xE450 0x81A0  #CJK UNIFIED IDEOGRAPH
+0xE451 0x8195  #CJK UNIFIED IDEOGRAPH
+0xE452 0x81A4  #CJK UNIFIED IDEOGRAPH
+0xE453 0x81A3  #CJK UNIFIED IDEOGRAPH
+0xE454 0x815F  #CJK UNIFIED IDEOGRAPH
+0xE455 0x8193  #CJK UNIFIED IDEOGRAPH
+0xE456 0x81A9  #CJK UNIFIED IDEOGRAPH
+0xE457 0x81B0  #CJK UNIFIED IDEOGRAPH
+0xE458 0x81B5  #CJK UNIFIED IDEOGRAPH
+0xE459 0x81BE  #CJK UNIFIED IDEOGRAPH
+0xE45A 0x81B8  #CJK UNIFIED IDEOGRAPH
+0xE45B 0x81BD  #CJK UNIFIED IDEOGRAPH
+0xE45C 0x81C0  #CJK UNIFIED IDEOGRAPH
+0xE45D 0x81C2  #CJK UNIFIED IDEOGRAPH
+0xE45E 0x81BA  #CJK UNIFIED IDEOGRAPH
+0xE45F 0x81C9  #CJK UNIFIED IDEOGRAPH
+0xE460 0x81CD  #CJK UNIFIED IDEOGRAPH
+0xE461 0x81D1  #CJK UNIFIED IDEOGRAPH
+0xE462 0x81D9  #CJK UNIFIED IDEOGRAPH
+0xE463 0x81D8  #CJK UNIFIED IDEOGRAPH
+0xE464 0x81C8  #CJK UNIFIED IDEOGRAPH
+0xE465 0x81DA  #CJK UNIFIED IDEOGRAPH
+0xE466 0x81DF  #CJK UNIFIED IDEOGRAPH
+0xE467 0x81E0  #CJK UNIFIED IDEOGRAPH
+0xE468 0x81E7  #CJK UNIFIED IDEOGRAPH
+0xE469 0x81FA  #CJK UNIFIED IDEOGRAPH
+0xE46A 0x81FB  #CJK UNIFIED IDEOGRAPH
+0xE46B 0x81FE  #CJK UNIFIED IDEOGRAPH
+0xE46C 0x8201  #CJK UNIFIED IDEOGRAPH
+0xE46D 0x8202  #CJK UNIFIED IDEOGRAPH
+0xE46E 0x8205  #CJK UNIFIED IDEOGRAPH
+0xE46F 0x8207  #CJK UNIFIED IDEOGRAPH
+0xE470 0x820A  #CJK UNIFIED IDEOGRAPH
+0xE471 0x820D  #CJK UNIFIED IDEOGRAPH
+0xE472 0x8210  #CJK UNIFIED IDEOGRAPH
+0xE473 0x8216  #CJK UNIFIED IDEOGRAPH
+0xE474 0x8229  #CJK UNIFIED IDEOGRAPH
+0xE475 0x822B  #CJK UNIFIED IDEOGRAPH
+0xE476 0x8238  #CJK UNIFIED IDEOGRAPH
+0xE477 0x8233  #CJK UNIFIED IDEOGRAPH
+0xE478 0x8240  #CJK UNIFIED IDEOGRAPH
+0xE479 0x8259  #CJK UNIFIED IDEOGRAPH
+0xE47A 0x8258  #CJK UNIFIED IDEOGRAPH
+0xE47B 0x825D  #CJK UNIFIED IDEOGRAPH
+0xE47C 0x825A  #CJK UNIFIED IDEOGRAPH
+0xE47D 0x825F  #CJK UNIFIED IDEOGRAPH
+0xE47E 0x8264  #CJK UNIFIED IDEOGRAPH
+0xE480 0x8262  #CJK UNIFIED IDEOGRAPH
+0xE481 0x8268  #CJK UNIFIED IDEOGRAPH
+0xE482 0x826A  #CJK UNIFIED IDEOGRAPH
+0xE483 0x826B  #CJK UNIFIED IDEOGRAPH
+0xE484 0x822E  #CJK UNIFIED IDEOGRAPH
+0xE485 0x8271  #CJK UNIFIED IDEOGRAPH
+0xE486 0x8277  #CJK UNIFIED IDEOGRAPH
+0xE487 0x8278  #CJK UNIFIED IDEOGRAPH
+0xE488 0x827E  #CJK UNIFIED IDEOGRAPH
+0xE489 0x828D  #CJK UNIFIED IDEOGRAPH
+0xE48A 0x8292  #CJK UNIFIED IDEOGRAPH
+0xE48B 0x82AB  #CJK UNIFIED IDEOGRAPH
+0xE48C 0x829F  #CJK UNIFIED IDEOGRAPH
+0xE48D 0x82BB  #CJK UNIFIED IDEOGRAPH
+0xE48E 0x82AC  #CJK UNIFIED IDEOGRAPH
+0xE48F 0x82E1  #CJK UNIFIED IDEOGRAPH
+0xE490 0x82E3  #CJK UNIFIED IDEOGRAPH
+0xE491 0x82DF  #CJK UNIFIED IDEOGRAPH
+0xE492 0x82D2  #CJK UNIFIED IDEOGRAPH
+0xE493 0x82F4  #CJK UNIFIED IDEOGRAPH
+0xE494 0x82F3  #CJK UNIFIED IDEOGRAPH
+0xE495 0x82FA  #CJK UNIFIED IDEOGRAPH
+0xE496 0x8393  #CJK UNIFIED IDEOGRAPH
+0xE497 0x8303  #CJK UNIFIED IDEOGRAPH
+0xE498 0x82FB  #CJK UNIFIED IDEOGRAPH
+0xE499 0x82F9  #CJK UNIFIED IDEOGRAPH
+0xE49A 0x82DE  #CJK UNIFIED IDEOGRAPH
+0xE49B 0x8306  #CJK UNIFIED IDEOGRAPH
+0xE49C 0x82DC  #CJK UNIFIED IDEOGRAPH
+0xE49D 0x8309  #CJK UNIFIED IDEOGRAPH
+0xE49E 0x82D9  #CJK UNIFIED IDEOGRAPH
+0xE49F 0x8335  #CJK UNIFIED IDEOGRAPH
+0xE4A0 0x8334  #CJK UNIFIED IDEOGRAPH
+0xE4A1 0x8316  #CJK UNIFIED IDEOGRAPH
+0xE4A2 0x8332  #CJK UNIFIED IDEOGRAPH
+0xE4A3 0x8331  #CJK UNIFIED IDEOGRAPH
+0xE4A4 0x8340  #CJK UNIFIED IDEOGRAPH
+0xE4A5 0x8339  #CJK UNIFIED IDEOGRAPH
+0xE4A6 0x8350  #CJK UNIFIED IDEOGRAPH
+0xE4A7 0x8345  #CJK UNIFIED IDEOGRAPH
+0xE4A8 0x832F  #CJK UNIFIED IDEOGRAPH
+0xE4A9 0x832B  #CJK UNIFIED IDEOGRAPH
+0xE4AA 0x8317  #CJK UNIFIED IDEOGRAPH
+0xE4AB 0x8318  #CJK UNIFIED IDEOGRAPH
+0xE4AC 0x8385  #CJK UNIFIED IDEOGRAPH
+0xE4AD 0x839A  #CJK UNIFIED IDEOGRAPH
+0xE4AE 0x83AA  #CJK UNIFIED IDEOGRAPH
+0xE4AF 0x839F  #CJK UNIFIED IDEOGRAPH
+0xE4B0 0x83A2  #CJK UNIFIED IDEOGRAPH
+0xE4B1 0x8396  #CJK UNIFIED IDEOGRAPH
+0xE4B2 0x8323  #CJK UNIFIED IDEOGRAPH
+0xE4B3 0x838E  #CJK UNIFIED IDEOGRAPH
+0xE4B4 0x8387  #CJK UNIFIED IDEOGRAPH
+0xE4B5 0x838A  #CJK UNIFIED IDEOGRAPH
+0xE4B6 0x837C  #CJK UNIFIED IDEOGRAPH
+0xE4B7 0x83B5  #CJK UNIFIED IDEOGRAPH
+0xE4B8 0x8373  #CJK UNIFIED IDEOGRAPH
+0xE4B9 0x8375  #CJK UNIFIED IDEOGRAPH
+0xE4BA 0x83A0  #CJK UNIFIED IDEOGRAPH
+0xE4BB 0x8389  #CJK UNIFIED IDEOGRAPH
+0xE4BC 0x83A8  #CJK UNIFIED IDEOGRAPH
+0xE4BD 0x83F4  #CJK UNIFIED IDEOGRAPH
+0xE4BE 0x8413  #CJK UNIFIED IDEOGRAPH
+0xE4BF 0x83EB  #CJK UNIFIED IDEOGRAPH
+0xE4C0 0x83CE  #CJK UNIFIED IDEOGRAPH
+0xE4C1 0x83FD  #CJK UNIFIED IDEOGRAPH
+0xE4C2 0x8403  #CJK UNIFIED IDEOGRAPH
+0xE4C3 0x83D8  #CJK UNIFIED IDEOGRAPH
+0xE4C4 0x840B  #CJK UNIFIED IDEOGRAPH
+0xE4C5 0x83C1  #CJK UNIFIED IDEOGRAPH
+0xE4C6 0x83F7  #CJK UNIFIED IDEOGRAPH
+0xE4C7 0x8407  #CJK UNIFIED IDEOGRAPH
+0xE4C8 0x83E0  #CJK UNIFIED IDEOGRAPH
+0xE4C9 0x83F2  #CJK UNIFIED IDEOGRAPH
+0xE4CA 0x840D  #CJK UNIFIED IDEOGRAPH
+0xE4CB 0x8422  #CJK UNIFIED IDEOGRAPH
+0xE4CC 0x8420  #CJK UNIFIED IDEOGRAPH
+0xE4CD 0x83BD  #CJK UNIFIED IDEOGRAPH
+0xE4CE 0x8438  #CJK UNIFIED IDEOGRAPH
+0xE4CF 0x8506  #CJK UNIFIED IDEOGRAPH
+0xE4D0 0x83FB  #CJK UNIFIED IDEOGRAPH
+0xE4D1 0x846D  #CJK UNIFIED IDEOGRAPH
+0xE4D2 0x842A  #CJK UNIFIED IDEOGRAPH
+0xE4D3 0x843C  #CJK UNIFIED IDEOGRAPH
+0xE4D4 0x855A  #CJK UNIFIED IDEOGRAPH
+0xE4D5 0x8484  #CJK UNIFIED IDEOGRAPH
+0xE4D6 0x8477  #CJK UNIFIED IDEOGRAPH
+0xE4D7 0x846B  #CJK UNIFIED IDEOGRAPH
+0xE4D8 0x84AD  #CJK UNIFIED IDEOGRAPH
+0xE4D9 0x846E  #CJK UNIFIED IDEOGRAPH
+0xE4DA 0x8482  #CJK UNIFIED IDEOGRAPH
+0xE4DB 0x8469  #CJK UNIFIED IDEOGRAPH
+0xE4DC 0x8446  #CJK UNIFIED IDEOGRAPH
+0xE4DD 0x842C  #CJK UNIFIED IDEOGRAPH
+0xE4DE 0x846F  #CJK UNIFIED IDEOGRAPH
+0xE4DF 0x8479  #CJK UNIFIED IDEOGRAPH
+0xE4E0 0x8435  #CJK UNIFIED IDEOGRAPH
+0xE4E1 0x84CA  #CJK UNIFIED IDEOGRAPH
+0xE4E2 0x8462  #CJK UNIFIED IDEOGRAPH
+0xE4E3 0x84B9  #CJK UNIFIED IDEOGRAPH
+0xE4E4 0x84BF  #CJK UNIFIED IDEOGRAPH
+0xE4E5 0x849F  #CJK UNIFIED IDEOGRAPH
+0xE4E6 0x84D9  #CJK UNIFIED IDEOGRAPH
+0xE4E7 0x84CD  #CJK UNIFIED IDEOGRAPH
+0xE4E8 0x84BB  #CJK UNIFIED IDEOGRAPH
+0xE4E9 0x84DA  #CJK UNIFIED IDEOGRAPH
+0xE4EA 0x84D0  #CJK UNIFIED IDEOGRAPH
+0xE4EB 0x84C1  #CJK UNIFIED IDEOGRAPH
+0xE4EC 0x84C6  #CJK UNIFIED IDEOGRAPH
+0xE4ED 0x84D6  #CJK UNIFIED IDEOGRAPH
+0xE4EE 0x84A1  #CJK UNIFIED IDEOGRAPH
+0xE4EF 0x8521  #CJK UNIFIED IDEOGRAPH
+0xE4F0 0x84FF  #CJK UNIFIED IDEOGRAPH
+0xE4F1 0x84F4  #CJK UNIFIED IDEOGRAPH
+0xE4F2 0x8517  #CJK UNIFIED IDEOGRAPH
+0xE4F3 0x8518  #CJK UNIFIED IDEOGRAPH
+0xE4F4 0x852C  #CJK UNIFIED IDEOGRAPH
+0xE4F5 0x851F  #CJK UNIFIED IDEOGRAPH
+0xE4F6 0x8515  #CJK UNIFIED IDEOGRAPH
+0xE4F7 0x8514  #CJK UNIFIED IDEOGRAPH
+0xE4F8 0x84FC  #CJK UNIFIED IDEOGRAPH
+0xE4F9 0x8540  #CJK UNIFIED IDEOGRAPH
+0xE4FA 0x8563  #CJK UNIFIED IDEOGRAPH
+0xE4FB 0x8558  #CJK UNIFIED IDEOGRAPH
+0xE4FC 0x8548  #CJK UNIFIED IDEOGRAPH
+0xE540 0x8541  #CJK UNIFIED IDEOGRAPH
+0xE541 0x8602  #CJK UNIFIED IDEOGRAPH
+0xE542 0x854B  #CJK UNIFIED IDEOGRAPH
+0xE543 0x8555  #CJK UNIFIED IDEOGRAPH
+0xE544 0x8580  #CJK UNIFIED IDEOGRAPH
+0xE545 0x85A4  #CJK UNIFIED IDEOGRAPH
+0xE546 0x8588  #CJK UNIFIED IDEOGRAPH
+0xE547 0x8591  #CJK UNIFIED IDEOGRAPH
+0xE548 0x858A  #CJK UNIFIED IDEOGRAPH
+0xE549 0x85A8  #CJK UNIFIED IDEOGRAPH
+0xE54A 0x856D  #CJK UNIFIED IDEOGRAPH
+0xE54B 0x8594  #CJK UNIFIED IDEOGRAPH
+0xE54C 0x859B  #CJK UNIFIED IDEOGRAPH
+0xE54D 0x85EA  #CJK UNIFIED IDEOGRAPH
+0xE54E 0x8587  #CJK UNIFIED IDEOGRAPH
+0xE54F 0x859C  #CJK UNIFIED IDEOGRAPH
+0xE550 0x8577  #CJK UNIFIED IDEOGRAPH
+0xE551 0x857E  #CJK UNIFIED IDEOGRAPH
+0xE552 0x8590  #CJK UNIFIED IDEOGRAPH
+0xE553 0x85C9  #CJK UNIFIED IDEOGRAPH
+0xE554 0x85BA  #CJK UNIFIED IDEOGRAPH
+0xE555 0x85CF  #CJK UNIFIED IDEOGRAPH
+0xE556 0x85B9  #CJK UNIFIED IDEOGRAPH
+0xE557 0x85D0  #CJK UNIFIED IDEOGRAPH
+0xE558 0x85D5  #CJK UNIFIED IDEOGRAPH
+0xE559 0x85DD  #CJK UNIFIED IDEOGRAPH
+0xE55A 0x85E5  #CJK UNIFIED IDEOGRAPH
+0xE55B 0x85DC  #CJK UNIFIED IDEOGRAPH
+0xE55C 0x85F9  #CJK UNIFIED IDEOGRAPH
+0xE55D 0x860A  #CJK UNIFIED IDEOGRAPH
+0xE55E 0x8613  #CJK UNIFIED IDEOGRAPH
+0xE55F 0x860B  #CJK UNIFIED IDEOGRAPH
+0xE560 0x85FE  #CJK UNIFIED IDEOGRAPH
+0xE561 0x85FA  #CJK UNIFIED IDEOGRAPH
+0xE562 0x8606  #CJK UNIFIED IDEOGRAPH
+0xE563 0x8622  #CJK UNIFIED IDEOGRAPH
+0xE564 0x861A  #CJK UNIFIED IDEOGRAPH
+0xE565 0x8630  #CJK UNIFIED IDEOGRAPH
+0xE566 0x863F  #CJK UNIFIED IDEOGRAPH
+0xE567 0x864D  #CJK UNIFIED IDEOGRAPH
+0xE568 0x4E55  #CJK UNIFIED IDEOGRAPH
+0xE569 0x8654  #CJK UNIFIED IDEOGRAPH
+0xE56A 0x865F  #CJK UNIFIED IDEOGRAPH
+0xE56B 0x8667  #CJK UNIFIED IDEOGRAPH
+0xE56C 0x8671  #CJK UNIFIED IDEOGRAPH
+0xE56D 0x8693  #CJK UNIFIED IDEOGRAPH
+0xE56E 0x86A3  #CJK UNIFIED IDEOGRAPH
+0xE56F 0x86A9  #CJK UNIFIED IDEOGRAPH
+0xE570 0x86AA  #CJK UNIFIED IDEOGRAPH
+0xE571 0x868B  #CJK UNIFIED IDEOGRAPH
+0xE572 0x868C  #CJK UNIFIED IDEOGRAPH
+0xE573 0x86B6  #CJK UNIFIED IDEOGRAPH
+0xE574 0x86AF  #CJK UNIFIED IDEOGRAPH
+0xE575 0x86C4  #CJK UNIFIED IDEOGRAPH
+0xE576 0x86C6  #CJK UNIFIED IDEOGRAPH
+0xE577 0x86B0  #CJK UNIFIED IDEOGRAPH
+0xE578 0x86C9  #CJK UNIFIED IDEOGRAPH
+0xE579 0x8823  #CJK UNIFIED IDEOGRAPH
+0xE57A 0x86AB  #CJK UNIFIED IDEOGRAPH
+0xE57B 0x86D4  #CJK UNIFIED IDEOGRAPH
+0xE57C 0x86DE  #CJK UNIFIED IDEOGRAPH
+0xE57D 0x86E9  #CJK UNIFIED IDEOGRAPH
+0xE57E 0x86EC  #CJK UNIFIED IDEOGRAPH
+0xE580 0x86DF  #CJK UNIFIED IDEOGRAPH
+0xE581 0x86DB  #CJK UNIFIED IDEOGRAPH
+0xE582 0x86EF  #CJK UNIFIED IDEOGRAPH
+0xE583 0x8712  #CJK UNIFIED IDEOGRAPH
+0xE584 0x8706  #CJK UNIFIED IDEOGRAPH
+0xE585 0x8708  #CJK UNIFIED IDEOGRAPH
+0xE586 0x8700  #CJK UNIFIED IDEOGRAPH
+0xE587 0x8703  #CJK UNIFIED IDEOGRAPH
+0xE588 0x86FB  #CJK UNIFIED IDEOGRAPH
+0xE589 0x8711  #CJK UNIFIED IDEOGRAPH
+0xE58A 0x8709  #CJK UNIFIED IDEOGRAPH
+0xE58B 0x870D  #CJK UNIFIED IDEOGRAPH
+0xE58C 0x86F9  #CJK UNIFIED IDEOGRAPH
+0xE58D 0x870A  #CJK UNIFIED IDEOGRAPH
+0xE58E 0x8734  #CJK UNIFIED IDEOGRAPH
+0xE58F 0x873F  #CJK UNIFIED IDEOGRAPH
+0xE590 0x8737  #CJK UNIFIED IDEOGRAPH
+0xE591 0x873B  #CJK UNIFIED IDEOGRAPH
+0xE592 0x8725  #CJK UNIFIED IDEOGRAPH
+0xE593 0x8729  #CJK UNIFIED IDEOGRAPH
+0xE594 0x871A  #CJK UNIFIED IDEOGRAPH
+0xE595 0x8760  #CJK UNIFIED IDEOGRAPH
+0xE596 0x875F  #CJK UNIFIED IDEOGRAPH
+0xE597 0x8778  #CJK UNIFIED IDEOGRAPH
+0xE598 0x874C  #CJK UNIFIED IDEOGRAPH
+0xE599 0x874E  #CJK UNIFIED IDEOGRAPH
+0xE59A 0x8774  #CJK UNIFIED IDEOGRAPH
+0xE59B 0x8757  #CJK UNIFIED IDEOGRAPH
+0xE59C 0x8768  #CJK UNIFIED IDEOGRAPH
+0xE59D 0x876E  #CJK UNIFIED IDEOGRAPH
+0xE59E 0x8759  #CJK UNIFIED IDEOGRAPH
+0xE59F 0x8753  #CJK UNIFIED IDEOGRAPH
+0xE5A0 0x8763  #CJK UNIFIED IDEOGRAPH
+0xE5A1 0x876A  #CJK UNIFIED IDEOGRAPH
+0xE5A2 0x8805  #CJK UNIFIED IDEOGRAPH
+0xE5A3 0x87A2  #CJK UNIFIED IDEOGRAPH
+0xE5A4 0x879F  #CJK UNIFIED IDEOGRAPH
+0xE5A5 0x8782  #CJK UNIFIED IDEOGRAPH
+0xE5A6 0x87AF  #CJK UNIFIED IDEOGRAPH
+0xE5A7 0x87CB  #CJK UNIFIED IDEOGRAPH
+0xE5A8 0x87BD  #CJK UNIFIED IDEOGRAPH
+0xE5A9 0x87C0  #CJK UNIFIED IDEOGRAPH
+0xE5AA 0x87D0  #CJK UNIFIED IDEOGRAPH
+0xE5AB 0x96D6  #CJK UNIFIED IDEOGRAPH
+0xE5AC 0x87AB  #CJK UNIFIED IDEOGRAPH
+0xE5AD 0x87C4  #CJK UNIFIED IDEOGRAPH
+0xE5AE 0x87B3  #CJK UNIFIED IDEOGRAPH
+0xE5AF 0x87C7  #CJK UNIFIED IDEOGRAPH
+0xE5B0 0x87C6  #CJK UNIFIED IDEOGRAPH
+0xE5B1 0x87BB  #CJK UNIFIED IDEOGRAPH
+0xE5B2 0x87EF  #CJK UNIFIED IDEOGRAPH
+0xE5B3 0x87F2  #CJK UNIFIED IDEOGRAPH
+0xE5B4 0x87E0  #CJK UNIFIED IDEOGRAPH
+0xE5B5 0x880F  #CJK UNIFIED IDEOGRAPH
+0xE5B6 0x880D  #CJK UNIFIED IDEOGRAPH
+0xE5B7 0x87FE  #CJK UNIFIED IDEOGRAPH
+0xE5B8 0x87F6  #CJK UNIFIED IDEOGRAPH
+0xE5B9 0x87F7  #CJK UNIFIED IDEOGRAPH
+0xE5BA 0x880E  #CJK UNIFIED IDEOGRAPH
+0xE5BB 0x87D2  #CJK UNIFIED IDEOGRAPH
+0xE5BC 0x8811  #CJK UNIFIED IDEOGRAPH
+0xE5BD 0x8816  #CJK UNIFIED IDEOGRAPH
+0xE5BE 0x8815  #CJK UNIFIED IDEOGRAPH
+0xE5BF 0x8822  #CJK UNIFIED IDEOGRAPH
+0xE5C0 0x8821  #CJK UNIFIED IDEOGRAPH
+0xE5C1 0x8831  #CJK UNIFIED IDEOGRAPH
+0xE5C2 0x8836  #CJK UNIFIED IDEOGRAPH
+0xE5C3 0x8839  #CJK UNIFIED IDEOGRAPH
+0xE5C4 0x8827  #CJK UNIFIED IDEOGRAPH
+0xE5C5 0x883B  #CJK UNIFIED IDEOGRAPH
+0xE5C6 0x8844  #CJK UNIFIED IDEOGRAPH
+0xE5C7 0x8842  #CJK UNIFIED IDEOGRAPH
+0xE5C8 0x8852  #CJK UNIFIED IDEOGRAPH
+0xE5C9 0x8859  #CJK UNIFIED IDEOGRAPH
+0xE5CA 0x885E  #CJK UNIFIED IDEOGRAPH
+0xE5CB 0x8862  #CJK UNIFIED IDEOGRAPH
+0xE5CC 0x886B  #CJK UNIFIED IDEOGRAPH
+0xE5CD 0x8881  #CJK UNIFIED IDEOGRAPH
+0xE5CE 0x887E  #CJK UNIFIED IDEOGRAPH
+0xE5CF 0x889E  #CJK UNIFIED IDEOGRAPH
+0xE5D0 0x8875  #CJK UNIFIED IDEOGRAPH
+0xE5D1 0x887D  #CJK UNIFIED IDEOGRAPH
+0xE5D2 0x88B5  #CJK UNIFIED IDEOGRAPH
+0xE5D3 0x8872  #CJK UNIFIED IDEOGRAPH
+0xE5D4 0x8882  #CJK UNIFIED IDEOGRAPH
+0xE5D5 0x8897  #CJK UNIFIED IDEOGRAPH
+0xE5D6 0x8892  #CJK UNIFIED IDEOGRAPH
+0xE5D7 0x88AE  #CJK UNIFIED IDEOGRAPH
+0xE5D8 0x8899  #CJK UNIFIED IDEOGRAPH
+0xE5D9 0x88A2  #CJK UNIFIED IDEOGRAPH
+0xE5DA 0x888D  #CJK UNIFIED IDEOGRAPH
+0xE5DB 0x88A4  #CJK UNIFIED IDEOGRAPH
+0xE5DC 0x88B0  #CJK UNIFIED IDEOGRAPH
+0xE5DD 0x88BF  #CJK UNIFIED IDEOGRAPH
+0xE5DE 0x88B1  #CJK UNIFIED IDEOGRAPH
+0xE5DF 0x88C3  #CJK UNIFIED IDEOGRAPH
+0xE5E0 0x88C4  #CJK UNIFIED IDEOGRAPH
+0xE5E1 0x88D4  #CJK UNIFIED IDEOGRAPH
+0xE5E2 0x88D8  #CJK UNIFIED IDEOGRAPH
+0xE5E3 0x88D9  #CJK UNIFIED IDEOGRAPH
+0xE5E4 0x88DD  #CJK UNIFIED IDEOGRAPH
+0xE5E5 0x88F9  #CJK UNIFIED IDEOGRAPH
+0xE5E6 0x8902  #CJK UNIFIED IDEOGRAPH
+0xE5E7 0x88FC  #CJK UNIFIED IDEOGRAPH
+0xE5E8 0x88F4  #CJK UNIFIED IDEOGRAPH
+0xE5E9 0x88E8  #CJK UNIFIED IDEOGRAPH
+0xE5EA 0x88F2  #CJK UNIFIED IDEOGRAPH
+0xE5EB 0x8904  #CJK UNIFIED IDEOGRAPH
+0xE5EC 0x890C  #CJK UNIFIED IDEOGRAPH
+0xE5ED 0x890A  #CJK UNIFIED IDEOGRAPH
+0xE5EE 0x8913  #CJK UNIFIED IDEOGRAPH
+0xE5EF 0x8943  #CJK UNIFIED IDEOGRAPH
+0xE5F0 0x891E  #CJK UNIFIED IDEOGRAPH
+0xE5F1 0x8925  #CJK UNIFIED IDEOGRAPH
+0xE5F2 0x892A  #CJK UNIFIED IDEOGRAPH
+0xE5F3 0x892B  #CJK UNIFIED IDEOGRAPH
+0xE5F4 0x8941  #CJK UNIFIED IDEOGRAPH
+0xE5F5 0x8944  #CJK UNIFIED IDEOGRAPH
+0xE5F6 0x893B  #CJK UNIFIED IDEOGRAPH
+0xE5F7 0x8936  #CJK UNIFIED IDEOGRAPH
+0xE5F8 0x8938  #CJK UNIFIED IDEOGRAPH
+0xE5F9 0x894C  #CJK UNIFIED IDEOGRAPH
+0xE5FA 0x891D  #CJK UNIFIED IDEOGRAPH
+0xE5FB 0x8960  #CJK UNIFIED IDEOGRAPH
+0xE5FC 0x895E  #CJK UNIFIED IDEOGRAPH
+0xE640 0x8966  #CJK UNIFIED IDEOGRAPH
+0xE641 0x8964  #CJK UNIFIED IDEOGRAPH
+0xE642 0x896D  #CJK UNIFIED IDEOGRAPH
+0xE643 0x896A  #CJK UNIFIED IDEOGRAPH
+0xE644 0x896F  #CJK UNIFIED IDEOGRAPH
+0xE645 0x8974  #CJK UNIFIED IDEOGRAPH
+0xE646 0x8977  #CJK UNIFIED IDEOGRAPH
+0xE647 0x897E  #CJK UNIFIED IDEOGRAPH
+0xE648 0x8983  #CJK UNIFIED IDEOGRAPH
+0xE649 0x8988  #CJK UNIFIED IDEOGRAPH
+0xE64A 0x898A  #CJK UNIFIED IDEOGRAPH
+0xE64B 0x8993  #CJK UNIFIED IDEOGRAPH
+0xE64C 0x8998  #CJK UNIFIED IDEOGRAPH
+0xE64D 0x89A1  #CJK UNIFIED IDEOGRAPH
+0xE64E 0x89A9  #CJK UNIFIED IDEOGRAPH
+0xE64F 0x89A6  #CJK UNIFIED IDEOGRAPH
+0xE650 0x89AC  #CJK UNIFIED IDEOGRAPH
+0xE651 0x89AF  #CJK UNIFIED IDEOGRAPH
+0xE652 0x89B2  #CJK UNIFIED IDEOGRAPH
+0xE653 0x89BA  #CJK UNIFIED IDEOGRAPH
+0xE654 0x89BD  #CJK UNIFIED IDEOGRAPH
+0xE655 0x89BF  #CJK UNIFIED IDEOGRAPH
+0xE656 0x89C0  #CJK UNIFIED IDEOGRAPH
+0xE657 0x89DA  #CJK UNIFIED IDEOGRAPH
+0xE658 0x89DC  #CJK UNIFIED IDEOGRAPH
+0xE659 0x89DD  #CJK UNIFIED IDEOGRAPH
+0xE65A 0x89E7  #CJK UNIFIED IDEOGRAPH
+0xE65B 0x89F4  #CJK UNIFIED IDEOGRAPH
+0xE65C 0x89F8  #CJK UNIFIED IDEOGRAPH
+0xE65D 0x8A03  #CJK UNIFIED IDEOGRAPH
+0xE65E 0x8A16  #CJK UNIFIED IDEOGRAPH
+0xE65F 0x8A10  #CJK UNIFIED IDEOGRAPH
+0xE660 0x8A0C  #CJK UNIFIED IDEOGRAPH
+0xE661 0x8A1B  #CJK UNIFIED IDEOGRAPH
+0xE662 0x8A1D  #CJK UNIFIED IDEOGRAPH
+0xE663 0x8A25  #CJK UNIFIED IDEOGRAPH
+0xE664 0x8A36  #CJK UNIFIED IDEOGRAPH
+0xE665 0x8A41  #CJK UNIFIED IDEOGRAPH
+0xE666 0x8A5B  #CJK UNIFIED IDEOGRAPH
+0xE667 0x8A52  #CJK UNIFIED IDEOGRAPH
+0xE668 0x8A46  #CJK UNIFIED IDEOGRAPH
+0xE669 0x8A48  #CJK UNIFIED IDEOGRAPH
+0xE66A 0x8A7C  #CJK UNIFIED IDEOGRAPH
+0xE66B 0x8A6D  #CJK UNIFIED IDEOGRAPH
+0xE66C 0x8A6C  #CJK UNIFIED IDEOGRAPH
+0xE66D 0x8A62  #CJK UNIFIED IDEOGRAPH
+0xE66E 0x8A85  #CJK UNIFIED IDEOGRAPH
+0xE66F 0x8A82  #CJK UNIFIED IDEOGRAPH
+0xE670 0x8A84  #CJK UNIFIED IDEOGRAPH
+0xE671 0x8AA8  #CJK UNIFIED IDEOGRAPH
+0xE672 0x8AA1  #CJK UNIFIED IDEOGRAPH
+0xE673 0x8A91  #CJK UNIFIED IDEOGRAPH
+0xE674 0x8AA5  #CJK UNIFIED IDEOGRAPH
+0xE675 0x8AA6  #CJK UNIFIED IDEOGRAPH
+0xE676 0x8A9A  #CJK UNIFIED IDEOGRAPH
+0xE677 0x8AA3  #CJK UNIFIED IDEOGRAPH
+0xE678 0x8AC4  #CJK UNIFIED IDEOGRAPH
+0xE679 0x8ACD  #CJK UNIFIED IDEOGRAPH
+0xE67A 0x8AC2  #CJK UNIFIED IDEOGRAPH
+0xE67B 0x8ADA  #CJK UNIFIED IDEOGRAPH
+0xE67C 0x8AEB  #CJK UNIFIED IDEOGRAPH
+0xE67D 0x8AF3  #CJK UNIFIED IDEOGRAPH
+0xE67E 0x8AE7  #CJK UNIFIED IDEOGRAPH
+0xE680 0x8AE4  #CJK UNIFIED IDEOGRAPH
+0xE681 0x8AF1  #CJK UNIFIED IDEOGRAPH
+0xE682 0x8B14  #CJK UNIFIED IDEOGRAPH
+0xE683 0x8AE0  #CJK UNIFIED IDEOGRAPH
+0xE684 0x8AE2  #CJK UNIFIED IDEOGRAPH
+0xE685 0x8AF7  #CJK UNIFIED IDEOGRAPH
+0xE686 0x8ADE  #CJK UNIFIED IDEOGRAPH
+0xE687 0x8ADB  #CJK UNIFIED IDEOGRAPH
+0xE688 0x8B0C  #CJK UNIFIED IDEOGRAPH
+0xE689 0x8B07  #CJK UNIFIED IDEOGRAPH
+0xE68A 0x8B1A  #CJK UNIFIED IDEOGRAPH
+0xE68B 0x8AE1  #CJK UNIFIED IDEOGRAPH
+0xE68C 0x8B16  #CJK UNIFIED IDEOGRAPH
+0xE68D 0x8B10  #CJK UNIFIED IDEOGRAPH
+0xE68E 0x8B17  #CJK UNIFIED IDEOGRAPH
+0xE68F 0x8B20  #CJK UNIFIED IDEOGRAPH
+0xE690 0x8B33  #CJK UNIFIED IDEOGRAPH
+0xE691 0x97AB  #CJK UNIFIED IDEOGRAPH
+0xE692 0x8B26  #CJK UNIFIED IDEOGRAPH
+0xE693 0x8B2B  #CJK UNIFIED IDEOGRAPH
+0xE694 0x8B3E  #CJK UNIFIED IDEOGRAPH
+0xE695 0x8B28  #CJK UNIFIED IDEOGRAPH
+0xE696 0x8B41  #CJK UNIFIED IDEOGRAPH
+0xE697 0x8B4C  #CJK UNIFIED IDEOGRAPH
+0xE698 0x8B4F  #CJK UNIFIED IDEOGRAPH
+0xE699 0x8B4E  #CJK UNIFIED IDEOGRAPH
+0xE69A 0x8B49  #CJK UNIFIED IDEOGRAPH
+0xE69B 0x8B56  #CJK UNIFIED IDEOGRAPH
+0xE69C 0x8B5B  #CJK UNIFIED IDEOGRAPH
+0xE69D 0x8B5A  #CJK UNIFIED IDEOGRAPH
+0xE69E 0x8B6B  #CJK UNIFIED IDEOGRAPH
+0xE69F 0x8B5F  #CJK UNIFIED IDEOGRAPH
+0xE6A0 0x8B6C  #CJK UNIFIED IDEOGRAPH
+0xE6A1 0x8B6F  #CJK UNIFIED IDEOGRAPH
+0xE6A2 0x8B74  #CJK UNIFIED IDEOGRAPH
+0xE6A3 0x8B7D  #CJK UNIFIED IDEOGRAPH
+0xE6A4 0x8B80  #CJK UNIFIED IDEOGRAPH
+0xE6A5 0x8B8C  #CJK UNIFIED IDEOGRAPH
+0xE6A6 0x8B8E  #CJK UNIFIED IDEOGRAPH
+0xE6A7 0x8B92  #CJK UNIFIED IDEOGRAPH
+0xE6A8 0x8B93  #CJK UNIFIED IDEOGRAPH
+0xE6A9 0x8B96  #CJK UNIFIED IDEOGRAPH
+0xE6AA 0x8B99  #CJK UNIFIED IDEOGRAPH
+0xE6AB 0x8B9A  #CJK UNIFIED IDEOGRAPH
+0xE6AC 0x8C3A  #CJK UNIFIED IDEOGRAPH
+0xE6AD 0x8C41  #CJK UNIFIED IDEOGRAPH
+0xE6AE 0x8C3F  #CJK UNIFIED IDEOGRAPH
+0xE6AF 0x8C48  #CJK UNIFIED IDEOGRAPH
+0xE6B0 0x8C4C  #CJK UNIFIED IDEOGRAPH
+0xE6B1 0x8C4E  #CJK UNIFIED IDEOGRAPH
+0xE6B2 0x8C50  #CJK UNIFIED IDEOGRAPH
+0xE6B3 0x8C55  #CJK UNIFIED IDEOGRAPH
+0xE6B4 0x8C62  #CJK UNIFIED IDEOGRAPH
+0xE6B5 0x8C6C  #CJK UNIFIED IDEOGRAPH
+0xE6B6 0x8C78  #CJK UNIFIED IDEOGRAPH
+0xE6B7 0x8C7A  #CJK UNIFIED IDEOGRAPH
+0xE6B8 0x8C82  #CJK UNIFIED IDEOGRAPH
+0xE6B9 0x8C89  #CJK UNIFIED IDEOGRAPH
+0xE6BA 0x8C85  #CJK UNIFIED IDEOGRAPH
+0xE6BB 0x8C8A  #CJK UNIFIED IDEOGRAPH
+0xE6BC 0x8C8D  #CJK UNIFIED IDEOGRAPH
+0xE6BD 0x8C8E  #CJK UNIFIED IDEOGRAPH
+0xE6BE 0x8C94  #CJK UNIFIED IDEOGRAPH
+0xE6BF 0x8C7C  #CJK UNIFIED IDEOGRAPH
+0xE6C0 0x8C98  #CJK UNIFIED IDEOGRAPH
+0xE6C1 0x621D  #CJK UNIFIED IDEOGRAPH
+0xE6C2 0x8CAD  #CJK UNIFIED IDEOGRAPH
+0xE6C3 0x8CAA  #CJK UNIFIED IDEOGRAPH
+0xE6C4 0x8CBD  #CJK UNIFIED IDEOGRAPH
+0xE6C5 0x8CB2  #CJK UNIFIED IDEOGRAPH
+0xE6C6 0x8CB3  #CJK UNIFIED IDEOGRAPH
+0xE6C7 0x8CAE  #CJK UNIFIED IDEOGRAPH
+0xE6C8 0x8CB6  #CJK UNIFIED IDEOGRAPH
+0xE6C9 0x8CC8  #CJK UNIFIED IDEOGRAPH
+0xE6CA 0x8CC1  #CJK UNIFIED IDEOGRAPH
+0xE6CB 0x8CE4  #CJK UNIFIED IDEOGRAPH
+0xE6CC 0x8CE3  #CJK UNIFIED IDEOGRAPH
+0xE6CD 0x8CDA  #CJK UNIFIED IDEOGRAPH
+0xE6CE 0x8CFD  #CJK UNIFIED IDEOGRAPH
+0xE6CF 0x8CFA  #CJK UNIFIED IDEOGRAPH
+0xE6D0 0x8CFB  #CJK UNIFIED IDEOGRAPH
+0xE6D1 0x8D04  #CJK UNIFIED IDEOGRAPH
+0xE6D2 0x8D05  #CJK UNIFIED IDEOGRAPH
+0xE6D3 0x8D0A  #CJK UNIFIED IDEOGRAPH
+0xE6D4 0x8D07  #CJK UNIFIED IDEOGRAPH
+0xE6D5 0x8D0F  #CJK UNIFIED IDEOGRAPH
+0xE6D6 0x8D0D  #CJK UNIFIED IDEOGRAPH
+0xE6D7 0x8D10  #CJK UNIFIED IDEOGRAPH
+0xE6D8 0x9F4E  #CJK UNIFIED IDEOGRAPH
+0xE6D9 0x8D13  #CJK UNIFIED IDEOGRAPH
+0xE6DA 0x8CCD  #CJK UNIFIED IDEOGRAPH
+0xE6DB 0x8D14  #CJK UNIFIED IDEOGRAPH
+0xE6DC 0x8D16  #CJK UNIFIED IDEOGRAPH
+0xE6DD 0x8D67  #CJK UNIFIED IDEOGRAPH
+0xE6DE 0x8D6D  #CJK UNIFIED IDEOGRAPH
+0xE6DF 0x8D71  #CJK UNIFIED IDEOGRAPH
+0xE6E0 0x8D73  #CJK UNIFIED IDEOGRAPH
+0xE6E1 0x8D81  #CJK UNIFIED IDEOGRAPH
+0xE6E2 0x8D99  #CJK UNIFIED IDEOGRAPH
+0xE6E3 0x8DC2  #CJK UNIFIED IDEOGRAPH
+0xE6E4 0x8DBE  #CJK UNIFIED IDEOGRAPH
+0xE6E5 0x8DBA  #CJK UNIFIED IDEOGRAPH
+0xE6E6 0x8DCF  #CJK UNIFIED IDEOGRAPH
+0xE6E7 0x8DDA  #CJK UNIFIED IDEOGRAPH
+0xE6E8 0x8DD6  #CJK UNIFIED IDEOGRAPH
+0xE6E9 0x8DCC  #CJK UNIFIED IDEOGRAPH
+0xE6EA 0x8DDB  #CJK UNIFIED IDEOGRAPH
+0xE6EB 0x8DCB  #CJK UNIFIED IDEOGRAPH
+0xE6EC 0x8DEA  #CJK UNIFIED IDEOGRAPH
+0xE6ED 0x8DEB  #CJK UNIFIED IDEOGRAPH
+0xE6EE 0x8DDF  #CJK UNIFIED IDEOGRAPH
+0xE6EF 0x8DE3  #CJK UNIFIED IDEOGRAPH
+0xE6F0 0x8DFC  #CJK UNIFIED IDEOGRAPH
+0xE6F1 0x8E08  #CJK UNIFIED IDEOGRAPH
+0xE6F2 0x8E09  #CJK UNIFIED IDEOGRAPH
+0xE6F3 0x8DFF  #CJK UNIFIED IDEOGRAPH
+0xE6F4 0x8E1D  #CJK UNIFIED IDEOGRAPH
+0xE6F5 0x8E1E  #CJK UNIFIED IDEOGRAPH
+0xE6F6 0x8E10  #CJK UNIFIED IDEOGRAPH
+0xE6F7 0x8E1F  #CJK UNIFIED IDEOGRAPH
+0xE6F8 0x8E42  #CJK UNIFIED IDEOGRAPH
+0xE6F9 0x8E35  #CJK UNIFIED IDEOGRAPH
+0xE6FA 0x8E30  #CJK UNIFIED IDEOGRAPH
+0xE6FB 0x8E34  #CJK UNIFIED IDEOGRAPH
+0xE6FC 0x8E4A  #CJK UNIFIED IDEOGRAPH
+0xE740 0x8E47  #CJK UNIFIED IDEOGRAPH
+0xE741 0x8E49  #CJK UNIFIED IDEOGRAPH
+0xE742 0x8E4C  #CJK UNIFIED IDEOGRAPH
+0xE743 0x8E50  #CJK UNIFIED IDEOGRAPH
+0xE744 0x8E48  #CJK UNIFIED IDEOGRAPH
+0xE745 0x8E59  #CJK UNIFIED IDEOGRAPH
+0xE746 0x8E64  #CJK UNIFIED IDEOGRAPH
+0xE747 0x8E60  #CJK UNIFIED IDEOGRAPH
+0xE748 0x8E2A  #CJK UNIFIED IDEOGRAPH
+0xE749 0x8E63  #CJK UNIFIED IDEOGRAPH
+0xE74A 0x8E55  #CJK UNIFIED IDEOGRAPH
+0xE74B 0x8E76  #CJK UNIFIED IDEOGRAPH
+0xE74C 0x8E72  #CJK UNIFIED IDEOGRAPH
+0xE74D 0x8E7C  #CJK UNIFIED IDEOGRAPH
+0xE74E 0x8E81  #CJK UNIFIED IDEOGRAPH
+0xE74F 0x8E87  #CJK UNIFIED IDEOGRAPH
+0xE750 0x8E85  #CJK UNIFIED IDEOGRAPH
+0xE751 0x8E84  #CJK UNIFIED IDEOGRAPH
+0xE752 0x8E8B  #CJK UNIFIED IDEOGRAPH
+0xE753 0x8E8A  #CJK UNIFIED IDEOGRAPH
+0xE754 0x8E93  #CJK UNIFIED IDEOGRAPH
+0xE755 0x8E91  #CJK UNIFIED IDEOGRAPH
+0xE756 0x8E94  #CJK UNIFIED IDEOGRAPH
+0xE757 0x8E99  #CJK UNIFIED IDEOGRAPH
+0xE758 0x8EAA  #CJK UNIFIED IDEOGRAPH
+0xE759 0x8EA1  #CJK UNIFIED IDEOGRAPH
+0xE75A 0x8EAC  #CJK UNIFIED IDEOGRAPH
+0xE75B 0x8EB0  #CJK UNIFIED IDEOGRAPH
+0xE75C 0x8EC6  #CJK UNIFIED IDEOGRAPH
+0xE75D 0x8EB1  #CJK UNIFIED IDEOGRAPH
+0xE75E 0x8EBE  #CJK UNIFIED IDEOGRAPH
+0xE75F 0x8EC5  #CJK UNIFIED IDEOGRAPH
+0xE760 0x8EC8  #CJK UNIFIED IDEOGRAPH
+0xE761 0x8ECB  #CJK UNIFIED IDEOGRAPH
+0xE762 0x8EDB  #CJK UNIFIED IDEOGRAPH
+0xE763 0x8EE3  #CJK UNIFIED IDEOGRAPH
+0xE764 0x8EFC  #CJK UNIFIED IDEOGRAPH
+0xE765 0x8EFB  #CJK UNIFIED IDEOGRAPH
+0xE766 0x8EEB  #CJK UNIFIED IDEOGRAPH
+0xE767 0x8EFE  #CJK UNIFIED IDEOGRAPH
+0xE768 0x8F0A  #CJK UNIFIED IDEOGRAPH
+0xE769 0x8F05  #CJK UNIFIED IDEOGRAPH
+0xE76A 0x8F15  #CJK UNIFIED IDEOGRAPH
+0xE76B 0x8F12  #CJK UNIFIED IDEOGRAPH
+0xE76C 0x8F19  #CJK UNIFIED IDEOGRAPH
+0xE76D 0x8F13  #CJK UNIFIED IDEOGRAPH
+0xE76E 0x8F1C  #CJK UNIFIED IDEOGRAPH
+0xE76F 0x8F1F  #CJK UNIFIED IDEOGRAPH
+0xE770 0x8F1B  #CJK UNIFIED IDEOGRAPH
+0xE771 0x8F0C  #CJK UNIFIED IDEOGRAPH
+0xE772 0x8F26  #CJK UNIFIED IDEOGRAPH
+0xE773 0x8F33  #CJK UNIFIED IDEOGRAPH
+0xE774 0x8F3B  #CJK UNIFIED IDEOGRAPH
+0xE775 0x8F39  #CJK UNIFIED IDEOGRAPH
+0xE776 0x8F45  #CJK UNIFIED IDEOGRAPH
+0xE777 0x8F42  #CJK UNIFIED IDEOGRAPH
+0xE778 0x8F3E  #CJK UNIFIED IDEOGRAPH
+0xE779 0x8F4C  #CJK UNIFIED IDEOGRAPH
+0xE77A 0x8F49  #CJK UNIFIED IDEOGRAPH
+0xE77B 0x8F46  #CJK UNIFIED IDEOGRAPH
+0xE77C 0x8F4E  #CJK UNIFIED IDEOGRAPH
+0xE77D 0x8F57  #CJK UNIFIED IDEOGRAPH
+0xE77E 0x8F5C  #CJK UNIFIED IDEOGRAPH
+0xE780 0x8F62  #CJK UNIFIED IDEOGRAPH
+0xE781 0x8F63  #CJK UNIFIED IDEOGRAPH
+0xE782 0x8F64  #CJK UNIFIED IDEOGRAPH
+0xE783 0x8F9C  #CJK UNIFIED IDEOGRAPH
+0xE784 0x8F9F  #CJK UNIFIED IDEOGRAPH
+0xE785 0x8FA3  #CJK UNIFIED IDEOGRAPH
+0xE786 0x8FAD  #CJK UNIFIED IDEOGRAPH
+0xE787 0x8FAF  #CJK UNIFIED IDEOGRAPH
+0xE788 0x8FB7  #CJK UNIFIED IDEOGRAPH
+0xE789 0x8FDA  #CJK UNIFIED IDEOGRAPH
+0xE78A 0x8FE5  #CJK UNIFIED IDEOGRAPH
+0xE78B 0x8FE2  #CJK UNIFIED IDEOGRAPH
+0xE78C 0x8FEA  #CJK UNIFIED IDEOGRAPH
+0xE78D 0x8FEF  #CJK UNIFIED IDEOGRAPH
+0xE78E 0x9087  #CJK UNIFIED IDEOGRAPH
+0xE78F 0x8FF4  #CJK UNIFIED IDEOGRAPH
+0xE790 0x9005  #CJK UNIFIED IDEOGRAPH
+0xE791 0x8FF9  #CJK UNIFIED IDEOGRAPH
+0xE792 0x8FFA  #CJK UNIFIED IDEOGRAPH
+0xE793 0x9011  #CJK UNIFIED IDEOGRAPH
+0xE794 0x9015  #CJK UNIFIED IDEOGRAPH
+0xE795 0x9021  #CJK UNIFIED IDEOGRAPH
+0xE796 0x900D  #CJK UNIFIED IDEOGRAPH
+0xE797 0x901E  #CJK UNIFIED IDEOGRAPH
+0xE798 0x9016  #CJK UNIFIED IDEOGRAPH
+0xE799 0x900B  #CJK UNIFIED IDEOGRAPH
+0xE79A 0x9027  #CJK UNIFIED IDEOGRAPH
+0xE79B 0x9036  #CJK UNIFIED IDEOGRAPH
+0xE79C 0x9035  #CJK UNIFIED IDEOGRAPH
+0xE79D 0x9039  #CJK UNIFIED IDEOGRAPH
+0xE79E 0x8FF8  #CJK UNIFIED IDEOGRAPH
+0xE79F 0x904F  #CJK UNIFIED IDEOGRAPH
+0xE7A0 0x9050  #CJK UNIFIED IDEOGRAPH
+0xE7A1 0x9051  #CJK UNIFIED IDEOGRAPH
+0xE7A2 0x9052  #CJK UNIFIED IDEOGRAPH
+0xE7A3 0x900E  #CJK UNIFIED IDEOGRAPH
+0xE7A4 0x9049  #CJK UNIFIED IDEOGRAPH
+0xE7A5 0x903E  #CJK UNIFIED IDEOGRAPH
+0xE7A6 0x9056  #CJK UNIFIED IDEOGRAPH
+0xE7A7 0x9058  #CJK UNIFIED IDEOGRAPH
+0xE7A8 0x905E  #CJK UNIFIED IDEOGRAPH
+0xE7A9 0x9068  #CJK UNIFIED IDEOGRAPH
+0xE7AA 0x906F  #CJK UNIFIED IDEOGRAPH
+0xE7AB 0x9076  #CJK UNIFIED IDEOGRAPH
+0xE7AC 0x96A8  #CJK UNIFIED IDEOGRAPH
+0xE7AD 0x9072  #CJK UNIFIED IDEOGRAPH
+0xE7AE 0x9082  #CJK UNIFIED IDEOGRAPH
+0xE7AF 0x907D  #CJK UNIFIED IDEOGRAPH
+0xE7B0 0x9081  #CJK UNIFIED IDEOGRAPH
+0xE7B1 0x9080  #CJK UNIFIED IDEOGRAPH
+0xE7B2 0x908A  #CJK UNIFIED IDEOGRAPH
+0xE7B3 0x9089  #CJK UNIFIED IDEOGRAPH
+0xE7B4 0x908F  #CJK UNIFIED IDEOGRAPH
+0xE7B5 0x90A8  #CJK UNIFIED IDEOGRAPH
+0xE7B6 0x90AF  #CJK UNIFIED IDEOGRAPH
+0xE7B7 0x90B1  #CJK UNIFIED IDEOGRAPH
+0xE7B8 0x90B5  #CJK UNIFIED IDEOGRAPH
+0xE7B9 0x90E2  #CJK UNIFIED IDEOGRAPH
+0xE7BA 0x90E4  #CJK UNIFIED IDEOGRAPH
+0xE7BB 0x6248  #CJK UNIFIED IDEOGRAPH
+0xE7BC 0x90DB  #CJK UNIFIED IDEOGRAPH
+0xE7BD 0x9102  #CJK UNIFIED IDEOGRAPH
+0xE7BE 0x9112  #CJK UNIFIED IDEOGRAPH
+0xE7BF 0x9119  #CJK UNIFIED IDEOGRAPH
+0xE7C0 0x9132  #CJK UNIFIED IDEOGRAPH
+0xE7C1 0x9130  #CJK UNIFIED IDEOGRAPH
+0xE7C2 0x914A  #CJK UNIFIED IDEOGRAPH
+0xE7C3 0x9156  #CJK UNIFIED IDEOGRAPH
+0xE7C4 0x9158  #CJK UNIFIED IDEOGRAPH
+0xE7C5 0x9163  #CJK UNIFIED IDEOGRAPH
+0xE7C6 0x9165  #CJK UNIFIED IDEOGRAPH
+0xE7C7 0x9169  #CJK UNIFIED IDEOGRAPH
+0xE7C8 0x9173  #CJK UNIFIED IDEOGRAPH
+0xE7C9 0x9172  #CJK UNIFIED IDEOGRAPH
+0xE7CA 0x918B  #CJK UNIFIED IDEOGRAPH
+0xE7CB 0x9189  #CJK UNIFIED IDEOGRAPH
+0xE7CC 0x9182  #CJK UNIFIED IDEOGRAPH
+0xE7CD 0x91A2  #CJK UNIFIED IDEOGRAPH
+0xE7CE 0x91AB  #CJK UNIFIED IDEOGRAPH
+0xE7CF 0x91AF  #CJK UNIFIED IDEOGRAPH
+0xE7D0 0x91AA  #CJK UNIFIED IDEOGRAPH
+0xE7D1 0x91B5  #CJK UNIFIED IDEOGRAPH
+0xE7D2 0x91B4  #CJK UNIFIED IDEOGRAPH
+0xE7D3 0x91BA  #CJK UNIFIED IDEOGRAPH
+0xE7D4 0x91C0  #CJK UNIFIED IDEOGRAPH
+0xE7D5 0x91C1  #CJK UNIFIED IDEOGRAPH
+0xE7D6 0x91C9  #CJK UNIFIED IDEOGRAPH
+0xE7D7 0x91CB  #CJK UNIFIED IDEOGRAPH
+0xE7D8 0x91D0  #CJK UNIFIED IDEOGRAPH
+0xE7D9 0x91D6  #CJK UNIFIED IDEOGRAPH
+0xE7DA 0x91DF  #CJK UNIFIED IDEOGRAPH
+0xE7DB 0x91E1  #CJK UNIFIED IDEOGRAPH
+0xE7DC 0x91DB  #CJK UNIFIED IDEOGRAPH
+0xE7DD 0x91FC  #CJK UNIFIED IDEOGRAPH
+0xE7DE 0x91F5  #CJK UNIFIED IDEOGRAPH
+0xE7DF 0x91F6  #CJK UNIFIED IDEOGRAPH
+0xE7E0 0x921E  #CJK UNIFIED IDEOGRAPH
+0xE7E1 0x91FF  #CJK UNIFIED IDEOGRAPH
+0xE7E2 0x9214  #CJK UNIFIED IDEOGRAPH
+0xE7E3 0x922C  #CJK UNIFIED IDEOGRAPH
+0xE7E4 0x9215  #CJK UNIFIED IDEOGRAPH
+0xE7E5 0x9211  #CJK UNIFIED IDEOGRAPH
+0xE7E6 0x925E  #CJK UNIFIED IDEOGRAPH
+0xE7E7 0x9257  #CJK UNIFIED IDEOGRAPH
+0xE7E8 0x9245  #CJK UNIFIED IDEOGRAPH
+0xE7E9 0x9249  #CJK UNIFIED IDEOGRAPH
+0xE7EA 0x9264  #CJK UNIFIED IDEOGRAPH
+0xE7EB 0x9248  #CJK UNIFIED IDEOGRAPH
+0xE7EC 0x9295  #CJK UNIFIED IDEOGRAPH
+0xE7ED 0x923F  #CJK UNIFIED IDEOGRAPH
+0xE7EE 0x924B  #CJK UNIFIED IDEOGRAPH
+0xE7EF 0x9250  #CJK UNIFIED IDEOGRAPH
+0xE7F0 0x929C  #CJK UNIFIED IDEOGRAPH
+0xE7F1 0x9296  #CJK UNIFIED IDEOGRAPH
+0xE7F2 0x9293  #CJK UNIFIED IDEOGRAPH
+0xE7F3 0x929B  #CJK UNIFIED IDEOGRAPH
+0xE7F4 0x925A  #CJK UNIFIED IDEOGRAPH
+0xE7F5 0x92CF  #CJK UNIFIED IDEOGRAPH
+0xE7F6 0x92B9  #CJK UNIFIED IDEOGRAPH
+0xE7F7 0x92B7  #CJK UNIFIED IDEOGRAPH
+0xE7F8 0x92E9  #CJK UNIFIED IDEOGRAPH
+0xE7F9 0x930F  #CJK UNIFIED IDEOGRAPH
+0xE7FA 0x92FA  #CJK UNIFIED IDEOGRAPH
+0xE7FB 0x9344  #CJK UNIFIED IDEOGRAPH
+0xE7FC 0x932E  #CJK UNIFIED IDEOGRAPH
+0xE840 0x9319  #CJK UNIFIED IDEOGRAPH
+0xE841 0x9322  #CJK UNIFIED IDEOGRAPH
+0xE842 0x931A  #CJK UNIFIED IDEOGRAPH
+0xE843 0x9323  #CJK UNIFIED IDEOGRAPH
+0xE844 0x933A  #CJK UNIFIED IDEOGRAPH
+0xE845 0x9335  #CJK UNIFIED IDEOGRAPH
+0xE846 0x933B  #CJK UNIFIED IDEOGRAPH
+0xE847 0x935C  #CJK UNIFIED IDEOGRAPH
+0xE848 0x9360  #CJK UNIFIED IDEOGRAPH
+0xE849 0x937C  #CJK UNIFIED IDEOGRAPH
+0xE84A 0x936E  #CJK UNIFIED IDEOGRAPH
+0xE84B 0x9356  #CJK UNIFIED IDEOGRAPH
+0xE84C 0x93B0  #CJK UNIFIED IDEOGRAPH
+0xE84D 0x93AC  #CJK UNIFIED IDEOGRAPH
+0xE84E 0x93AD  #CJK UNIFIED IDEOGRAPH
+0xE84F 0x9394  #CJK UNIFIED IDEOGRAPH
+0xE850 0x93B9  #CJK UNIFIED IDEOGRAPH
+0xE851 0x93D6  #CJK UNIFIED IDEOGRAPH
+0xE852 0x93D7  #CJK UNIFIED IDEOGRAPH
+0xE853 0x93E8  #CJK UNIFIED IDEOGRAPH
+0xE854 0x93E5  #CJK UNIFIED IDEOGRAPH
+0xE855 0x93D8  #CJK UNIFIED IDEOGRAPH
+0xE856 0x93C3  #CJK UNIFIED IDEOGRAPH
+0xE857 0x93DD  #CJK UNIFIED IDEOGRAPH
+0xE858 0x93D0  #CJK UNIFIED IDEOGRAPH
+0xE859 0x93C8  #CJK UNIFIED IDEOGRAPH
+0xE85A 0x93E4  #CJK UNIFIED IDEOGRAPH
+0xE85B 0x941A  #CJK UNIFIED IDEOGRAPH
+0xE85C 0x9414  #CJK UNIFIED IDEOGRAPH
+0xE85D 0x9413  #CJK UNIFIED IDEOGRAPH
+0xE85E 0x9403  #CJK UNIFIED IDEOGRAPH
+0xE85F 0x9407  #CJK UNIFIED IDEOGRAPH
+0xE860 0x9410  #CJK UNIFIED IDEOGRAPH
+0xE861 0x9436  #CJK UNIFIED IDEOGRAPH
+0xE862 0x942B  #CJK UNIFIED IDEOGRAPH
+0xE863 0x9435  #CJK UNIFIED IDEOGRAPH
+0xE864 0x9421  #CJK UNIFIED IDEOGRAPH
+0xE865 0x943A  #CJK UNIFIED IDEOGRAPH
+0xE866 0x9441  #CJK UNIFIED IDEOGRAPH
+0xE867 0x9452  #CJK UNIFIED IDEOGRAPH
+0xE868 0x9444  #CJK UNIFIED IDEOGRAPH
+0xE869 0x945B  #CJK UNIFIED IDEOGRAPH
+0xE86A 0x9460  #CJK UNIFIED IDEOGRAPH
+0xE86B 0x9462  #CJK UNIFIED IDEOGRAPH
+0xE86C 0x945E  #CJK UNIFIED IDEOGRAPH
+0xE86D 0x946A  #CJK UNIFIED IDEOGRAPH
+0xE86E 0x9229  #CJK UNIFIED IDEOGRAPH
+0xE86F 0x9470  #CJK UNIFIED IDEOGRAPH
+0xE870 0x9475  #CJK UNIFIED IDEOGRAPH
+0xE871 0x9477  #CJK UNIFIED IDEOGRAPH
+0xE872 0x947D  #CJK UNIFIED IDEOGRAPH
+0xE873 0x945A  #CJK UNIFIED IDEOGRAPH
+0xE874 0x947C  #CJK UNIFIED IDEOGRAPH
+0xE875 0x947E  #CJK UNIFIED IDEOGRAPH
+0xE876 0x9481  #CJK UNIFIED IDEOGRAPH
+0xE877 0x947F  #CJK UNIFIED IDEOGRAPH
+0xE878 0x9582  #CJK UNIFIED IDEOGRAPH
+0xE879 0x9587  #CJK UNIFIED IDEOGRAPH
+0xE87A 0x958A  #CJK UNIFIED IDEOGRAPH
+0xE87B 0x9594  #CJK UNIFIED IDEOGRAPH
+0xE87C 0x9596  #CJK UNIFIED IDEOGRAPH
+0xE87D 0x9598  #CJK UNIFIED IDEOGRAPH
+0xE87E 0x9599  #CJK UNIFIED IDEOGRAPH
+0xE880 0x95A0  #CJK UNIFIED IDEOGRAPH
+0xE881 0x95A8  #CJK UNIFIED IDEOGRAPH
+0xE882 0x95A7  #CJK UNIFIED IDEOGRAPH
+0xE883 0x95AD  #CJK UNIFIED IDEOGRAPH
+0xE884 0x95BC  #CJK UNIFIED IDEOGRAPH
+0xE885 0x95BB  #CJK UNIFIED IDEOGRAPH
+0xE886 0x95B9  #CJK UNIFIED IDEOGRAPH
+0xE887 0x95BE  #CJK UNIFIED IDEOGRAPH
+0xE888 0x95CA  #CJK UNIFIED IDEOGRAPH
+0xE889 0x6FF6  #CJK UNIFIED IDEOGRAPH
+0xE88A 0x95C3  #CJK UNIFIED IDEOGRAPH
+0xE88B 0x95CD  #CJK UNIFIED IDEOGRAPH
+0xE88C 0x95CC  #CJK UNIFIED IDEOGRAPH
+0xE88D 0x95D5  #CJK UNIFIED IDEOGRAPH
+0xE88E 0x95D4  #CJK UNIFIED IDEOGRAPH
+0xE88F 0x95D6  #CJK UNIFIED IDEOGRAPH
+0xE890 0x95DC  #CJK UNIFIED IDEOGRAPH
+0xE891 0x95E1  #CJK UNIFIED IDEOGRAPH
+0xE892 0x95E5  #CJK UNIFIED IDEOGRAPH
+0xE893 0x95E2  #CJK UNIFIED IDEOGRAPH
+0xE894 0x9621  #CJK UNIFIED IDEOGRAPH
+0xE895 0x9628  #CJK UNIFIED IDEOGRAPH
+0xE896 0x962E  #CJK UNIFIED IDEOGRAPH
+0xE897 0x962F  #CJK UNIFIED IDEOGRAPH
+0xE898 0x9642  #CJK UNIFIED IDEOGRAPH
+0xE899 0x964C  #CJK UNIFIED IDEOGRAPH
+0xE89A 0x964F  #CJK UNIFIED IDEOGRAPH
+0xE89B 0x964B  #CJK UNIFIED IDEOGRAPH
+0xE89C 0x9677  #CJK UNIFIED IDEOGRAPH
+0xE89D 0x965C  #CJK UNIFIED IDEOGRAPH
+0xE89E 0x965E  #CJK UNIFIED IDEOGRAPH
+0xE89F 0x965D  #CJK UNIFIED IDEOGRAPH
+0xE8A0 0x965F  #CJK UNIFIED IDEOGRAPH
+0xE8A1 0x9666  #CJK UNIFIED IDEOGRAPH
+0xE8A2 0x9672  #CJK UNIFIED IDEOGRAPH
+0xE8A3 0x966C  #CJK UNIFIED IDEOGRAPH
+0xE8A4 0x968D  #CJK UNIFIED IDEOGRAPH
+0xE8A5 0x9698  #CJK UNIFIED IDEOGRAPH
+0xE8A6 0x9695  #CJK UNIFIED IDEOGRAPH
+0xE8A7 0x9697  #CJK UNIFIED IDEOGRAPH
+0xE8A8 0x96AA  #CJK UNIFIED IDEOGRAPH
+0xE8A9 0x96A7  #CJK UNIFIED IDEOGRAPH
+0xE8AA 0x96B1  #CJK UNIFIED IDEOGRAPH
+0xE8AB 0x96B2  #CJK UNIFIED IDEOGRAPH
+0xE8AC 0x96B0  #CJK UNIFIED IDEOGRAPH
+0xE8AD 0x96B4  #CJK UNIFIED IDEOGRAPH
+0xE8AE 0x96B6  #CJK UNIFIED IDEOGRAPH
+0xE8AF 0x96B8  #CJK UNIFIED IDEOGRAPH
+0xE8B0 0x96B9  #CJK UNIFIED IDEOGRAPH
+0xE8B1 0x96CE  #CJK UNIFIED IDEOGRAPH
+0xE8B2 0x96CB  #CJK UNIFIED IDEOGRAPH
+0xE8B3 0x96C9  #CJK UNIFIED IDEOGRAPH
+0xE8B4 0x96CD  #CJK UNIFIED IDEOGRAPH
+0xE8B5 0x894D  #CJK UNIFIED IDEOGRAPH
+0xE8B6 0x96DC  #CJK UNIFIED IDEOGRAPH
+0xE8B7 0x970D  #CJK UNIFIED IDEOGRAPH
+0xE8B8 0x96D5  #CJK UNIFIED IDEOGRAPH
+0xE8B9 0x96F9  #CJK UNIFIED IDEOGRAPH
+0xE8BA 0x9704  #CJK UNIFIED IDEOGRAPH
+0xE8BB 0x9706  #CJK UNIFIED IDEOGRAPH
+0xE8BC 0x9708  #CJK UNIFIED IDEOGRAPH
+0xE8BD 0x9713  #CJK UNIFIED IDEOGRAPH
+0xE8BE 0x970E  #CJK UNIFIED IDEOGRAPH
+0xE8BF 0x9711  #CJK UNIFIED IDEOGRAPH
+0xE8C0 0x970F  #CJK UNIFIED IDEOGRAPH
+0xE8C1 0x9716  #CJK UNIFIED IDEOGRAPH
+0xE8C2 0x9719  #CJK UNIFIED IDEOGRAPH
+0xE8C3 0x9724  #CJK UNIFIED IDEOGRAPH
+0xE8C4 0x972A  #CJK UNIFIED IDEOGRAPH
+0xE8C5 0x9730  #CJK UNIFIED IDEOGRAPH
+0xE8C6 0x9739  #CJK UNIFIED IDEOGRAPH
+0xE8C7 0x973D  #CJK UNIFIED IDEOGRAPH
+0xE8C8 0x973E  #CJK UNIFIED IDEOGRAPH
+0xE8C9 0x9744  #CJK UNIFIED IDEOGRAPH
+0xE8CA 0x9746  #CJK UNIFIED IDEOGRAPH
+0xE8CB 0x9748  #CJK UNIFIED IDEOGRAPH
+0xE8CC 0x9742  #CJK UNIFIED IDEOGRAPH
+0xE8CD 0x9749  #CJK UNIFIED IDEOGRAPH
+0xE8CE 0x975C  #CJK UNIFIED IDEOGRAPH
+0xE8CF 0x9760  #CJK UNIFIED IDEOGRAPH
+0xE8D0 0x9764  #CJK UNIFIED IDEOGRAPH
+0xE8D1 0x9766  #CJK UNIFIED IDEOGRAPH
+0xE8D2 0x9768  #CJK UNIFIED IDEOGRAPH
+0xE8D3 0x52D2  #CJK UNIFIED IDEOGRAPH
+0xE8D4 0x976B  #CJK UNIFIED IDEOGRAPH
+0xE8D5 0x9771  #CJK UNIFIED IDEOGRAPH
+0xE8D6 0x9779  #CJK UNIFIED IDEOGRAPH
+0xE8D7 0x9785  #CJK UNIFIED IDEOGRAPH
+0xE8D8 0x977C  #CJK UNIFIED IDEOGRAPH
+0xE8D9 0x9781  #CJK UNIFIED IDEOGRAPH
+0xE8DA 0x977A  #CJK UNIFIED IDEOGRAPH
+0xE8DB 0x9786  #CJK UNIFIED IDEOGRAPH
+0xE8DC 0x978B  #CJK UNIFIED IDEOGRAPH
+0xE8DD 0x978F  #CJK UNIFIED IDEOGRAPH
+0xE8DE 0x9790  #CJK UNIFIED IDEOGRAPH
+0xE8DF 0x979C  #CJK UNIFIED IDEOGRAPH
+0xE8E0 0x97A8  #CJK UNIFIED IDEOGRAPH
+0xE8E1 0x97A6  #CJK UNIFIED IDEOGRAPH
+0xE8E2 0x97A3  #CJK UNIFIED IDEOGRAPH
+0xE8E3 0x97B3  #CJK UNIFIED IDEOGRAPH
+0xE8E4 0x97B4  #CJK UNIFIED IDEOGRAPH
+0xE8E5 0x97C3  #CJK UNIFIED IDEOGRAPH
+0xE8E6 0x97C6  #CJK UNIFIED IDEOGRAPH
+0xE8E7 0x97C8  #CJK UNIFIED IDEOGRAPH
+0xE8E8 0x97CB  #CJK UNIFIED IDEOGRAPH
+0xE8E9 0x97DC  #CJK UNIFIED IDEOGRAPH
+0xE8EA 0x97ED  #CJK UNIFIED IDEOGRAPH
+0xE8EB 0x9F4F  #CJK UNIFIED IDEOGRAPH
+0xE8EC 0x97F2  #CJK UNIFIED IDEOGRAPH
+0xE8ED 0x7ADF  #CJK UNIFIED IDEOGRAPH
+0xE8EE 0x97F6  #CJK UNIFIED IDEOGRAPH
+0xE8EF 0x97F5  #CJK UNIFIED IDEOGRAPH
+0xE8F0 0x980F  #CJK UNIFIED IDEOGRAPH
+0xE8F1 0x980C  #CJK UNIFIED IDEOGRAPH
+0xE8F2 0x9838  #CJK UNIFIED IDEOGRAPH
+0xE8F3 0x9824  #CJK UNIFIED IDEOGRAPH
+0xE8F4 0x9821  #CJK UNIFIED IDEOGRAPH
+0xE8F5 0x9837  #CJK UNIFIED IDEOGRAPH
+0xE8F6 0x983D  #CJK UNIFIED IDEOGRAPH
+0xE8F7 0x9846  #CJK UNIFIED IDEOGRAPH
+0xE8F8 0x984F  #CJK UNIFIED IDEOGRAPH
+0xE8F9 0x984B  #CJK UNIFIED IDEOGRAPH
+0xE8FA 0x986B  #CJK UNIFIED IDEOGRAPH
+0xE8FB 0x986F  #CJK UNIFIED IDEOGRAPH
+0xE8FC 0x9870  #CJK UNIFIED IDEOGRAPH
+0xE940 0x9871  #CJK UNIFIED IDEOGRAPH
+0xE941 0x9874  #CJK UNIFIED IDEOGRAPH
+0xE942 0x9873  #CJK UNIFIED IDEOGRAPH
+0xE943 0x98AA  #CJK UNIFIED IDEOGRAPH
+0xE944 0x98AF  #CJK UNIFIED IDEOGRAPH
+0xE945 0x98B1  #CJK UNIFIED IDEOGRAPH
+0xE946 0x98B6  #CJK UNIFIED IDEOGRAPH
+0xE947 0x98C4  #CJK UNIFIED IDEOGRAPH
+0xE948 0x98C3  #CJK UNIFIED IDEOGRAPH
+0xE949 0x98C6  #CJK UNIFIED IDEOGRAPH
+0xE94A 0x98E9  #CJK UNIFIED IDEOGRAPH
+0xE94B 0x98EB  #CJK UNIFIED IDEOGRAPH
+0xE94C 0x9903  #CJK UNIFIED IDEOGRAPH
+0xE94D 0x9909  #CJK UNIFIED IDEOGRAPH
+0xE94E 0x9912  #CJK UNIFIED IDEOGRAPH
+0xE94F 0x9914  #CJK UNIFIED IDEOGRAPH
+0xE950 0x9918  #CJK UNIFIED IDEOGRAPH
+0xE951 0x9921  #CJK UNIFIED IDEOGRAPH
+0xE952 0x991D  #CJK UNIFIED IDEOGRAPH
+0xE953 0x991E  #CJK UNIFIED IDEOGRAPH
+0xE954 0x9924  #CJK UNIFIED IDEOGRAPH
+0xE955 0x9920  #CJK UNIFIED IDEOGRAPH
+0xE956 0x992C  #CJK UNIFIED IDEOGRAPH
+0xE957 0x992E  #CJK UNIFIED IDEOGRAPH
+0xE958 0x993D  #CJK UNIFIED IDEOGRAPH
+0xE959 0x993E  #CJK UNIFIED IDEOGRAPH
+0xE95A 0x9942  #CJK UNIFIED IDEOGRAPH
+0xE95B 0x9949  #CJK UNIFIED IDEOGRAPH
+0xE95C 0x9945  #CJK UNIFIED IDEOGRAPH
+0xE95D 0x9950  #CJK UNIFIED IDEOGRAPH
+0xE95E 0x994B  #CJK UNIFIED IDEOGRAPH
+0xE95F 0x9951  #CJK UNIFIED IDEOGRAPH
+0xE960 0x9952  #CJK UNIFIED IDEOGRAPH
+0xE961 0x994C  #CJK UNIFIED IDEOGRAPH
+0xE962 0x9955  #CJK UNIFIED IDEOGRAPH
+0xE963 0x9997  #CJK UNIFIED IDEOGRAPH
+0xE964 0x9998  #CJK UNIFIED IDEOGRAPH
+0xE965 0x99A5  #CJK UNIFIED IDEOGRAPH
+0xE966 0x99AD  #CJK UNIFIED IDEOGRAPH
+0xE967 0x99AE  #CJK UNIFIED IDEOGRAPH
+0xE968 0x99BC  #CJK UNIFIED IDEOGRAPH
+0xE969 0x99DF  #CJK UNIFIED IDEOGRAPH
+0xE96A 0x99DB  #CJK UNIFIED IDEOGRAPH
+0xE96B 0x99DD  #CJK UNIFIED IDEOGRAPH
+0xE96C 0x99D8  #CJK UNIFIED IDEOGRAPH
+0xE96D 0x99D1  #CJK UNIFIED IDEOGRAPH
+0xE96E 0x99ED  #CJK UNIFIED IDEOGRAPH
+0xE96F 0x99EE  #CJK UNIFIED IDEOGRAPH
+0xE970 0x99F1  #CJK UNIFIED IDEOGRAPH
+0xE971 0x99F2  #CJK UNIFIED IDEOGRAPH
+0xE972 0x99FB  #CJK UNIFIED IDEOGRAPH
+0xE973 0x99F8  #CJK UNIFIED IDEOGRAPH
+0xE974 0x9A01  #CJK UNIFIED IDEOGRAPH
+0xE975 0x9A0F  #CJK UNIFIED IDEOGRAPH
+0xE976 0x9A05  #CJK UNIFIED IDEOGRAPH
+0xE977 0x99E2  #CJK UNIFIED IDEOGRAPH
+0xE978 0x9A19  #CJK UNIFIED IDEOGRAPH
+0xE979 0x9A2B  #CJK UNIFIED IDEOGRAPH
+0xE97A 0x9A37  #CJK UNIFIED IDEOGRAPH
+0xE97B 0x9A45  #CJK UNIFIED IDEOGRAPH
+0xE97C 0x9A42  #CJK UNIFIED IDEOGRAPH
+0xE97D 0x9A40  #CJK UNIFIED IDEOGRAPH
+0xE97E 0x9A43  #CJK UNIFIED IDEOGRAPH
+0xE980 0x9A3E  #CJK UNIFIED IDEOGRAPH
+0xE981 0x9A55  #CJK UNIFIED IDEOGRAPH
+0xE982 0x9A4D  #CJK UNIFIED IDEOGRAPH
+0xE983 0x9A5B  #CJK UNIFIED IDEOGRAPH
+0xE984 0x9A57  #CJK UNIFIED IDEOGRAPH
+0xE985 0x9A5F  #CJK UNIFIED IDEOGRAPH
+0xE986 0x9A62  #CJK UNIFIED IDEOGRAPH
+0xE987 0x9A65  #CJK UNIFIED IDEOGRAPH
+0xE988 0x9A64  #CJK UNIFIED IDEOGRAPH
+0xE989 0x9A69  #CJK UNIFIED IDEOGRAPH
+0xE98A 0x9A6B  #CJK UNIFIED IDEOGRAPH
+0xE98B 0x9A6A  #CJK UNIFIED IDEOGRAPH
+0xE98C 0x9AAD  #CJK UNIFIED IDEOGRAPH
+0xE98D 0x9AB0  #CJK UNIFIED IDEOGRAPH
+0xE98E 0x9ABC  #CJK UNIFIED IDEOGRAPH
+0xE98F 0x9AC0  #CJK UNIFIED IDEOGRAPH
+0xE990 0x9ACF  #CJK UNIFIED IDEOGRAPH
+0xE991 0x9AD1  #CJK UNIFIED IDEOGRAPH
+0xE992 0x9AD3  #CJK UNIFIED IDEOGRAPH
+0xE993 0x9AD4  #CJK UNIFIED IDEOGRAPH
+0xE994 0x9ADE  #CJK UNIFIED IDEOGRAPH
+0xE995 0x9ADF  #CJK UNIFIED IDEOGRAPH
+0xE996 0x9AE2  #CJK UNIFIED IDEOGRAPH
+0xE997 0x9AE3  #CJK UNIFIED IDEOGRAPH
+0xE998 0x9AE6  #CJK UNIFIED IDEOGRAPH
+0xE999 0x9AEF  #CJK UNIFIED IDEOGRAPH
+0xE99A 0x9AEB  #CJK UNIFIED IDEOGRAPH
+0xE99B 0x9AEE  #CJK UNIFIED IDEOGRAPH
+0xE99C 0x9AF4  #CJK UNIFIED IDEOGRAPH
+0xE99D 0x9AF1  #CJK UNIFIED IDEOGRAPH
+0xE99E 0x9AF7  #CJK UNIFIED IDEOGRAPH
+0xE99F 0x9AFB  #CJK UNIFIED IDEOGRAPH
+0xE9A0 0x9B06  #CJK UNIFIED IDEOGRAPH
+0xE9A1 0x9B18  #CJK UNIFIED IDEOGRAPH
+0xE9A2 0x9B1A  #CJK UNIFIED IDEOGRAPH
+0xE9A3 0x9B1F  #CJK UNIFIED IDEOGRAPH
+0xE9A4 0x9B22  #CJK UNIFIED IDEOGRAPH
+0xE9A5 0x9B23  #CJK UNIFIED IDEOGRAPH
+0xE9A6 0x9B25  #CJK UNIFIED IDEOGRAPH
+0xE9A7 0x9B27  #CJK UNIFIED IDEOGRAPH
+0xE9A8 0x9B28  #CJK UNIFIED IDEOGRAPH
+0xE9A9 0x9B29  #CJK UNIFIED IDEOGRAPH
+0xE9AA 0x9B2A  #CJK UNIFIED IDEOGRAPH
+0xE9AB 0x9B2E  #CJK UNIFIED IDEOGRAPH
+0xE9AC 0x9B2F  #CJK UNIFIED IDEOGRAPH
+0xE9AD 0x9B32  #CJK UNIFIED IDEOGRAPH
+0xE9AE 0x9B44  #CJK UNIFIED IDEOGRAPH
+0xE9AF 0x9B43  #CJK UNIFIED IDEOGRAPH
+0xE9B0 0x9B4F  #CJK UNIFIED IDEOGRAPH
+0xE9B1 0x9B4D  #CJK UNIFIED IDEOGRAPH
+0xE9B2 0x9B4E  #CJK UNIFIED IDEOGRAPH
+0xE9B3 0x9B51  #CJK UNIFIED IDEOGRAPH
+0xE9B4 0x9B58  #CJK UNIFIED IDEOGRAPH
+0xE9B5 0x9B74  #CJK UNIFIED IDEOGRAPH
+0xE9B6 0x9B93  #CJK UNIFIED IDEOGRAPH
+0xE9B7 0x9B83  #CJK UNIFIED IDEOGRAPH
+0xE9B8 0x9B91  #CJK UNIFIED IDEOGRAPH
+0xE9B9 0x9B96  #CJK UNIFIED IDEOGRAPH
+0xE9BA 0x9B97  #CJK UNIFIED IDEOGRAPH
+0xE9BB 0x9B9F  #CJK UNIFIED IDEOGRAPH
+0xE9BC 0x9BA0  #CJK UNIFIED IDEOGRAPH
+0xE9BD 0x9BA8  #CJK UNIFIED IDEOGRAPH
+0xE9BE 0x9BB4  #CJK UNIFIED IDEOGRAPH
+0xE9BF 0x9BC0  #CJK UNIFIED IDEOGRAPH
+0xE9C0 0x9BCA  #CJK UNIFIED IDEOGRAPH
+0xE9C1 0x9BB9  #CJK UNIFIED IDEOGRAPH
+0xE9C2 0x9BC6  #CJK UNIFIED IDEOGRAPH
+0xE9C3 0x9BCF  #CJK UNIFIED IDEOGRAPH
+0xE9C4 0x9BD1  #CJK UNIFIED IDEOGRAPH
+0xE9C5 0x9BD2  #CJK UNIFIED IDEOGRAPH
+0xE9C6 0x9BE3  #CJK UNIFIED IDEOGRAPH
+0xE9C7 0x9BE2  #CJK UNIFIED IDEOGRAPH
+0xE9C8 0x9BE4  #CJK UNIFIED IDEOGRAPH
+0xE9C9 0x9BD4  #CJK UNIFIED IDEOGRAPH
+0xE9CA 0x9BE1  #CJK UNIFIED IDEOGRAPH
+0xE9CB 0x9C3A  #CJK UNIFIED IDEOGRAPH
+0xE9CC 0x9BF2  #CJK UNIFIED IDEOGRAPH
+0xE9CD 0x9BF1  #CJK UNIFIED IDEOGRAPH
+0xE9CE 0x9BF0  #CJK UNIFIED IDEOGRAPH
+0xE9CF 0x9C15  #CJK UNIFIED IDEOGRAPH
+0xE9D0 0x9C14  #CJK UNIFIED IDEOGRAPH
+0xE9D1 0x9C09  #CJK UNIFIED IDEOGRAPH
+0xE9D2 0x9C13  #CJK UNIFIED IDEOGRAPH
+0xE9D3 0x9C0C  #CJK UNIFIED IDEOGRAPH
+0xE9D4 0x9C06  #CJK UNIFIED IDEOGRAPH
+0xE9D5 0x9C08  #CJK UNIFIED IDEOGRAPH
+0xE9D6 0x9C12  #CJK UNIFIED IDEOGRAPH
+0xE9D7 0x9C0A  #CJK UNIFIED IDEOGRAPH
+0xE9D8 0x9C04  #CJK UNIFIED IDEOGRAPH
+0xE9D9 0x9C2E  #CJK UNIFIED IDEOGRAPH
+0xE9DA 0x9C1B  #CJK UNIFIED IDEOGRAPH
+0xE9DB 0x9C25  #CJK UNIFIED IDEOGRAPH
+0xE9DC 0x9C24  #CJK UNIFIED IDEOGRAPH
+0xE9DD 0x9C21  #CJK UNIFIED IDEOGRAPH
+0xE9DE 0x9C30  #CJK UNIFIED IDEOGRAPH
+0xE9DF 0x9C47  #CJK UNIFIED IDEOGRAPH
+0xE9E0 0x9C32  #CJK UNIFIED IDEOGRAPH
+0xE9E1 0x9C46  #CJK UNIFIED IDEOGRAPH
+0xE9E2 0x9C3E  #CJK UNIFIED IDEOGRAPH
+0xE9E3 0x9C5A  #CJK UNIFIED IDEOGRAPH
+0xE9E4 0x9C60  #CJK UNIFIED IDEOGRAPH
+0xE9E5 0x9C67  #CJK UNIFIED IDEOGRAPH
+0xE9E6 0x9C76  #CJK UNIFIED IDEOGRAPH
+0xE9E7 0x9C78  #CJK UNIFIED IDEOGRAPH
+0xE9E8 0x9CE7  #CJK UNIFIED IDEOGRAPH
+0xE9E9 0x9CEC  #CJK UNIFIED IDEOGRAPH
+0xE9EA 0x9CF0  #CJK UNIFIED IDEOGRAPH
+0xE9EB 0x9D09  #CJK UNIFIED IDEOGRAPH
+0xE9EC 0x9D08  #CJK UNIFIED IDEOGRAPH
+0xE9ED 0x9CEB  #CJK UNIFIED IDEOGRAPH
+0xE9EE 0x9D03  #CJK UNIFIED IDEOGRAPH
+0xE9EF 0x9D06  #CJK UNIFIED IDEOGRAPH
+0xE9F0 0x9D2A  #CJK UNIFIED IDEOGRAPH
+0xE9F1 0x9D26  #CJK UNIFIED IDEOGRAPH
+0xE9F2 0x9DAF  #CJK UNIFIED IDEOGRAPH
+0xE9F3 0x9D23  #CJK UNIFIED IDEOGRAPH
+0xE9F4 0x9D1F  #CJK UNIFIED IDEOGRAPH
+0xE9F5 0x9D44  #CJK UNIFIED IDEOGRAPH
+0xE9F6 0x9D15  #CJK UNIFIED IDEOGRAPH
+0xE9F7 0x9D12  #CJK UNIFIED IDEOGRAPH
+0xE9F8 0x9D41  #CJK UNIFIED IDEOGRAPH
+0xE9F9 0x9D3F  #CJK UNIFIED IDEOGRAPH
+0xE9FA 0x9D3E  #CJK UNIFIED IDEOGRAPH
+0xE9FB 0x9D46  #CJK UNIFIED IDEOGRAPH
+0xE9FC 0x9D48  #CJK UNIFIED IDEOGRAPH
+0xEA40 0x9D5D  #CJK UNIFIED IDEOGRAPH
+0xEA41 0x9D5E  #CJK UNIFIED IDEOGRAPH
+0xEA42 0x9D64  #CJK UNIFIED IDEOGRAPH
+0xEA43 0x9D51  #CJK UNIFIED IDEOGRAPH
+0xEA44 0x9D50  #CJK UNIFIED IDEOGRAPH
+0xEA45 0x9D59  #CJK UNIFIED IDEOGRAPH
+0xEA46 0x9D72  #CJK UNIFIED IDEOGRAPH
+0xEA47 0x9D89  #CJK UNIFIED IDEOGRAPH
+0xEA48 0x9D87  #CJK UNIFIED IDEOGRAPH
+0xEA49 0x9DAB  #CJK UNIFIED IDEOGRAPH
+0xEA4A 0x9D6F  #CJK UNIFIED IDEOGRAPH
+0xEA4B 0x9D7A  #CJK UNIFIED IDEOGRAPH
+0xEA4C 0x9D9A  #CJK UNIFIED IDEOGRAPH
+0xEA4D 0x9DA4  #CJK UNIFIED IDEOGRAPH
+0xEA4E 0x9DA9  #CJK UNIFIED IDEOGRAPH
+0xEA4F 0x9DB2  #CJK UNIFIED IDEOGRAPH
+0xEA50 0x9DC4  #CJK UNIFIED IDEOGRAPH
+0xEA51 0x9DC1  #CJK UNIFIED IDEOGRAPH
+0xEA52 0x9DBB  #CJK UNIFIED IDEOGRAPH
+0xEA53 0x9DB8  #CJK UNIFIED IDEOGRAPH
+0xEA54 0x9DBA  #CJK UNIFIED IDEOGRAPH
+0xEA55 0x9DC6  #CJK UNIFIED IDEOGRAPH
+0xEA56 0x9DCF  #CJK UNIFIED IDEOGRAPH
+0xEA57 0x9DC2  #CJK UNIFIED IDEOGRAPH
+0xEA58 0x9DD9  #CJK UNIFIED IDEOGRAPH
+0xEA59 0x9DD3  #CJK UNIFIED IDEOGRAPH
+0xEA5A 0x9DF8  #CJK UNIFIED IDEOGRAPH
+0xEA5B 0x9DE6  #CJK UNIFIED IDEOGRAPH
+0xEA5C 0x9DED  #CJK UNIFIED IDEOGRAPH
+0xEA5D 0x9DEF  #CJK UNIFIED IDEOGRAPH
+0xEA5E 0x9DFD  #CJK UNIFIED IDEOGRAPH
+0xEA5F 0x9E1A  #CJK UNIFIED IDEOGRAPH
+0xEA60 0x9E1B  #CJK UNIFIED IDEOGRAPH
+0xEA61 0x9E1E  #CJK UNIFIED IDEOGRAPH
+0xEA62 0x9E75  #CJK UNIFIED IDEOGRAPH
+0xEA63 0x9E79  #CJK UNIFIED IDEOGRAPH
+0xEA64 0x9E7D  #CJK UNIFIED IDEOGRAPH
+0xEA65 0x9E81  #CJK UNIFIED IDEOGRAPH
+0xEA66 0x9E88  #CJK UNIFIED IDEOGRAPH
+0xEA67 0x9E8B  #CJK UNIFIED IDEOGRAPH
+0xEA68 0x9E8C  #CJK UNIFIED IDEOGRAPH
+0xEA69 0x9E92  #CJK UNIFIED IDEOGRAPH
+0xEA6A 0x9E95  #CJK UNIFIED IDEOGRAPH
+0xEA6B 0x9E91  #CJK UNIFIED IDEOGRAPH
+0xEA6C 0x9E9D  #CJK UNIFIED IDEOGRAPH
+0xEA6D 0x9EA5  #CJK UNIFIED IDEOGRAPH
+0xEA6E 0x9EA9  #CJK UNIFIED IDEOGRAPH
+0xEA6F 0x9EB8  #CJK UNIFIED IDEOGRAPH
+0xEA70 0x9EAA  #CJK UNIFIED IDEOGRAPH
+0xEA71 0x9EAD  #CJK UNIFIED IDEOGRAPH
+0xEA72 0x9761  #CJK UNIFIED IDEOGRAPH
+0xEA73 0x9ECC  #CJK UNIFIED IDEOGRAPH
+0xEA74 0x9ECE  #CJK UNIFIED IDEOGRAPH
+0xEA75 0x9ECF  #CJK UNIFIED IDEOGRAPH
+0xEA76 0x9ED0  #CJK UNIFIED IDEOGRAPH
+0xEA77 0x9ED4  #CJK UNIFIED IDEOGRAPH
+0xEA78 0x9EDC  #CJK UNIFIED IDEOGRAPH
+0xEA79 0x9EDE  #CJK UNIFIED IDEOGRAPH
+0xEA7A 0x9EDD  #CJK UNIFIED IDEOGRAPH
+0xEA7B 0x9EE0  #CJK UNIFIED IDEOGRAPH
+0xEA7C 0x9EE5  #CJK UNIFIED IDEOGRAPH
+0xEA7D 0x9EE8  #CJK UNIFIED IDEOGRAPH
+0xEA7E 0x9EEF  #CJK UNIFIED IDEOGRAPH
+0xEA80 0x9EF4  #CJK UNIFIED IDEOGRAPH
+0xEA81 0x9EF6  #CJK UNIFIED IDEOGRAPH
+0xEA82 0x9EF7  #CJK UNIFIED IDEOGRAPH
+0xEA83 0x9EF9  #CJK UNIFIED IDEOGRAPH
+0xEA84 0x9EFB  #CJK UNIFIED IDEOGRAPH
+0xEA85 0x9EFC  #CJK UNIFIED IDEOGRAPH
+0xEA86 0x9EFD  #CJK UNIFIED IDEOGRAPH
+0xEA87 0x9F07  #CJK UNIFIED IDEOGRAPH
+0xEA88 0x9F08  #CJK UNIFIED IDEOGRAPH
+0xEA89 0x76B7  #CJK UNIFIED IDEOGRAPH
+0xEA8A 0x9F15  #CJK UNIFIED IDEOGRAPH
+0xEA8B 0x9F21  #CJK UNIFIED IDEOGRAPH
+0xEA8C 0x9F2C  #CJK UNIFIED IDEOGRAPH
+0xEA8D 0x9F3E  #CJK UNIFIED IDEOGRAPH
+0xEA8E 0x9F4A  #CJK UNIFIED IDEOGRAPH
+0xEA8F 0x9F52  #CJK UNIFIED IDEOGRAPH
+0xEA90 0x9F54  #CJK UNIFIED IDEOGRAPH
+0xEA91 0x9F63  #CJK UNIFIED IDEOGRAPH
+0xEA92 0x9F5F  #CJK UNIFIED IDEOGRAPH
+0xEA93 0x9F60  #CJK UNIFIED IDEOGRAPH
+0xEA94 0x9F61  #CJK UNIFIED IDEOGRAPH
+0xEA95 0x9F66  #CJK UNIFIED IDEOGRAPH
+0xEA96 0x9F67  #CJK UNIFIED IDEOGRAPH
+0xEA97 0x9F6C  #CJK UNIFIED IDEOGRAPH
+0xEA98 0x9F6A  #CJK UNIFIED IDEOGRAPH
+0xEA99 0x9F77  #CJK UNIFIED IDEOGRAPH
+0xEA9A 0x9F72  #CJK UNIFIED IDEOGRAPH
+0xEA9B 0x9F76  #CJK UNIFIED IDEOGRAPH
+0xEA9C 0x9F95  #CJK UNIFIED IDEOGRAPH
+0xEA9D 0x9F9C  #CJK UNIFIED IDEOGRAPH
+0xEA9E 0x9FA0  #CJK UNIFIED IDEOGRAPH
+0xEA9F 0x582F  #CJK UNIFIED IDEOGRAPH
+0xEAA0 0x69C7  #CJK UNIFIED IDEOGRAPH
+0xEAA1 0x9059  #CJK UNIFIED IDEOGRAPH
+0xEAA2 0x7464  #CJK UNIFIED IDEOGRAPH
+0xEAA3 0x51DC  #CJK UNIFIED IDEOGRAPH
+0xEAA4 0x7199  #CJK UNIFIED IDEOGRAPH
+0xED40 0x7E8A  #CJK UNIFIED IDEOGRAPH
+0xED41 0x891C  #CJK UNIFIED IDEOGRAPH
+0xED42 0x9348  #CJK UNIFIED IDEOGRAPH
+0xED43 0x9288  #CJK UNIFIED IDEOGRAPH
+0xED44 0x84DC  #CJK UNIFIED IDEOGRAPH
+0xED45 0x4FC9  #CJK UNIFIED IDEOGRAPH
+0xED46 0x70BB  #CJK UNIFIED IDEOGRAPH
+0xED47 0x6631  #CJK UNIFIED IDEOGRAPH
+0xED48 0x68C8  #CJK UNIFIED IDEOGRAPH
+0xED49 0x92F9  #CJK UNIFIED IDEOGRAPH
+0xED4A 0x66FB  #CJK UNIFIED IDEOGRAPH
+0xED4B 0x5F45  #CJK UNIFIED IDEOGRAPH
+0xED4C 0x4E28  #CJK UNIFIED IDEOGRAPH
+0xED4D 0x4EE1  #CJK UNIFIED IDEOGRAPH
+0xED4E 0x4EFC  #CJK UNIFIED IDEOGRAPH
+0xED4F 0x4F00  #CJK UNIFIED IDEOGRAPH
+0xED50 0x4F03  #CJK UNIFIED IDEOGRAPH
+0xED51 0x4F39  #CJK UNIFIED IDEOGRAPH
+0xED52 0x4F56  #CJK UNIFIED IDEOGRAPH
+0xED53 0x4F92  #CJK UNIFIED IDEOGRAPH
+0xED54 0x4F8A  #CJK UNIFIED IDEOGRAPH
+0xED55 0x4F9A  #CJK UNIFIED IDEOGRAPH
+0xED56 0x4F94  #CJK UNIFIED IDEOGRAPH
+0xED57 0x4FCD  #CJK UNIFIED IDEOGRAPH
+0xED58 0x5040  #CJK UNIFIED IDEOGRAPH
+0xED59 0x5022  #CJK UNIFIED IDEOGRAPH
+0xED5A 0x4FFF  #CJK UNIFIED IDEOGRAPH
+0xED5B 0x501E  #CJK UNIFIED IDEOGRAPH
+0xED5C 0x5046  #CJK UNIFIED IDEOGRAPH
+0xED5D 0x5070  #CJK UNIFIED IDEOGRAPH
+0xED5E 0x5042  #CJK UNIFIED IDEOGRAPH
+0xED5F 0x5094  #CJK UNIFIED IDEOGRAPH
+0xED60 0x50F4  #CJK UNIFIED IDEOGRAPH
+0xED61 0x50D8  #CJK UNIFIED IDEOGRAPH
+0xED62 0x514A  #CJK UNIFIED IDEOGRAPH
+0xED63 0x5164  #CJK UNIFIED IDEOGRAPH
+0xED64 0x519D  #CJK UNIFIED IDEOGRAPH
+0xED65 0x51BE  #CJK UNIFIED IDEOGRAPH
+0xED66 0x51EC  #CJK UNIFIED IDEOGRAPH
+0xED67 0x5215  #CJK UNIFIED IDEOGRAPH
+0xED68 0x529C  #CJK UNIFIED IDEOGRAPH
+0xED69 0x52A6  #CJK UNIFIED IDEOGRAPH
+0xED6A 0x52C0  #CJK UNIFIED IDEOGRAPH
+0xED6B 0x52DB  #CJK UNIFIED IDEOGRAPH
+0xED6C 0x5300  #CJK UNIFIED IDEOGRAPH
+0xED6D 0x5307  #CJK UNIFIED IDEOGRAPH
+0xED6E 0x5324  #CJK UNIFIED IDEOGRAPH
+0xED6F 0x5372  #CJK UNIFIED IDEOGRAPH
+0xED70 0x5393  #CJK UNIFIED IDEOGRAPH
+0xED71 0x53B2  #CJK UNIFIED IDEOGRAPH
+0xED72 0x53DD  #CJK UNIFIED IDEOGRAPH
+0xED73 0xFA0E  #CJK COMPATIBILITY IDEOGRAPH
+0xED74 0x549C  #CJK UNIFIED IDEOGRAPH
+0xED75 0x548A  #CJK UNIFIED IDEOGRAPH
+0xED76 0x54A9  #CJK UNIFIED IDEOGRAPH
+0xED77 0x54FF  #CJK UNIFIED IDEOGRAPH
+0xED78 0x5586  #CJK UNIFIED IDEOGRAPH
+0xED79 0x5759  #CJK UNIFIED IDEOGRAPH
+0xED7A 0x5765  #CJK UNIFIED IDEOGRAPH
+0xED7B 0x57AC  #CJK UNIFIED IDEOGRAPH
+0xED7C 0x57C8  #CJK UNIFIED IDEOGRAPH
+0xED7D 0x57C7  #CJK UNIFIED IDEOGRAPH
+0xED7E 0xFA0F  #CJK COMPATIBILITY IDEOGRAPH
+0xED80 0xFA10  #CJK COMPATIBILITY IDEOGRAPH
+0xED81 0x589E  #CJK UNIFIED IDEOGRAPH
+0xED82 0x58B2  #CJK UNIFIED IDEOGRAPH
+0xED83 0x590B  #CJK UNIFIED IDEOGRAPH
+0xED84 0x5953  #CJK UNIFIED IDEOGRAPH
+0xED85 0x595B  #CJK UNIFIED IDEOGRAPH
+0xED86 0x595D  #CJK UNIFIED IDEOGRAPH
+0xED87 0x5963  #CJK UNIFIED IDEOGRAPH
+0xED88 0x59A4  #CJK UNIFIED IDEOGRAPH
+0xED89 0x59BA  #CJK UNIFIED IDEOGRAPH
+0xED8A 0x5B56  #CJK UNIFIED IDEOGRAPH
+0xED8B 0x5BC0  #CJK UNIFIED IDEOGRAPH
+0xED8C 0x752F  #CJK UNIFIED IDEOGRAPH
+0xED8D 0x5BD8  #CJK UNIFIED IDEOGRAPH
+0xED8E 0x5BEC  #CJK UNIFIED IDEOGRAPH
+0xED8F 0x5C1E  #CJK UNIFIED IDEOGRAPH
+0xED90 0x5CA6  #CJK UNIFIED IDEOGRAPH
+0xED91 0x5CBA  #CJK UNIFIED IDEOGRAPH
+0xED92 0x5CF5  #CJK UNIFIED IDEOGRAPH
+0xED93 0x5D27  #CJK UNIFIED IDEOGRAPH
+0xED94 0x5D53  #CJK UNIFIED IDEOGRAPH
+0xED95 0xFA11  #CJK COMPATIBILITY IDEOGRAPH
+0xED96 0x5D42  #CJK UNIFIED IDEOGRAPH
+0xED97 0x5D6D  #CJK UNIFIED IDEOGRAPH
+0xED98 0x5DB8  #CJK UNIFIED IDEOGRAPH
+0xED99 0x5DB9  #CJK UNIFIED IDEOGRAPH
+0xED9A 0x5DD0  #CJK UNIFIED IDEOGRAPH
+0xED9B 0x5F21  #CJK UNIFIED IDEOGRAPH
+0xED9C 0x5F34  #CJK UNIFIED IDEOGRAPH
+0xED9D 0x5F67  #CJK UNIFIED IDEOGRAPH
+0xED9E 0x5FB7  #CJK UNIFIED IDEOGRAPH
+0xED9F 0x5FDE  #CJK UNIFIED IDEOGRAPH
+0xEDA0 0x605D  #CJK UNIFIED IDEOGRAPH
+0xEDA1 0x6085  #CJK UNIFIED IDEOGRAPH
+0xEDA2 0x608A  #CJK UNIFIED IDEOGRAPH
+0xEDA3 0x60DE  #CJK UNIFIED IDEOGRAPH
+0xEDA4 0x60D5  #CJK UNIFIED IDEOGRAPH
+0xEDA5 0x6120  #CJK UNIFIED IDEOGRAPH
+0xEDA6 0x60F2  #CJK UNIFIED IDEOGRAPH
+0xEDA7 0x6111  #CJK UNIFIED IDEOGRAPH
+0xEDA8 0x6137  #CJK UNIFIED IDEOGRAPH
+0xEDA9 0x6130  #CJK UNIFIED IDEOGRAPH
+0xEDAA 0x6198  #CJK UNIFIED IDEOGRAPH
+0xEDAB 0x6213  #CJK UNIFIED IDEOGRAPH
+0xEDAC 0x62A6  #CJK UNIFIED IDEOGRAPH
+0xEDAD 0x63F5  #CJK UNIFIED IDEOGRAPH
+0xEDAE 0x6460  #CJK UNIFIED IDEOGRAPH
+0xEDAF 0x649D  #CJK UNIFIED IDEOGRAPH
+0xEDB0 0x64CE  #CJK UNIFIED IDEOGRAPH
+0xEDB1 0x654E  #CJK UNIFIED IDEOGRAPH
+0xEDB2 0x6600  #CJK UNIFIED IDEOGRAPH
+0xEDB3 0x6615  #CJK UNIFIED IDEOGRAPH
+0xEDB4 0x663B  #CJK UNIFIED IDEOGRAPH
+0xEDB5 0x6609  #CJK UNIFIED IDEOGRAPH
+0xEDB6 0x662E  #CJK UNIFIED IDEOGRAPH
+0xEDB7 0x661E  #CJK UNIFIED IDEOGRAPH
+0xEDB8 0x6624  #CJK UNIFIED IDEOGRAPH
+0xEDB9 0x6665  #CJK UNIFIED IDEOGRAPH
+0xEDBA 0x6657  #CJK UNIFIED IDEOGRAPH
+0xEDBB 0x6659  #CJK UNIFIED IDEOGRAPH
+0xEDBC 0xFA12  #CJK COMPATIBILITY IDEOGRAPH
+0xEDBD 0x6673  #CJK UNIFIED IDEOGRAPH
+0xEDBE 0x6699  #CJK UNIFIED IDEOGRAPH
+0xEDBF 0x66A0  #CJK UNIFIED IDEOGRAPH
+0xEDC0 0x66B2  #CJK UNIFIED IDEOGRAPH
+0xEDC1 0x66BF  #CJK UNIFIED IDEOGRAPH
+0xEDC2 0x66FA  #CJK UNIFIED IDEOGRAPH
+0xEDC3 0x670E  #CJK UNIFIED IDEOGRAPH
+0xEDC4 0xF929  #CJK COMPATIBILITY IDEOGRAPH
+0xEDC5 0x6766  #CJK UNIFIED IDEOGRAPH
+0xEDC6 0x67BB  #CJK UNIFIED IDEOGRAPH
+0xEDC7 0x6852  #CJK UNIFIED IDEOGRAPH
+0xEDC8 0x67C0  #CJK UNIFIED IDEOGRAPH
+0xEDC9 0x6801  #CJK UNIFIED IDEOGRAPH
+0xEDCA 0x6844  #CJK UNIFIED IDEOGRAPH
+0xEDCB 0x68CF  #CJK UNIFIED IDEOGRAPH
+0xEDCC 0xFA13  #CJK COMPATIBILITY IDEOGRAPH
+0xEDCD 0x6968  #CJK UNIFIED IDEOGRAPH
+0xEDCE 0xFA14  #CJK COMPATIBILITY IDEOGRAPH
+0xEDCF 0x6998  #CJK UNIFIED IDEOGRAPH
+0xEDD0 0x69E2  #CJK UNIFIED IDEOGRAPH
+0xEDD1 0x6A30  #CJK UNIFIED IDEOGRAPH
+0xEDD2 0x6A6B  #CJK UNIFIED IDEOGRAPH
+0xEDD3 0x6A46  #CJK UNIFIED IDEOGRAPH
+0xEDD4 0x6A73  #CJK UNIFIED IDEOGRAPH
+0xEDD5 0x6A7E  #CJK UNIFIED IDEOGRAPH
+0xEDD6 0x6AE2  #CJK UNIFIED IDEOGRAPH
+0xEDD7 0x6AE4  #CJK UNIFIED IDEOGRAPH
+0xEDD8 0x6BD6  #CJK UNIFIED IDEOGRAPH
+0xEDD9 0x6C3F  #CJK UNIFIED IDEOGRAPH
+0xEDDA 0x6C5C  #CJK UNIFIED IDEOGRAPH
+0xEDDB 0x6C86  #CJK UNIFIED IDEOGRAPH
+0xEDDC 0x6C6F  #CJK UNIFIED IDEOGRAPH
+0xEDDD 0x6CDA  #CJK UNIFIED IDEOGRAPH
+0xEDDE 0x6D04  #CJK UNIFIED IDEOGRAPH
+0xEDDF 0x6D87  #CJK UNIFIED IDEOGRAPH
+0xEDE0 0x6D6F  #CJK UNIFIED IDEOGRAPH
+0xEDE1 0x6D96  #CJK UNIFIED IDEOGRAPH
+0xEDE2 0x6DAC  #CJK UNIFIED IDEOGRAPH
+0xEDE3 0x6DCF  #CJK UNIFIED IDEOGRAPH
+0xEDE4 0x6DF8  #CJK UNIFIED IDEOGRAPH
+0xEDE5 0x6DF2  #CJK UNIFIED IDEOGRAPH
+0xEDE6 0x6DFC  #CJK UNIFIED IDEOGRAPH
+0xEDE7 0x6E39  #CJK UNIFIED IDEOGRAPH
+0xEDE8 0x6E5C  #CJK UNIFIED IDEOGRAPH
+0xEDE9 0x6E27  #CJK UNIFIED IDEOGRAPH
+0xEDEA 0x6E3C  #CJK UNIFIED IDEOGRAPH
+0xEDEB 0x6EBF  #CJK UNIFIED IDEOGRAPH
+0xEDEC 0x6F88  #CJK UNIFIED IDEOGRAPH
+0xEDED 0x6FB5  #CJK UNIFIED IDEOGRAPH
+0xEDEE 0x6FF5  #CJK UNIFIED IDEOGRAPH
+0xEDEF 0x7005  #CJK UNIFIED IDEOGRAPH
+0xEDF0 0x7007  #CJK UNIFIED IDEOGRAPH
+0xEDF1 0x7028  #CJK UNIFIED IDEOGRAPH
+0xEDF2 0x7085  #CJK UNIFIED IDEOGRAPH
+0xEDF3 0x70AB  #CJK UNIFIED IDEOGRAPH
+0xEDF4 0x710F  #CJK UNIFIED IDEOGRAPH
+0xEDF5 0x7104  #CJK UNIFIED IDEOGRAPH
+0xEDF6 0x715C  #CJK UNIFIED IDEOGRAPH
+0xEDF7 0x7146  #CJK UNIFIED IDEOGRAPH
+0xEDF8 0x7147  #CJK UNIFIED IDEOGRAPH
+0xEDF9 0xFA15  #CJK COMPATIBILITY IDEOGRAPH
+0xEDFA 0x71C1  #CJK UNIFIED IDEOGRAPH
+0xEDFB 0x71FE  #CJK UNIFIED IDEOGRAPH
+0xEDFC 0x72B1  #CJK UNIFIED IDEOGRAPH
+0xEE40 0x72BE  #CJK UNIFIED IDEOGRAPH
+0xEE41 0x7324  #CJK UNIFIED IDEOGRAPH
+0xEE42 0xFA16  #CJK COMPATIBILITY IDEOGRAPH
+0xEE43 0x7377  #CJK UNIFIED IDEOGRAPH
+0xEE44 0x73BD  #CJK UNIFIED IDEOGRAPH
+0xEE45 0x73C9  #CJK UNIFIED IDEOGRAPH
+0xEE46 0x73D6  #CJK UNIFIED IDEOGRAPH
+0xEE47 0x73E3  #CJK UNIFIED IDEOGRAPH
+0xEE48 0x73D2  #CJK UNIFIED IDEOGRAPH
+0xEE49 0x7407  #CJK UNIFIED IDEOGRAPH
+0xEE4A 0x73F5  #CJK UNIFIED IDEOGRAPH
+0xEE4B 0x7426  #CJK UNIFIED IDEOGRAPH
+0xEE4C 0x742A  #CJK UNIFIED IDEOGRAPH
+0xEE4D 0x7429  #CJK UNIFIED IDEOGRAPH
+0xEE4E 0x742E  #CJK UNIFIED IDEOGRAPH
+0xEE4F 0x7462  #CJK UNIFIED IDEOGRAPH
+0xEE50 0x7489  #CJK UNIFIED IDEOGRAPH
+0xEE51 0x749F  #CJK UNIFIED IDEOGRAPH
+0xEE52 0x7501  #CJK UNIFIED IDEOGRAPH
+0xEE53 0x756F  #CJK UNIFIED IDEOGRAPH
+0xEE54 0x7682  #CJK UNIFIED IDEOGRAPH
+0xEE55 0x769C  #CJK UNIFIED IDEOGRAPH
+0xEE56 0x769E  #CJK UNIFIED IDEOGRAPH
+0xEE57 0x769B  #CJK UNIFIED IDEOGRAPH
+0xEE58 0x76A6  #CJK UNIFIED IDEOGRAPH
+0xEE59 0xFA17  #CJK COMPATIBILITY IDEOGRAPH
+0xEE5A 0x7746  #CJK UNIFIED IDEOGRAPH
+0xEE5B 0x52AF  #CJK UNIFIED IDEOGRAPH
+0xEE5C 0x7821  #CJK UNIFIED IDEOGRAPH
+0xEE5D 0x784E  #CJK UNIFIED IDEOGRAPH
+0xEE5E 0x7864  #CJK UNIFIED IDEOGRAPH
+0xEE5F 0x787A  #CJK UNIFIED IDEOGRAPH
+0xEE60 0x7930  #CJK UNIFIED IDEOGRAPH
+0xEE61 0xFA18  #CJK COMPATIBILITY IDEOGRAPH
+0xEE62 0xFA19  #CJK COMPATIBILITY IDEOGRAPH
+0xEE63 0xFA1A  #CJK COMPATIBILITY IDEOGRAPH
+0xEE64 0x7994  #CJK UNIFIED IDEOGRAPH
+0xEE65 0xFA1B  #CJK COMPATIBILITY IDEOGRAPH
+0xEE66 0x799B  #CJK UNIFIED IDEOGRAPH
+0xEE67 0x7AD1  #CJK UNIFIED IDEOGRAPH
+0xEE68 0x7AE7  #CJK UNIFIED IDEOGRAPH
+0xEE69 0xFA1C  #CJK COMPATIBILITY IDEOGRAPH
+0xEE6A 0x7AEB  #CJK UNIFIED IDEOGRAPH
+0xEE6B 0x7B9E  #CJK UNIFIED IDEOGRAPH
+0xEE6C 0xFA1D  #CJK COMPATIBILITY IDEOGRAPH
+0xEE6D 0x7D48  #CJK UNIFIED IDEOGRAPH
+0xEE6E 0x7D5C  #CJK UNIFIED IDEOGRAPH
+0xEE6F 0x7DB7  #CJK UNIFIED IDEOGRAPH
+0xEE70 0x7DA0  #CJK UNIFIED IDEOGRAPH
+0xEE71 0x7DD6  #CJK UNIFIED IDEOGRAPH
+0xEE72 0x7E52  #CJK UNIFIED IDEOGRAPH
+0xEE73 0x7F47  #CJK UNIFIED IDEOGRAPH
+0xEE74 0x7FA1  #CJK UNIFIED IDEOGRAPH
+0xEE75 0xFA1E  #CJK COMPATIBILITY IDEOGRAPH
+0xEE76 0x8301  #CJK UNIFIED IDEOGRAPH
+0xEE77 0x8362  #CJK UNIFIED IDEOGRAPH
+0xEE78 0x837F  #CJK UNIFIED IDEOGRAPH
+0xEE79 0x83C7  #CJK UNIFIED IDEOGRAPH
+0xEE7A 0x83F6  #CJK UNIFIED IDEOGRAPH
+0xEE7B 0x8448  #CJK UNIFIED IDEOGRAPH
+0xEE7C 0x84B4  #CJK UNIFIED IDEOGRAPH
+0xEE7D 0x8553  #CJK UNIFIED IDEOGRAPH
+0xEE7E 0x8559  #CJK UNIFIED IDEOGRAPH
+0xEE80 0x856B  #CJK UNIFIED IDEOGRAPH
+0xEE81 0xFA1F  #CJK COMPATIBILITY IDEOGRAPH
+0xEE82 0x85B0  #CJK UNIFIED IDEOGRAPH
+0xEE83 0xFA20  #CJK COMPATIBILITY IDEOGRAPH
+0xEE84 0xFA21  #CJK COMPATIBILITY IDEOGRAPH
+0xEE85 0x8807  #CJK UNIFIED IDEOGRAPH
+0xEE86 0x88F5  #CJK UNIFIED IDEOGRAPH
+0xEE87 0x8A12  #CJK UNIFIED IDEOGRAPH
+0xEE88 0x8A37  #CJK UNIFIED IDEOGRAPH
+0xEE89 0x8A79  #CJK UNIFIED IDEOGRAPH
+0xEE8A 0x8AA7  #CJK UNIFIED IDEOGRAPH
+0xEE8B 0x8ABE  #CJK UNIFIED IDEOGRAPH
+0xEE8C 0x8ADF  #CJK UNIFIED IDEOGRAPH
+0xEE8D 0xFA22  #CJK COMPATIBILITY IDEOGRAPH
+0xEE8E 0x8AF6  #CJK UNIFIED IDEOGRAPH
+0xEE8F 0x8B53  #CJK UNIFIED IDEOGRAPH
+0xEE90 0x8B7F  #CJK UNIFIED IDEOGRAPH
+0xEE91 0x8CF0  #CJK UNIFIED IDEOGRAPH
+0xEE92 0x8CF4  #CJK UNIFIED IDEOGRAPH
+0xEE93 0x8D12  #CJK UNIFIED IDEOGRAPH
+0xEE94 0x8D76  #CJK UNIFIED IDEOGRAPH
+0xEE95 0xFA23  #CJK COMPATIBILITY IDEOGRAPH
+0xEE96 0x8ECF  #CJK UNIFIED IDEOGRAPH
+0xEE97 0xFA24  #CJK COMPATIBILITY IDEOGRAPH
+0xEE98 0xFA25  #CJK COMPATIBILITY IDEOGRAPH
+0xEE99 0x9067  #CJK UNIFIED IDEOGRAPH
+0xEE9A 0x90DE  #CJK UNIFIED IDEOGRAPH
+0xEE9B 0xFA26  #CJK COMPATIBILITY IDEOGRAPH
+0xEE9C 0x9115  #CJK UNIFIED IDEOGRAPH
+0xEE9D 0x9127  #CJK UNIFIED IDEOGRAPH
+0xEE9E 0x91DA  #CJK UNIFIED IDEOGRAPH
+0xEE9F 0x91D7  #CJK UNIFIED IDEOGRAPH
+0xEEA0 0x91DE  #CJK UNIFIED IDEOGRAPH
+0xEEA1 0x91ED  #CJK UNIFIED IDEOGRAPH
+0xEEA2 0x91EE  #CJK UNIFIED IDEOGRAPH
+0xEEA3 0x91E4  #CJK UNIFIED IDEOGRAPH
+0xEEA4 0x91E5  #CJK UNIFIED IDEOGRAPH
+0xEEA5 0x9206  #CJK UNIFIED IDEOGRAPH
+0xEEA6 0x9210  #CJK UNIFIED IDEOGRAPH
+0xEEA7 0x920A  #CJK UNIFIED IDEOGRAPH
+0xEEA8 0x923A  #CJK UNIFIED IDEOGRAPH
+0xEEA9 0x9240  #CJK UNIFIED IDEOGRAPH
+0xEEAA 0x923C  #CJK UNIFIED IDEOGRAPH
+0xEEAB 0x924E  #CJK UNIFIED IDEOGRAPH
+0xEEAC 0x9259  #CJK UNIFIED IDEOGRAPH
+0xEEAD 0x9251  #CJK UNIFIED IDEOGRAPH
+0xEEAE 0x9239  #CJK UNIFIED IDEOGRAPH
+0xEEAF 0x9267  #CJK UNIFIED IDEOGRAPH
+0xEEB0 0x92A7  #CJK UNIFIED IDEOGRAPH
+0xEEB1 0x9277  #CJK UNIFIED IDEOGRAPH
+0xEEB2 0x9278  #CJK UNIFIED IDEOGRAPH
+0xEEB3 0x92E7  #CJK UNIFIED IDEOGRAPH
+0xEEB4 0x92D7  #CJK UNIFIED IDEOGRAPH
+0xEEB5 0x92D9  #CJK UNIFIED IDEOGRAPH
+0xEEB6 0x92D0  #CJK UNIFIED IDEOGRAPH
+0xEEB7 0xFA27  #CJK COMPATIBILITY IDEOGRAPH
+0xEEB8 0x92D5  #CJK UNIFIED IDEOGRAPH
+0xEEB9 0x92E0  #CJK UNIFIED IDEOGRAPH
+0xEEBA 0x92D3  #CJK UNIFIED IDEOGRAPH
+0xEEBB 0x9325  #CJK UNIFIED IDEOGRAPH
+0xEEBC 0x9321  #CJK UNIFIED IDEOGRAPH
+0xEEBD 0x92FB  #CJK UNIFIED IDEOGRAPH
+0xEEBE 0xFA28  #CJK COMPATIBILITY IDEOGRAPH
+0xEEBF 0x931E  #CJK UNIFIED IDEOGRAPH
+0xEEC0 0x92FF  #CJK UNIFIED IDEOGRAPH
+0xEEC1 0x931D  #CJK UNIFIED IDEOGRAPH
+0xEEC2 0x9302  #CJK UNIFIED IDEOGRAPH
+0xEEC3 0x9370  #CJK UNIFIED IDEOGRAPH
+0xEEC4 0x9357  #CJK UNIFIED IDEOGRAPH
+0xEEC5 0x93A4  #CJK UNIFIED IDEOGRAPH
+0xEEC6 0x93C6  #CJK UNIFIED IDEOGRAPH
+0xEEC7 0x93DE  #CJK UNIFIED IDEOGRAPH
+0xEEC8 0x93F8  #CJK UNIFIED IDEOGRAPH
+0xEEC9 0x9431  #CJK UNIFIED IDEOGRAPH
+0xEECA 0x9445  #CJK UNIFIED IDEOGRAPH
+0xEECB 0x9448  #CJK UNIFIED IDEOGRAPH
+0xEECC 0x9592  #CJK UNIFIED IDEOGRAPH
+0xEECD 0xF9DC  #CJK COMPATIBILITY IDEOGRAPH
+0xEECE 0xFA29  #CJK COMPATIBILITY IDEOGRAPH
+0xEECF 0x969D  #CJK UNIFIED IDEOGRAPH
+0xEED0 0x96AF  #CJK UNIFIED IDEOGRAPH
+0xEED1 0x9733  #CJK UNIFIED IDEOGRAPH
+0xEED2 0x973B  #CJK UNIFIED IDEOGRAPH
+0xEED3 0x9743  #CJK UNIFIED IDEOGRAPH
+0xEED4 0x974D  #CJK UNIFIED IDEOGRAPH
+0xEED5 0x974F  #CJK UNIFIED IDEOGRAPH
+0xEED6 0x9751  #CJK UNIFIED IDEOGRAPH
+0xEED7 0x9755  #CJK UNIFIED IDEOGRAPH
+0xEED8 0x9857  #CJK UNIFIED IDEOGRAPH
+0xEED9 0x9865  #CJK UNIFIED IDEOGRAPH
+0xEEDA 0xFA2A  #CJK COMPATIBILITY IDEOGRAPH
+0xEEDB 0xFA2B  #CJK COMPATIBILITY IDEOGRAPH
+0xEEDC 0x9927  #CJK UNIFIED IDEOGRAPH
+0xEEDD 0xFA2C  #CJK COMPATIBILITY IDEOGRAPH
+0xEEDE 0x999E  #CJK UNIFIED IDEOGRAPH
+0xEEDF 0x9A4E  #CJK UNIFIED IDEOGRAPH
+0xEEE0 0x9AD9  #CJK UNIFIED IDEOGRAPH
+0xEEE1 0x9ADC  #CJK UNIFIED IDEOGRAPH
+0xEEE2 0x9B75  #CJK UNIFIED IDEOGRAPH
+0xEEE3 0x9B72  #CJK UNIFIED IDEOGRAPH
+0xEEE4 0x9B8F  #CJK UNIFIED IDEOGRAPH
+0xEEE5 0x9BB1  #CJK UNIFIED IDEOGRAPH
+0xEEE6 0x9BBB  #CJK UNIFIED IDEOGRAPH
+0xEEE7 0x9C00  #CJK UNIFIED IDEOGRAPH
+0xEEE8 0x9D70  #CJK UNIFIED IDEOGRAPH
+0xEEE9 0x9D6B  #CJK UNIFIED IDEOGRAPH
+0xEEEA 0xFA2D  #CJK COMPATIBILITY IDEOGRAPH
+0xEEEB 0x9E19  #CJK UNIFIED IDEOGRAPH
+0xEEEC 0x9ED1  #CJK UNIFIED IDEOGRAPH
+0xEEEF 0x2170  #SMALL ROMAN NUMERAL ONE
+0xEEF0 0x2171  #SMALL ROMAN NUMERAL TWO
+0xEEF1 0x2172  #SMALL ROMAN NUMERAL THREE
+0xEEF2 0x2173  #SMALL ROMAN NUMERAL FOUR
+0xEEF3 0x2174  #SMALL ROMAN NUMERAL FIVE
+0xEEF4 0x2175  #SMALL ROMAN NUMERAL SIX
+0xEEF5 0x2176  #SMALL ROMAN NUMERAL SEVEN
+0xEEF6 0x2177  #SMALL ROMAN NUMERAL EIGHT
+0xEEF7 0x2178  #SMALL ROMAN NUMERAL NINE
+0xEEF8 0x2179  #SMALL ROMAN NUMERAL TEN
+0xEEF9 0xFFE2  #FULLWIDTH NOT SIGN
+0xEEFA 0xFFE4  #FULLWIDTH BROKEN BAR
+0xEEFB 0xFF07  #FULLWIDTH APOSTROPHE
+0xEEFC 0xFF02  #FULLWIDTH QUOTATION MARK
+0xFA40 0x2170  #SMALL ROMAN NUMERAL ONE
+0xFA41 0x2171  #SMALL ROMAN NUMERAL TWO
+0xFA42 0x2172  #SMALL ROMAN NUMERAL THREE
+0xFA43 0x2173  #SMALL ROMAN NUMERAL FOUR
+0xFA44 0x2174  #SMALL ROMAN NUMERAL FIVE
+0xFA45 0x2175  #SMALL ROMAN NUMERAL SIX
+0xFA46 0x2176  #SMALL ROMAN NUMERAL SEVEN
+0xFA47 0x2177  #SMALL ROMAN NUMERAL EIGHT
+0xFA48 0x2178  #SMALL ROMAN NUMERAL NINE
+0xFA49 0x2179  #SMALL ROMAN NUMERAL TEN
+0xFA4A 0x2160  #ROMAN NUMERAL ONE
+0xFA4B 0x2161  #ROMAN NUMERAL TWO
+0xFA4C 0x2162  #ROMAN NUMERAL THREE
+0xFA4D 0x2163  #ROMAN NUMERAL FOUR
+0xFA4E 0x2164  #ROMAN NUMERAL FIVE
+0xFA4F 0x2165  #ROMAN NUMERAL SIX
+0xFA50 0x2166  #ROMAN NUMERAL SEVEN
+0xFA51 0x2167  #ROMAN NUMERAL EIGHT
+0xFA52 0x2168  #ROMAN NUMERAL NINE
+0xFA53 0x2169  #ROMAN NUMERAL TEN
+0xFA54 0xFFE2  #FULLWIDTH NOT SIGN
+0xFA55 0xFFE4  #FULLWIDTH BROKEN BAR
+0xFA56 0xFF07  #FULLWIDTH APOSTROPHE
+0xFA57 0xFF02  #FULLWIDTH QUOTATION MARK
+0xFA58 0x3231  #PARENTHESIZED IDEOGRAPH STOCK
+0xFA59 0x2116  #NUMERO SIGN
+0xFA5A 0x2121  #TELEPHONE SIGN
+0xFA5B 0x2235  #BECAUSE
+0xFA5C 0x7E8A  #CJK UNIFIED IDEOGRAPH
+0xFA5D 0x891C  #CJK UNIFIED IDEOGRAPH
+0xFA5E 0x9348  #CJK UNIFIED IDEOGRAPH
+0xFA5F 0x9288  #CJK UNIFIED IDEOGRAPH
+0xFA60 0x84DC  #CJK UNIFIED IDEOGRAPH
+0xFA61 0x4FC9  #CJK UNIFIED IDEOGRAPH
+0xFA62 0x70BB  #CJK UNIFIED IDEOGRAPH
+0xFA63 0x6631  #CJK UNIFIED IDEOGRAPH
+0xFA64 0x68C8  #CJK UNIFIED IDEOGRAPH
+0xFA65 0x92F9  #CJK UNIFIED IDEOGRAPH
+0xFA66 0x66FB  #CJK UNIFIED IDEOGRAPH
+0xFA67 0x5F45  #CJK UNIFIED IDEOGRAPH
+0xFA68 0x4E28  #CJK UNIFIED IDEOGRAPH
+0xFA69 0x4EE1  #CJK UNIFIED IDEOGRAPH
+0xFA6A 0x4EFC  #CJK UNIFIED IDEOGRAPH
+0xFA6B 0x4F00  #CJK UNIFIED IDEOGRAPH
+0xFA6C 0x4F03  #CJK UNIFIED IDEOGRAPH
+0xFA6D 0x4F39  #CJK UNIFIED IDEOGRAPH
+0xFA6E 0x4F56  #CJK UNIFIED IDEOGRAPH
+0xFA6F 0x4F92  #CJK UNIFIED IDEOGRAPH
+0xFA70 0x4F8A  #CJK UNIFIED IDEOGRAPH
+0xFA71 0x4F9A  #CJK UNIFIED IDEOGRAPH
+0xFA72 0x4F94  #CJK UNIFIED IDEOGRAPH
+0xFA73 0x4FCD  #CJK UNIFIED IDEOGRAPH
+0xFA74 0x5040  #CJK UNIFIED IDEOGRAPH
+0xFA75 0x5022  #CJK UNIFIED IDEOGRAPH
+0xFA76 0x4FFF  #CJK UNIFIED IDEOGRAPH
+0xFA77 0x501E  #CJK UNIFIED IDEOGRAPH
+0xFA78 0x5046  #CJK UNIFIED IDEOGRAPH
+0xFA79 0x5070  #CJK UNIFIED IDEOGRAPH
+0xFA7A 0x5042  #CJK UNIFIED IDEOGRAPH
+0xFA7B 0x5094  #CJK UNIFIED IDEOGRAPH
+0xFA7C 0x50F4  #CJK UNIFIED IDEOGRAPH
+0xFA7D 0x50D8  #CJK UNIFIED IDEOGRAPH
+0xFA7E 0x514A  #CJK UNIFIED IDEOGRAPH
+0xFA80 0x5164  #CJK UNIFIED IDEOGRAPH
+0xFA81 0x519D  #CJK UNIFIED IDEOGRAPH
+0xFA82 0x51BE  #CJK UNIFIED IDEOGRAPH
+0xFA83 0x51EC  #CJK UNIFIED IDEOGRAPH
+0xFA84 0x5215  #CJK UNIFIED IDEOGRAPH
+0xFA85 0x529C  #CJK UNIFIED IDEOGRAPH
+0xFA86 0x52A6  #CJK UNIFIED IDEOGRAPH
+0xFA87 0x52C0  #CJK UNIFIED IDEOGRAPH
+0xFA88 0x52DB  #CJK UNIFIED IDEOGRAPH
+0xFA89 0x5300  #CJK UNIFIED IDEOGRAPH
+0xFA8A 0x5307  #CJK UNIFIED IDEOGRAPH
+0xFA8B 0x5324  #CJK UNIFIED IDEOGRAPH
+0xFA8C 0x5372  #CJK UNIFIED IDEOGRAPH
+0xFA8D 0x5393  #CJK UNIFIED IDEOGRAPH
+0xFA8E 0x53B2  #CJK UNIFIED IDEOGRAPH
+0xFA8F 0x53DD  #CJK UNIFIED IDEOGRAPH
+0xFA90 0xFA0E  #CJK COMPATIBILITY IDEOGRAPH
+0xFA91 0x549C  #CJK UNIFIED IDEOGRAPH
+0xFA92 0x548A  #CJK UNIFIED IDEOGRAPH
+0xFA93 0x54A9  #CJK UNIFIED IDEOGRAPH
+0xFA94 0x54FF  #CJK UNIFIED IDEOGRAPH
+0xFA95 0x5586  #CJK UNIFIED IDEOGRAPH
+0xFA96 0x5759  #CJK UNIFIED IDEOGRAPH
+0xFA97 0x5765  #CJK UNIFIED IDEOGRAPH
+0xFA98 0x57AC  #CJK UNIFIED IDEOGRAPH
+0xFA99 0x57C8  #CJK UNIFIED IDEOGRAPH
+0xFA9A 0x57C7  #CJK UNIFIED IDEOGRAPH
+0xFA9B 0xFA0F  #CJK COMPATIBILITY IDEOGRAPH
+0xFA9C 0xFA10  #CJK COMPATIBILITY IDEOGRAPH
+0xFA9D 0x589E  #CJK UNIFIED IDEOGRAPH
+0xFA9E 0x58B2  #CJK UNIFIED IDEOGRAPH
+0xFA9F 0x590B  #CJK UNIFIED IDEOGRAPH
+0xFAA0 0x5953  #CJK UNIFIED IDEOGRAPH
+0xFAA1 0x595B  #CJK UNIFIED IDEOGRAPH
+0xFAA2 0x595D  #CJK UNIFIED IDEOGRAPH
+0xFAA3 0x5963  #CJK UNIFIED IDEOGRAPH
+0xFAA4 0x59A4  #CJK UNIFIED IDEOGRAPH
+0xFAA5 0x59BA  #CJK UNIFIED IDEOGRAPH
+0xFAA6 0x5B56  #CJK UNIFIED IDEOGRAPH
+0xFAA7 0x5BC0  #CJK UNIFIED IDEOGRAPH
+0xFAA8 0x752F  #CJK UNIFIED IDEOGRAPH
+0xFAA9 0x5BD8  #CJK UNIFIED IDEOGRAPH
+0xFAAA 0x5BEC  #CJK UNIFIED IDEOGRAPH
+0xFAAB 0x5C1E  #CJK UNIFIED IDEOGRAPH
+0xFAAC 0x5CA6  #CJK UNIFIED IDEOGRAPH
+0xFAAD 0x5CBA  #CJK UNIFIED IDEOGRAPH
+0xFAAE 0x5CF5  #CJK UNIFIED IDEOGRAPH
+0xFAAF 0x5D27  #CJK UNIFIED IDEOGRAPH
+0xFAB0 0x5D53  #CJK UNIFIED IDEOGRAPH
+0xFAB1 0xFA11  #CJK COMPATIBILITY IDEOGRAPH
+0xFAB2 0x5D42  #CJK UNIFIED IDEOGRAPH
+0xFAB3 0x5D6D  #CJK UNIFIED IDEOGRAPH
+0xFAB4 0x5DB8  #CJK UNIFIED IDEOGRAPH
+0xFAB5 0x5DB9  #CJK UNIFIED IDEOGRAPH
+0xFAB6 0x5DD0  #CJK UNIFIED IDEOGRAPH
+0xFAB7 0x5F21  #CJK UNIFIED IDEOGRAPH
+0xFAB8 0x5F34  #CJK UNIFIED IDEOGRAPH
+0xFAB9 0x5F67  #CJK UNIFIED IDEOGRAPH
+0xFABA 0x5FB7  #CJK UNIFIED IDEOGRAPH
+0xFABB 0x5FDE  #CJK UNIFIED IDEOGRAPH
+0xFABC 0x605D  #CJK UNIFIED IDEOGRAPH
+0xFABD 0x6085  #CJK UNIFIED IDEOGRAPH
+0xFABE 0x608A  #CJK UNIFIED IDEOGRAPH
+0xFABF 0x60DE  #CJK UNIFIED IDEOGRAPH
+0xFAC0 0x60D5  #CJK UNIFIED IDEOGRAPH
+0xFAC1 0x6120  #CJK UNIFIED IDEOGRAPH
+0xFAC2 0x60F2  #CJK UNIFIED IDEOGRAPH
+0xFAC3 0x6111  #CJK UNIFIED IDEOGRAPH
+0xFAC4 0x6137  #CJK UNIFIED IDEOGRAPH
+0xFAC5 0x6130  #CJK UNIFIED IDEOGRAPH
+0xFAC6 0x6198  #CJK UNIFIED IDEOGRAPH
+0xFAC7 0x6213  #CJK UNIFIED IDEOGRAPH
+0xFAC8 0x62A6  #CJK UNIFIED IDEOGRAPH
+0xFAC9 0x63F5  #CJK UNIFIED IDEOGRAPH
+0xFACA 0x6460  #CJK UNIFIED IDEOGRAPH
+0xFACB 0x649D  #CJK UNIFIED IDEOGRAPH
+0xFACC 0x64CE  #CJK UNIFIED IDEOGRAPH
+0xFACD 0x654E  #CJK UNIFIED IDEOGRAPH
+0xFACE 0x6600  #CJK UNIFIED IDEOGRAPH
+0xFACF 0x6615  #CJK UNIFIED IDEOGRAPH
+0xFAD0 0x663B  #CJK UNIFIED IDEOGRAPH
+0xFAD1 0x6609  #CJK UNIFIED IDEOGRAPH
+0xFAD2 0x662E  #CJK UNIFIED IDEOGRAPH
+0xFAD3 0x661E  #CJK UNIFIED IDEOGRAPH
+0xFAD4 0x6624  #CJK UNIFIED IDEOGRAPH
+0xFAD5 0x6665  #CJK UNIFIED IDEOGRAPH
+0xFAD6 0x6657  #CJK UNIFIED IDEOGRAPH
+0xFAD7 0x6659  #CJK UNIFIED IDEOGRAPH
+0xFAD8 0xFA12  #CJK COMPATIBILITY IDEOGRAPH
+0xFAD9 0x6673  #CJK UNIFIED IDEOGRAPH
+0xFADA 0x6699  #CJK UNIFIED IDEOGRAPH
+0xFADB 0x66A0  #CJK UNIFIED IDEOGRAPH
+0xFADC 0x66B2  #CJK UNIFIED IDEOGRAPH
+0xFADD 0x66BF  #CJK UNIFIED IDEOGRAPH
+0xFADE 0x66FA  #CJK UNIFIED IDEOGRAPH
+0xFADF 0x670E  #CJK UNIFIED IDEOGRAPH
+0xFAE0 0xF929  #CJK COMPATIBILITY IDEOGRAPH
+0xFAE1 0x6766  #CJK UNIFIED IDEOGRAPH
+0xFAE2 0x67BB  #CJK UNIFIED IDEOGRAPH
+0xFAE3 0x6852  #CJK UNIFIED IDEOGRAPH
+0xFAE4 0x67C0  #CJK UNIFIED IDEOGRAPH
+0xFAE5 0x6801  #CJK UNIFIED IDEOGRAPH
+0xFAE6 0x6844  #CJK UNIFIED IDEOGRAPH
+0xFAE7 0x68CF  #CJK UNIFIED IDEOGRAPH
+0xFAE8 0xFA13  #CJK COMPATIBILITY IDEOGRAPH
+0xFAE9 0x6968  #CJK UNIFIED IDEOGRAPH
+0xFAEA 0xFA14  #CJK COMPATIBILITY IDEOGRAPH
+0xFAEB 0x6998  #CJK UNIFIED IDEOGRAPH
+0xFAEC 0x69E2  #CJK UNIFIED IDEOGRAPH
+0xFAED 0x6A30  #CJK UNIFIED IDEOGRAPH
+0xFAEE 0x6A6B  #CJK UNIFIED IDEOGRAPH
+0xFAEF 0x6A46  #CJK UNIFIED IDEOGRAPH
+0xFAF0 0x6A73  #CJK UNIFIED IDEOGRAPH
+0xFAF1 0x6A7E  #CJK UNIFIED IDEOGRAPH
+0xFAF2 0x6AE2  #CJK UNIFIED IDEOGRAPH
+0xFAF3 0x6AE4  #CJK UNIFIED IDEOGRAPH
+0xFAF4 0x6BD6  #CJK UNIFIED IDEOGRAPH
+0xFAF5 0x6C3F  #CJK UNIFIED IDEOGRAPH
+0xFAF6 0x6C5C  #CJK UNIFIED IDEOGRAPH
+0xFAF7 0x6C86  #CJK UNIFIED IDEOGRAPH
+0xFAF8 0x6C6F  #CJK UNIFIED IDEOGRAPH
+0xFAF9 0x6CDA  #CJK UNIFIED IDEOGRAPH
+0xFAFA 0x6D04  #CJK UNIFIED IDEOGRAPH
+0xFAFB 0x6D87  #CJK UNIFIED IDEOGRAPH
+0xFAFC 0x6D6F  #CJK UNIFIED IDEOGRAPH
+0xFB40 0x6D96  #CJK UNIFIED IDEOGRAPH
+0xFB41 0x6DAC  #CJK UNIFIED IDEOGRAPH
+0xFB42 0x6DCF  #CJK UNIFIED IDEOGRAPH
+0xFB43 0x6DF8  #CJK UNIFIED IDEOGRAPH
+0xFB44 0x6DF2  #CJK UNIFIED IDEOGRAPH
+0xFB45 0x6DFC  #CJK UNIFIED IDEOGRAPH
+0xFB46 0x6E39  #CJK UNIFIED IDEOGRAPH
+0xFB47 0x6E5C  #CJK UNIFIED IDEOGRAPH
+0xFB48 0x6E27  #CJK UNIFIED IDEOGRAPH
+0xFB49 0x6E3C  #CJK UNIFIED IDEOGRAPH
+0xFB4A 0x6EBF  #CJK UNIFIED IDEOGRAPH
+0xFB4B 0x6F88  #CJK UNIFIED IDEOGRAPH
+0xFB4C 0x6FB5  #CJK UNIFIED IDEOGRAPH
+0xFB4D 0x6FF5  #CJK UNIFIED IDEOGRAPH
+0xFB4E 0x7005  #CJK UNIFIED IDEOGRAPH
+0xFB4F 0x7007  #CJK UNIFIED IDEOGRAPH
+0xFB50 0x7028  #CJK UNIFIED IDEOGRAPH
+0xFB51 0x7085  #CJK UNIFIED IDEOGRAPH
+0xFB52 0x70AB  #CJK UNIFIED IDEOGRAPH
+0xFB53 0x710F  #CJK UNIFIED IDEOGRAPH
+0xFB54 0x7104  #CJK UNIFIED IDEOGRAPH
+0xFB55 0x715C  #CJK UNIFIED IDEOGRAPH
+0xFB56 0x7146  #CJK UNIFIED IDEOGRAPH
+0xFB57 0x7147  #CJK UNIFIED IDEOGRAPH
+0xFB58 0xFA15  #CJK COMPATIBILITY IDEOGRAPH
+0xFB59 0x71C1  #CJK UNIFIED IDEOGRAPH
+0xFB5A 0x71FE  #CJK UNIFIED IDEOGRAPH
+0xFB5B 0x72B1  #CJK UNIFIED IDEOGRAPH
+0xFB5C 0x72BE  #CJK UNIFIED IDEOGRAPH
+0xFB5D 0x7324  #CJK UNIFIED IDEOGRAPH
+0xFB5E 0xFA16  #CJK COMPATIBILITY IDEOGRAPH
+0xFB5F 0x7377  #CJK UNIFIED IDEOGRAPH
+0xFB60 0x73BD  #CJK UNIFIED IDEOGRAPH
+0xFB61 0x73C9  #CJK UNIFIED IDEOGRAPH
+0xFB62 0x73D6  #CJK UNIFIED IDEOGRAPH
+0xFB63 0x73E3  #CJK UNIFIED IDEOGRAPH
+0xFB64 0x73D2  #CJK UNIFIED IDEOGRAPH
+0xFB65 0x7407  #CJK UNIFIED IDEOGRAPH
+0xFB66 0x73F5  #CJK UNIFIED IDEOGRAPH
+0xFB67 0x7426  #CJK UNIFIED IDEOGRAPH
+0xFB68 0x742A  #CJK UNIFIED IDEOGRAPH
+0xFB69 0x7429  #CJK UNIFIED IDEOGRAPH
+0xFB6A 0x742E  #CJK UNIFIED IDEOGRAPH
+0xFB6B 0x7462  #CJK UNIFIED IDEOGRAPH
+0xFB6C 0x7489  #CJK UNIFIED IDEOGRAPH
+0xFB6D 0x749F  #CJK UNIFIED IDEOGRAPH
+0xFB6E 0x7501  #CJK UNIFIED IDEOGRAPH
+0xFB6F 0x756F  #CJK UNIFIED IDEOGRAPH
+0xFB70 0x7682  #CJK UNIFIED IDEOGRAPH
+0xFB71 0x769C  #CJK UNIFIED IDEOGRAPH
+0xFB72 0x769E  #CJK UNIFIED IDEOGRAPH
+0xFB73 0x769B  #CJK UNIFIED IDEOGRAPH
+0xFB74 0x76A6  #CJK UNIFIED IDEOGRAPH
+0xFB75 0xFA17  #CJK COMPATIBILITY IDEOGRAPH
+0xFB76 0x7746  #CJK UNIFIED IDEOGRAPH
+0xFB77 0x52AF  #CJK UNIFIED IDEOGRAPH
+0xFB78 0x7821  #CJK UNIFIED IDEOGRAPH
+0xFB79 0x784E  #CJK UNIFIED IDEOGRAPH
+0xFB7A 0x7864  #CJK UNIFIED IDEOGRAPH
+0xFB7B 0x787A  #CJK UNIFIED IDEOGRAPH
+0xFB7C 0x7930  #CJK UNIFIED IDEOGRAPH
+0xFB7D 0xFA18  #CJK COMPATIBILITY IDEOGRAPH
+0xFB7E 0xFA19  #CJK COMPATIBILITY IDEOGRAPH
+0xFB80 0xFA1A  #CJK COMPATIBILITY IDEOGRAPH
+0xFB81 0x7994  #CJK UNIFIED IDEOGRAPH
+0xFB82 0xFA1B  #CJK COMPATIBILITY IDEOGRAPH
+0xFB83 0x799B  #CJK UNIFIED IDEOGRAPH
+0xFB84 0x7AD1  #CJK UNIFIED IDEOGRAPH
+0xFB85 0x7AE7  #CJK UNIFIED IDEOGRAPH
+0xFB86 0xFA1C  #CJK COMPATIBILITY IDEOGRAPH
+0xFB87 0x7AEB  #CJK UNIFIED IDEOGRAPH
+0xFB88 0x7B9E  #CJK UNIFIED IDEOGRAPH
+0xFB89 0xFA1D  #CJK COMPATIBILITY IDEOGRAPH
+0xFB8A 0x7D48  #CJK UNIFIED IDEOGRAPH
+0xFB8B 0x7D5C  #CJK UNIFIED IDEOGRAPH
+0xFB8C 0x7DB7  #CJK UNIFIED IDEOGRAPH
+0xFB8D 0x7DA0  #CJK UNIFIED IDEOGRAPH
+0xFB8E 0x7DD6  #CJK UNIFIED IDEOGRAPH
+0xFB8F 0x7E52  #CJK UNIFIED IDEOGRAPH
+0xFB90 0x7F47  #CJK UNIFIED IDEOGRAPH
+0xFB91 0x7FA1  #CJK UNIFIED IDEOGRAPH
+0xFB92 0xFA1E  #CJK COMPATIBILITY IDEOGRAPH
+0xFB93 0x8301  #CJK UNIFIED IDEOGRAPH
+0xFB94 0x8362  #CJK UNIFIED IDEOGRAPH
+0xFB95 0x837F  #CJK UNIFIED IDEOGRAPH
+0xFB96 0x83C7  #CJK UNIFIED IDEOGRAPH
+0xFB97 0x83F6  #CJK UNIFIED IDEOGRAPH
+0xFB98 0x8448  #CJK UNIFIED IDEOGRAPH
+0xFB99 0x84B4  #CJK UNIFIED IDEOGRAPH
+0xFB9A 0x8553  #CJK UNIFIED IDEOGRAPH
+0xFB9B 0x8559  #CJK UNIFIED IDEOGRAPH
+0xFB9C 0x856B  #CJK UNIFIED IDEOGRAPH
+0xFB9D 0xFA1F  #CJK COMPATIBILITY IDEOGRAPH
+0xFB9E 0x85B0  #CJK UNIFIED IDEOGRAPH
+0xFB9F 0xFA20  #CJK COMPATIBILITY IDEOGRAPH
+0xFBA0 0xFA21  #CJK COMPATIBILITY IDEOGRAPH
+0xFBA1 0x8807  #CJK UNIFIED IDEOGRAPH
+0xFBA2 0x88F5  #CJK UNIFIED IDEOGRAPH
+0xFBA3 0x8A12  #CJK UNIFIED IDEOGRAPH
+0xFBA4 0x8A37  #CJK UNIFIED IDEOGRAPH
+0xFBA5 0x8A79  #CJK UNIFIED IDEOGRAPH
+0xFBA6 0x8AA7  #CJK UNIFIED IDEOGRAPH
+0xFBA7 0x8ABE  #CJK UNIFIED IDEOGRAPH
+0xFBA8 0x8ADF  #CJK UNIFIED IDEOGRAPH
+0xFBA9 0xFA22  #CJK COMPATIBILITY IDEOGRAPH
+0xFBAA 0x8AF6  #CJK UNIFIED IDEOGRAPH
+0xFBAB 0x8B53  #CJK UNIFIED IDEOGRAPH
+0xFBAC 0x8B7F  #CJK UNIFIED IDEOGRAPH
+0xFBAD 0x8CF0  #CJK UNIFIED IDEOGRAPH
+0xFBAE 0x8CF4  #CJK UNIFIED IDEOGRAPH
+0xFBAF 0x8D12  #CJK UNIFIED IDEOGRAPH
+0xFBB0 0x8D76  #CJK UNIFIED IDEOGRAPH
+0xFBB1 0xFA23  #CJK COMPATIBILITY IDEOGRAPH
+0xFBB2 0x8ECF  #CJK UNIFIED IDEOGRAPH
+0xFBB3 0xFA24  #CJK COMPATIBILITY IDEOGRAPH
+0xFBB4 0xFA25  #CJK COMPATIBILITY IDEOGRAPH
+0xFBB5 0x9067  #CJK UNIFIED IDEOGRAPH
+0xFBB6 0x90DE  #CJK UNIFIED IDEOGRAPH
+0xFBB7 0xFA26  #CJK COMPATIBILITY IDEOGRAPH
+0xFBB8 0x9115  #CJK UNIFIED IDEOGRAPH
+0xFBB9 0x9127  #CJK UNIFIED IDEOGRAPH
+0xFBBA 0x91DA  #CJK UNIFIED IDEOGRAPH
+0xFBBB 0x91D7  #CJK UNIFIED IDEOGRAPH
+0xFBBC 0x91DE  #CJK UNIFIED IDEOGRAPH
+0xFBBD 0x91ED  #CJK UNIFIED IDEOGRAPH
+0xFBBE 0x91EE  #CJK UNIFIED IDEOGRAPH
+0xFBBF 0x91E4  #CJK UNIFIED IDEOGRAPH
+0xFBC0 0x91E5  #CJK UNIFIED IDEOGRAPH
+0xFBC1 0x9206  #CJK UNIFIED IDEOGRAPH
+0xFBC2 0x9210  #CJK UNIFIED IDEOGRAPH
+0xFBC3 0x920A  #CJK UNIFIED IDEOGRAPH
+0xFBC4 0x923A  #CJK UNIFIED IDEOGRAPH
+0xFBC5 0x9240  #CJK UNIFIED IDEOGRAPH
+0xFBC6 0x923C  #CJK UNIFIED IDEOGRAPH
+0xFBC7 0x924E  #CJK UNIFIED IDEOGRAPH
+0xFBC8 0x9259  #CJK UNIFIED IDEOGRAPH
+0xFBC9 0x9251  #CJK UNIFIED IDEOGRAPH
+0xFBCA 0x9239  #CJK UNIFIED IDEOGRAPH
+0xFBCB 0x9267  #CJK UNIFIED IDEOGRAPH
+0xFBCC 0x92A7  #CJK UNIFIED IDEOGRAPH
+0xFBCD 0x9277  #CJK UNIFIED IDEOGRAPH
+0xFBCE 0x9278  #CJK UNIFIED IDEOGRAPH
+0xFBCF 0x92E7  #CJK UNIFIED IDEOGRAPH
+0xFBD0 0x92D7  #CJK UNIFIED IDEOGRAPH
+0xFBD1 0x92D9  #CJK UNIFIED IDEOGRAPH
+0xFBD2 0x92D0  #CJK UNIFIED IDEOGRAPH
+0xFBD3 0xFA27  #CJK COMPATIBILITY IDEOGRAPH
+0xFBD4 0x92D5  #CJK UNIFIED IDEOGRAPH
+0xFBD5 0x92E0  #CJK UNIFIED IDEOGRAPH
+0xFBD6 0x92D3  #CJK UNIFIED IDEOGRAPH
+0xFBD7 0x9325  #CJK UNIFIED IDEOGRAPH
+0xFBD8 0x9321  #CJK UNIFIED IDEOGRAPH
+0xFBD9 0x92FB  #CJK UNIFIED IDEOGRAPH
+0xFBDA 0xFA28  #CJK COMPATIBILITY IDEOGRAPH
+0xFBDB 0x931E  #CJK UNIFIED IDEOGRAPH
+0xFBDC 0x92FF  #CJK UNIFIED IDEOGRAPH
+0xFBDD 0x931D  #CJK UNIFIED IDEOGRAPH
+0xFBDE 0x9302  #CJK UNIFIED IDEOGRAPH
+0xFBDF 0x9370  #CJK UNIFIED IDEOGRAPH
+0xFBE0 0x9357  #CJK UNIFIED IDEOGRAPH
+0xFBE1 0x93A4  #CJK UNIFIED IDEOGRAPH
+0xFBE2 0x93C6  #CJK UNIFIED IDEOGRAPH
+0xFBE3 0x93DE  #CJK UNIFIED IDEOGRAPH
+0xFBE4 0x93F8  #CJK UNIFIED IDEOGRAPH
+0xFBE5 0x9431  #CJK UNIFIED IDEOGRAPH
+0xFBE6 0x9445  #CJK UNIFIED IDEOGRAPH
+0xFBE7 0x9448  #CJK UNIFIED IDEOGRAPH
+0xFBE8 0x9592  #CJK UNIFIED IDEOGRAPH
+0xFBE9 0xF9DC  #CJK COMPATIBILITY IDEOGRAPH
+0xFBEA 0xFA29  #CJK COMPATIBILITY IDEOGRAPH
+0xFBEB 0x969D  #CJK UNIFIED IDEOGRAPH
+0xFBEC 0x96AF  #CJK UNIFIED IDEOGRAPH
+0xFBED 0x9733  #CJK UNIFIED IDEOGRAPH
+0xFBEE 0x973B  #CJK UNIFIED IDEOGRAPH
+0xFBEF 0x9743  #CJK UNIFIED IDEOGRAPH
+0xFBF0 0x974D  #CJK UNIFIED IDEOGRAPH
+0xFBF1 0x974F  #CJK UNIFIED IDEOGRAPH
+0xFBF2 0x9751  #CJK UNIFIED IDEOGRAPH
+0xFBF3 0x9755  #CJK UNIFIED IDEOGRAPH
+0xFBF4 0x9857  #CJK UNIFIED IDEOGRAPH
+0xFBF5 0x9865  #CJK UNIFIED IDEOGRAPH
+0xFBF6 0xFA2A  #CJK COMPATIBILITY IDEOGRAPH
+0xFBF7 0xFA2B  #CJK COMPATIBILITY IDEOGRAPH
+0xFBF8 0x9927  #CJK UNIFIED IDEOGRAPH
+0xFBF9 0xFA2C  #CJK COMPATIBILITY IDEOGRAPH
+0xFBFA 0x999E  #CJK UNIFIED IDEOGRAPH
+0xFBFB 0x9A4E  #CJK UNIFIED IDEOGRAPH
+0xFBFC 0x9AD9  #CJK UNIFIED IDEOGRAPH
+0xFC40 0x9ADC  #CJK UNIFIED IDEOGRAPH
+0xFC41 0x9B75  #CJK UNIFIED IDEOGRAPH
+0xFC42 0x9B72  #CJK UNIFIED IDEOGRAPH
+0xFC43 0x9B8F  #CJK UNIFIED IDEOGRAPH
+0xFC44 0x9BB1  #CJK UNIFIED IDEOGRAPH
+0xFC45 0x9BBB  #CJK UNIFIED IDEOGRAPH
+0xFC46 0x9C00  #CJK UNIFIED IDEOGRAPH
+0xFC47 0x9D70  #CJK UNIFIED IDEOGRAPH
+0xFC48 0x9D6B  #CJK UNIFIED IDEOGRAPH
+0xFC49 0xFA2D  #CJK COMPATIBILITY IDEOGRAPH
+0xFC4A 0x9E19  #CJK UNIFIED IDEOGRAPH
+0xFC4B 0x9ED1  #CJK UNIFIED IDEOGRAPH
index ac25e4ec2fbe24e20bee8a96130e55e68e3929a2..5d7502f68118b2ecd294f06c8e576c82340b7c31 100644 (file)
@@ -97,7 +97,7 @@ TUPLE: signal n ;
     dup WIFEXITED [ WEXITSTATUS ] [ WTERMSIG signal boa ] if ;
 
 M: unix wait-for-processes ( -- ? )
-    -1 0 <int> tuck WNOHANG waitpid
+    0 <int> -1 over WNOHANG waitpid
     dup 0 <= [
         2drop t
     ] [
index f78f61ef3bbbaedc2dd219de2a88f6f7feaab308..e72b267c04849acfb2d0f2a90e6e6281dc7b54f4 100644 (file)
@@ -143,16 +143,11 @@ TUPLE: ssl-handle file handle connected disposed ;
 
 SYMBOL: default-secure-context
 
-: context-expired? ( context -- ? )
-    dup [ handle>> expired? ] [ drop t ] if ;
-
 : current-secure-context ( -- ctx )
     secure-context get [
-        default-secure-context get dup context-expired? [
-            drop
-            <secure-config> <secure-context> default-secure-context set-global
-            current-secure-context
-        ] when
+        default-secure-context [
+            <secure-config> <secure-context>
+        ] initialize-alien
     ] unless* ;
 
 : <ssl-handle> ( fd -- ssl )
@@ -189,8 +184,7 @@ M: openssl check-certificate ( host ssl -- )
     ] [ 2drop ] if ;
 
 : get-session ( addrspec -- session/f )
-    current-secure-context sessions>> at
-    dup expired? [ drop f ] when ;
+    current-secure-context sessions>> at ;
 
 : save-session ( session addrspec -- )
     current-secure-context sessions>> set-at ;
index 53d554e766933fb12e95be23c9b78d26691e8937..2eb5cc602a7e87e7513d34fe3b3ec1f555d9b411 100644 (file)
@@ -1,7 +1,7 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel continuations destructors io io.encodings
-io.encodings.private io.timeouts io.ports summary
+io.encodings.private io.timeouts io.ports io.styles summary
 accessors delegate delegate.protocols ;
 IN: io.streams.duplex
 
@@ -10,35 +10,33 @@ TUPLE: duplex-stream in out ;
 C: <duplex-stream> duplex-stream
 
 CONSULT: input-stream-protocol duplex-stream in>> ;
-
 CONSULT: output-stream-protocol duplex-stream out>> ;
+CONSULT: formatted-output-stream-protocol duplex-stream out>> ;
+
+: >duplex-stream< ( stream -- in out ) [ in>> ] [ out>> ] bi ; inline
 
 M: duplex-stream set-timeout
-    [ in>> set-timeout ] [ out>> set-timeout ] 2bi ;
+    >duplex-stream< [ set-timeout ] bi-curry@ bi ;
 
 M: duplex-stream dispose
     #! The output stream is closed first, in case both streams
     #! are attached to the same file descriptor, the output
     #! buffer needs to be flushed before we close the fd.
-    [
-        [ in>> &dispose drop ]
-        [ out>> &dispose drop ]
-        bi
-    ] with-destructors ;
+    [ >duplex-stream< [ &dispose drop ] bi@ ] with-destructors ;
 
 : <encoder-duplex> ( stream-in stream-out encoding -- duplex )
-    tuck [ re-decode ] [ re-encode ] 2bi* <duplex-stream> ;
+    [ re-decode ] [ re-encode ] bi-curry bi* <duplex-stream> ;
 
 : with-stream* ( stream quot -- )
-    [ [ in>> ] [ out>> ] bi ] dip with-streams* ; inline
+    [ >duplex-stream< ] dip with-streams* ; inline
 
 : with-stream ( stream quot -- )
-    [ [ in>> ] [ out>> ] bi ] dip with-streams ; inline
+    [ >duplex-stream< ] dip with-streams ; inline
 
 ERROR: invalid-duplex-stream ;
 
 M: duplex-stream underlying-handle
-    [ in>> underlying-handle ]
-    [ out>> underlying-handle ] bi
+    >duplex-stream<
+    [ underlying-handle ] bi@
     [ = [ invalid-duplex-stream ] when ] keep ;
 
diff --git a/basis/io/streams/string/authors.txt b/basis/io/streams/string/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/basis/io/streams/string/string-docs.factor b/basis/io/streams/string/string-docs.factor
new file mode 100644 (file)
index 0000000..b87e5ca
--- /dev/null
@@ -0,0 +1,29 @@
+USING: help.markup help.syntax io strings quotations sequences ;
+IN: io.streams.string
+
+ARTICLE: "io.streams.string" "String streams"
+"String streams:"
+{ $subsection <string-reader> }
+{ $subsection <string-writer> }
+"Utility combinators:"
+{ $subsection with-string-reader }
+{ $subsection with-string-writer } ;
+
+ABOUT: "io.streams.string"
+
+HELP: <string-writer>
+{ $values { "stream" "an output stream" } }
+{ $description "Creates an output stream that collects text into a string buffer. The contents of the buffer can be obtained by executing " { $link >string } "." } ;
+
+HELP: with-string-writer
+{ $values { "quot" quotation } { "str" string } }
+{ $description "Calls the quotation in a new dynamic scope with " { $link output-stream } " rebound to a new string writer. The accumulated string is output when the quotation returns." } ;
+
+HELP: <string-reader>
+{ $values { "str" string } { "stream" "an input stream" } }
+{ $description "Creates a new stream for reading " { $snippet "str" } " from beginning to end." }
+{ $notes "The implementation exploits the ability of string buffers to respond to the input stream protocol by reading characters from the end of the buffer." } ;
+
+HELP: with-string-reader
+{ $values { "str" string } { "quot" quotation } }
+{ $description "Calls the quotation in a new dynamic scope with " { $link input-stream } " rebound to an input stream reading " { $snippet "str" } " from beginning to end." } ;
diff --git a/basis/io/streams/string/string-tests.factor b/basis/io/streams/string/string-tests.factor
new file mode 100644 (file)
index 0000000..967c0d4
--- /dev/null
@@ -0,0 +1,59 @@
+USING: io.streams.string io kernel arrays namespaces make
+tools.test ;
+IN: io.streams.string.tests
+
+[ "line 1" CHAR: l ]
+[
+    "line 1\nline 2\nline 3" <string-reader>
+    dup stream-readln swap stream-read1
+]
+unit-test
+
+[ f ]
+[ "" <string-reader> stream-readln ]
+unit-test
+
+[ "xyzzy" ] [ [ "xyzzy" write ] with-string-writer ] unit-test
+
+[ "a" ] [ 1 "abc" <string-reader> stream-read ] unit-test
+[ "ab" ] [ 2 "abc" <string-reader> stream-read ] unit-test
+[ "abc" ] [ 3 "abc" <string-reader> stream-read ] unit-test
+[ "abc" ] [ 4 "abc" <string-reader> stream-read ] unit-test
+[ "abc" f ] [
+    3 "abc" <string-reader> [ stream-read ] keep stream-read1
+] unit-test
+
+[
+    {
+        { "It seems " CHAR: J }
+        { "obs has lost h" CHAR: i }
+        { "s grasp on reality again.\n" f }
+    }
+] [
+    [
+        "It seems Jobs has lost his grasp on reality again.\n"
+        <string-reader> [
+            "J" read-until 2array ,
+            "i" read-until 2array ,
+            "X" read-until 2array ,
+        ] with-input-stream
+    ] { } make
+] unit-test
+
+[ "hello" "hi" ] [
+    "hello\nhi" <string-reader>
+    dup stream-readln
+    2 rot stream-read
+] unit-test
+
+[ "hello" "hi" ] [
+    "hello\r\nhi" <string-reader>
+    dup stream-readln
+    2 rot stream-read
+] unit-test
+
+[ "hello" "hi" ] [
+    "hello\rhi" <string-reader>
+    dup stream-readln
+    2 rot stream-read
+] unit-test
diff --git a/basis/io/streams/string/string.factor b/basis/io/streams/string/string.factor
new file mode 100644 (file)
index 0000000..73bf5f5
--- /dev/null
@@ -0,0 +1,45 @@
+! Copyright (C) 2003, 2009 Slava Pestov, Daniel Ehrenberg.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors io kernel math namespaces sequences sbufs
+strings generic splitting continuations destructors sequences.private
+io.streams.plain io.encodings math.order growable io.streams.sequence ;
+IN: io.streams.string
+
+<PRIVATE
+
+SINGLETON: null-encoding
+
+M: null-encoding decode-char drop stream-read1 ;
+
+PRIVATE>
+
+M: growable dispose drop ;
+
+M: growable stream-write1 push ;
+M: growable stream-write push-all ;
+M: growable stream-flush drop ;
+
+: <string-writer> ( -- stream )
+    512 <sbuf> ;
+
+: with-string-writer ( quot -- str )
+    <string-writer> swap [ output-stream get ] compose with-output-stream*
+    >string ; inline
+
+! New implementation
+
+TUPLE: string-reader { underlying string read-only } { i array-capacity } ;
+
+M: string-reader stream-read-partial stream-read ;
+M: string-reader stream-read sequence-read ;
+M: string-reader stream-read1 sequence-read1 ;
+M: string-reader stream-read-until sequence-read-until ;
+M: string-reader dispose drop ;
+
+: <string-reader> ( str -- stream )
+    0 string-reader boa null-encoding <decoder> ;
+
+: with-string-reader ( str quot -- )
+    [ <string-reader> ] dip with-input-stream ; inline
+
+INSTANCE: growable plain-writer
diff --git a/basis/io/streams/string/summary.txt b/basis/io/streams/string/summary.txt
new file mode 100644 (file)
index 0000000..2567c6a
--- /dev/null
@@ -0,0 +1 @@
+Reading and writing strings as streams
index 82f5de3d709cc8de33466da9ae39feacec28cecf..ed45d5ccb90adc1c950e2fce9d8f465ebc3549eb 100644 (file)
@@ -1,5 +1,5 @@
 USING: help.markup help.syntax io.streams.plain io strings
-hashtables kernel quotations ;
+hashtables kernel quotations colors ;
 IN: io.styles
 
 HELP: stream-format
@@ -111,14 +111,23 @@ $nl
 { $subsection with-cell }
 { $subsection write-cell } ;
 
+HELP: href
+{ $description "Character style. A URL string that the text links to." } ;
+
+HELP: image
+{ $description "Character style. A pathname string for an image file to display in place of the printed text. If this style is specified, the printed text serves the same role as the " { $snippet "alt" } " attribute of an HTML " { $snippet "img" } " tag -- the text is only displayed if the output medium does not support images." } ;
+
 ARTICLE: "character-styles" "Character styles"
 "Character styles for " { $link stream-format } " and " { $link with-style } ":"
 { $subsection foreground }
 { $subsection background }
-{ $subsection font }
+{ $subsection font-name }
 { $subsection font-size }
 { $subsection font-style }
-{ $subsection presented } ;
+"Special styles:"
+{ $subsection href }
+{ $subsection image }
+{ $see-also "presentations" } ;
 
 ARTICLE: "paragraph-styles" "Paragraph styles"
 "Paragraph styles for " { $link with-nesting } ":"
@@ -139,10 +148,12 @@ HELP: write-object
 $io-error ;
 
 ARTICLE: "presentations" "Presentations"
+"A special style for " { $link format } " and " { $link with-nesting } ":"
+{ $subsection presented }
 "The " { $link presented } " style can be used to emit clickable objects. A utility word for outputting this style:"
 { $subsection write-object } ;
 
-ARTICLE: "styles" "Styled text"
+ARTICLE: "styles" "Text styles"
 "The " { $link stream-format } ", " { $link with-style } ", " { $link with-nesting } " and " { $link tabular-output } " words take a hashtable of style attributes. Output stream implementations are free to ignore style information."
 $nl
 "Style hashtables are keyed by symbols from the " { $vocab-link "io.styles" } " vocabulary."
@@ -172,34 +183,33 @@ HELP: bold-italic
 { $description "A value for the " { $link font-style } " character style denoting boldface italicized text." } ;
 
 HELP: foreground
-{ $description "Character style. Text color, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." } 
+{ $description "Character style. An instance of " { $link color } ". See " { $link "colors" } "." } 
 { $examples
     { $code
         "10 ["
-            "    \"Hello world\" swap"
-            "    { 0.1 0.1 0.2 1 } n*v { 1 1 1 1 } vmin"
-            "    foreground associate format nl"
+            "    \"Hello world\\n\""
+            "    swap 10 / 1 <gray> foreground associate format"
         "] each"
     }
 } ;
 
 HELP: background
-{ $description "Character style. Background color, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
+{ $description "Character style. An instance of " { $link color } ". See " { $link "colors" } "." }
 { $examples
     { $code
         "10 ["
-            "    \"Hello world\" swap"
-            "    { 0.1 0.4 0.1 } n*v { 1 1 1 } vmin { 1 } append"
+            "    \"Hello world\\n\""
+            "    swap 10 / 1 1 over - over 1 <rgba>"
             "    background associate format nl"
         "] each"
     }
 } ;
 
-HELP: font
+HELP: font-name
 { $description "Character style. Font family named by a string." }
 { $examples
     "This example outputs some different font sizes:"
-    { $code "{ \"monospace\" \"serif\" \"sans-serif\" }\n[ dup font associate format nl ] each" }
+    { $code "{ \"monospace\" \"serif\" \"sans-serif\" }\n[ dup font-name associate format nl ] each" }
 } ;
 
 HELP: font-size
@@ -221,26 +231,20 @@ HELP: font-style
 HELP: presented
 { $description "Character and paragraph style. An object associated with the text. In the Factor UI, this is shown as a clickable presentation of the object; left-clicking invokes a default command, and right-clicking shows a menu of commands." } ;
 
-HELP: presented-path
-{ $description "Character and paragraph style. An editable object associated with the text. In the Factor UI, this is shown as a clickable presentation of the object path together with an expander button which displays an object editor; left-clicking invokes a default command, and right-clicking shows a menu of commands." } ;
-
-HELP: presented-printer
-{ $description "Character and paragraph style. A quotation with stack effect " { $snippet "( obj -- )" } " which is applied to the value at the " { $link presented-path } " if the presentation needs to be re-displayed after the object has been edited." } ;
-
 HELP: page-color
-{ $description "Paragraph style. Background color of the paragraph block, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." } 
+{ $description "Paragraph style. An instance of " { $link color } ". See " { $link "colors" } "." } 
 { $examples
-    { $code "H{ { page-color { 1 0.8 0.5 1 } } }\n[ \"A background\" write ] with-nesting nl" }
+    { $code "H{ { page-color T{ rgba f 1 0.8 0.5 1 } } }\n[ \"A background\" write ] with-nesting nl" }
 } ;
 
 HELP: border-color
-{ $description "Paragraph style. Border color of the paragraph block, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." } 
+{ $description "Paragraph style. An instance of " { $link color } ". See " { $link "colors" } "." }
 { $examples
-    { $code "H{ { border-color { 1 0 0 1 } } }\n[ \"A border\" write ] with-nesting nl" }
+    { $code "H{ { border-color T{ rgba f 1 0 0 1 } } }\n[ \"A border\" write ] with-nesting nl" }
 } ;
 
 HELP: border-width
-{ $description "Paragraph style. Pixels between edge of text and border color, an integer." } 
+{ $description "Paragraph style. Pixels between edge of text and border, an integer." } 
 { $examples
     { $code "H{ { border-width 10 } }\n[ \"Some inset text\" write ] with-nesting nl" }
 } ;
@@ -256,7 +260,7 @@ HELP: table-gap
 { table-gap table-border stream-write-table tabular-output } related-words
 
 HELP: table-border
-{ $description "Table style. Color of the border drawn between cells, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." } ;
+{ $description "Table style. An instance of " { $link color } ". See " { $link "colors" } "." } ;
 
 HELP: input
 { $class-description "Class of input text presentations. Instances can be used passed to " { $link write-object } " to output a clickable piece of input. Input text presentations are created by calling " { $link <input> } "." }
index 64a28aabeea6d082d7aafe6c627695cd86a2dcf8..8e93dc945015c3cb07d9edd761cb68cfc6b0a397 100644 (file)
@@ -2,7 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: hashtables io io.streams.plain io.streams.string
 colors summary make accessors splitting math.order
-kernel namespaces assocs destructors strings sequences ;
+kernel namespaces assocs destructors strings sequences
+present fry strings.tables delegate delegate.protocols ;
 IN: io.styles
 
 GENERIC: stream-format ( str style stream -- )
@@ -11,6 +12,10 @@ GENERIC: make-block-stream ( style stream -- stream' )
 GENERIC: make-cell-stream ( style stream -- stream' )
 GENERIC: stream-write-table ( table-cells style stream -- )
 
+PROTOCOL: formatted-output-stream-protocol
+stream-format make-span-stream make-block-stream
+make-cell-stream stream-write-table ;
+
 : format ( str style -- ) output-stream get stream-format ;
 
 : tabular-output ( style quot -- )
@@ -39,35 +44,11 @@ GENERIC: stream-write-table ( table-cells style stream -- )
 
 TUPLE: filter-writer stream ;
 
-M: filter-writer stream-format
-    stream>> stream-format ;
-
-M: filter-writer stream-write
-    stream>> stream-write ;
-
-M: filter-writer stream-write1
-    stream>> stream-write1 ;
-
-M: filter-writer make-span-stream
-    stream>> make-span-stream ;
-
-M: filter-writer make-block-stream
-    stream>> make-block-stream ;
-
-M: filter-writer make-cell-stream
-    stream>> make-cell-stream ;
-
-M: filter-writer stream-flush
-    stream>> stream-flush ;
+CONSULT: output-stream-protocol filter-writer stream>> ;
 
-M: filter-writer stream-nl
-    stream>> stream-nl ;
+CONSULT: formatted-output-stream-protocol filter-writer stream>> ;
 
-M: filter-writer stream-write-table
-    stream>> stream-write-table ;
-
-M: filter-writer dispose
-    stream>> dispose ;
+M: filter-writer dispose stream>> dispose ;
 
 TUPLE: ignore-close-stream < filter-writer ;
 
@@ -115,19 +96,6 @@ M: plain-writer make-span-stream
 M: plain-writer make-block-stream
     nip <ignore-close-stream> ;
 
-: format-column ( seq ? -- seq )
-    [
-        [ 0 [ length max ] reduce ] keep
-        swap [ CHAR: \s pad-tail ] curry map
-    ] unless ;
-
-: map-last ( seq quot -- seq )
-    [ dup length <reversed> ] dip [ 0 = ] prepose 2map ; inline
-
-: format-table ( table -- seq )
-    flip [ format-column ] map-last
-    flip [ " " join ] map ;
-
 M: plain-writer stream-write-table
     [ drop format-table [ print ] each ] with-output-stream* ;
 
@@ -142,17 +110,19 @@ SYMBOL: bold-italic
 ! Character styles
 SYMBOL: foreground
 SYMBOL: background
-SYMBOL: font
+SYMBOL: font-name
 SYMBOL: font-size
 SYMBOL: font-style
 
 ! Presentation
 SYMBOL: presented
-SYMBOL: presented-path
-SYMBOL: presented-printer
 
+! Link
 SYMBOL: href
 
+! Image
+SYMBOL: image
+
 ! Paragraph styles
 SYMBOL: page-color
 SYMBOL: border-color
@@ -174,11 +144,13 @@ TUPLE: input string ;
 
 C: <input> input
 
+M: input present string>> ;
+
 M: input summary
     [
         "Input: " %
-        string>> "\n" split1 swap %
-        "..." "" ? %
+        string>> "\n" split1
+        [ % ] [ "..." "" ? % ] bi*
     ] "" make ;
 
 : write-object ( str obj -- ) presented associate format ;
index c154544f81a6c4e9d319237c3436219f5044bb44..7a55b1547363f065d64a91048a5dbb776a154e6c 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2004, 2005 Mackenzie Straight
-! Copyright (C) 2007, 2008 Slava Pestov
+! Copyright (C) 2007, 2009 Slava Pestov
 ! Copyright (C) 2007, 2008 Doug Coleman
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien assocs continuations destructors
-kernel namespaces accessors sets summary ;
+USING: alien assocs continuations alien.destructors kernel
+namespaces accessors sets summary ;
 IN: libc
 
 : errno ( -- int )
@@ -26,15 +26,8 @@ IN: libc
 : (realloc) ( alien size -- newalien )
     "void*" "libc" "realloc" { "void*" "ulong" } alien-invoke ;
 
-SYMBOL: malloc-expiry
-
 : mallocs ( -- assoc )
-    malloc-expiry get-global expired? [
-        -1 <alien> malloc-expiry set-global
-        H{ } clone dup \ mallocs set-global
-    ] [
-        \ mallocs get-global
-    ] if ;
+    \ mallocs [ H{ } clone ] initialize-alien ;
 
 PRIVATE>
 
@@ -58,13 +51,13 @@ M: realloc-error summary
 
 <PRIVATE
 
-: add-malloc ( alien -- )
-    mallocs conjoin ;
+: add-malloc ( alien -- alien )
+    dup mallocs conjoin ;
 
 : delete-malloc ( alien -- )
     [
         mallocs delete-at*
-        [ double-free ] unless drop
+        [ drop ] [ double-free ] if
     ] when* ;
 
 : malloc-exists? ( alien -- ? )
@@ -73,19 +66,16 @@ M: realloc-error summary
 PRIVATE>
 
 : malloc ( size -- alien )
-    (malloc) check-ptr
-    dup add-malloc ;
+    (malloc) check-ptr add-malloc ;
 
 : calloc ( count size -- alien )
-    (calloc) check-ptr
-    dup add-malloc ;
+    (calloc) check-ptr add-malloc ;
 
 : realloc ( alien size -- newalien )
     [ >c-ptr ] dip
     over malloc-exists? [ realloc-error ] unless
-    dupd (realloc) check-ptr
-    swap delete-malloc
-    dup add-malloc ;
+    [ drop ] [ (realloc) check-ptr ] 2bi
+    [ delete-malloc ] [ add-malloc ] bi* ;
 
 : free ( alien -- )
     >c-ptr [ delete-malloc ] [ (free) ] bi ;
@@ -96,17 +86,4 @@ PRIVATE>
 : strlen ( alien -- len )
     "size_t" "libc" "strlen" { "char*" } alien-invoke ;
 
-<PRIVATE
-
-! Memory allocations
-TUPLE: memory-destructor alien disposed ;
-
-M: memory-destructor dispose* alien>> free ;
-
-PRIVATE>
-
-: &free ( alien -- alien )
-    dup f memory-destructor boa &dispose drop ; inline
-
-: |free ( alien -- alien )
-    dup f memory-destructor boa |dispose drop ; inline
+DESTRUCTOR: free
index 88a90b72e21f92bd3c45456a8adca6e886ee347b..2ee0832269a9b15ae77f7728720c12416bd32584 100644 (file)
@@ -1,10 +1,10 @@
-! Copyright (C) 2003, 2008 Slava Pestov.
+! Copyright (C) 2003, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays hashtables io kernel math math.parser memory
 namespaces parser lexer sequences strings io.styles
 vectors words generic system combinators continuations debugger
 definitions compiler.units accessors colors prettyprint fry
-sets vocabs.parser ;
+sets vocabs.parser call ;
 IN: listener
 
 GENERIC: stream-read-quot ( stream -- quot/f )
@@ -18,7 +18,7 @@ GENERIC: stream-read-quot ( stream -- quot/f )
         [ 2drop f ] [ rethrow ] if
     ] recover ;
 
-: read-quot-loop  ( stream accum -- quot/f )
+: read-quot-loop ( stream accum -- quot/f )
     over stream-readln dup [
         over push
         dup read-quot-step dup
@@ -54,7 +54,19 @@ SYMBOL: visible-vars
 
 SYMBOL: error-hook
 
-[ print-error-and-restarts ] error-hook set-global
+: call-error-hook ( error -- )
+    error-continuation get error-hook get
+    call( error continuation -- ) ;
+
+[ drop print-error-and-restarts ] error-hook set-global
+
+SYMBOL: display-stacks?
+
+t display-stacks? set-global
+
+SYMBOL: max-stack-items
+
+10 max-stack-items set-global
 
 <PRIVATE
 
@@ -74,14 +86,19 @@ SYMBOL: error-hook
             ] each
         ] tabular-output
     ] unless-empty ;
-
-SYMBOL: display-stacks?
-
-t display-stacks? set-global
+    
+: trimmed-stack. ( seq -- )
+    dup length max-stack-items get > [
+        max-stack-items get cut*
+        [
+            [ length number>string "(" " more items)" surround ] keep
+            write-object nl
+        ] dip
+    ] when stack. ;
 
 : stacks. ( -- )
     display-stacks? get [
-        datastack [ nl "--- Data stack:" title. stack. ] unless-empty
+        datastack [ nl "--- Data stack:" title. trimmed-stack. ] unless-empty
     ] when ;
 
 : prompt. ( -- )
@@ -90,14 +107,8 @@ t display-stacks? set-global
 
 : listen ( -- )
     visible-vars. stacks. prompt.
-    [ read-quot [ [ error-hook get call ] recover ] [ bye ] if* ]
-    [
-        dup lexer-error? [
-            error-hook get call
-        ] [
-            rethrow
-        ] if
-    ] recover ;
+    [ read-quot [ [ call-error-hook ] recover ] [ bye ] if* ]
+    [ dup lexer-error? [ call-error-hook ] [ rethrow ] if ] recover ;
 
 : until-quit ( -- )
     quit-flag get [ quit-flag off ] [ listen until-quit ] if ;
index 1fcc1ead13a39f6fb66558a6f7a8f54712faae26..6b6f5c95bd323cf757b29bf90ea92ce4a7991db4 100644 (file)
@@ -26,21 +26,6 @@ HELP: complex
 
 ABOUT: "complex-numbers"
 
-HELP: 2>rect
-{ $values { "x" "a complex number" } { "y" "a complex number" } { "xr" "real part of " { $snippet "x" } } { "xi" "imaginary part of " { $snippet "x" } } { "yr" "real part of " { $snippet "y" } } { "yi" "imaginary part of " { $snippet "y" } } }
-{ $description "Extracts real and imaginary components of two numbers at once." } ;
-
-HELP: complex/
-{ $values { "x" "a complex number" } { "y" "a complex number" } { "r" "a real number" } { "i" "a real number" } { "m" "a real number" } }
-{ $description
-    "Complex division kernel. If we use the notation from " { $link 2>rect } ", this word computes:"
-    { $code
-        "r = xr*yr+xi*yi"
-        "i = xi*yr-xr*yi"
-        "m = yr*yr+yi*yi"
-    }
-} ;
-
 HELP: <complex> ( x y -- z )
 { $values { "x" "a real number" } { "y" "a real number" } { "z" "a complex number" } }
 { $description "Low-level complex number constructor. User code should call " { $link rect> } " instead." } ;
index 620a6c3bab2f5f0b53127bb7451e4d972e855ccc..273fd0b2b52116759963f927d55234e429833bd7 100644 (file)
@@ -7,41 +7,26 @@ IN: math.complex.private
 
 M: real real-part ;
 M: real imaginary-part drop 0 ;
-
 M: complex real-part real>> ;
 M: complex imaginary-part imaginary>> ;
-
 M: complex absq >rect [ sq ] bi@ + ;
-
-: 2>rect ( x y -- xr yr xi yi )
-    [ [ real-part ] bi@ ]
-    [ [ imaginary-part ] bi@ ] 2bi ; inline
-
-M: complex hashcode*
-    nip >rect [ hashcode ] bi@ bitxor ;
-
-M: complex equal?
-    over complex? [
-        2>rect = [ = ] [ 2drop f ] if
-    ] [ 2drop f ] if ;
-
-M: complex number=
-    2>rect number= [ number= ] [ 2drop f ] if ;
-
-: *re ( x y -- xr*yr xi*ri ) 2>rect [ * ] 2bi@ ; inline
-: *im ( x y -- xi*yr xr*yi ) 2>rect [ * swap ] dip * ; inline
-
-M: complex + 2>rect [ + ] 2bi@ (rect>) ;
-M: complex - 2>rect [ - ] 2bi@ (rect>) ;
+M: complex hashcode* nip >rect [ hashcode ] bi@ bitxor ;
+: componentwise ( x y quot -- a b ) [ [ >rect ] bi@ ] dip bi-curry@ bi* ; inline
+: complex= ( x y quot -- ? ) componentwise and ; inline
+M: complex equal? over complex? [ [ = ] complex= ] [ 2drop f ] if ;
+M: complex number= [ number= ] complex= ;
+: complex-op ( x y quot -- z ) componentwise (rect>) ; inline
+M: complex + [ + ] complex-op ;
+M: complex - [ - ] complex-op ;
+: *re ( x y -- xr*yr xi*yi ) [ >rect ] bi@ [ * ] bi-curry@ bi* ; inline
+: *im ( x y -- xi*yr xr*yi ) swap [ >rect ] bi@ swap [ * ] bi-curry@ bi* ; inline
 M: complex * [ *re - ] [ *im + ] 2bi (rect>) ;
-
-: complex/ ( x y -- r i m )
-    [ [ *re + ] [ *im - ] 2bi ] keep absq ; inline
-
-M: complex / complex/ tuck [ / ] 2bi@ (rect>) ;
-
+: (complex/) ( x y -- r i m ) [ [ *re + ] [ *im - ] 2bi ] keep absq ; inline
+: complex/ ( x y quot -- z ) [ (complex/) ] dip curry bi@ (rect>) ; inline
+M: complex / [ / ] complex/ ;
+M: complex /f [ /f ] complex/ ;
+M: complex /i [ /i ] complex/ ;
 M: complex abs absq >float fsqrt ;
-
 M: complex sqrt >polar [ fsqrt ] [ 2.0 / ] bi* polar> ;
 
 IN: syntax
index 964074512a3bfe7b5dbccd96c47b0ed38bd6c1a7..a87b3995d7eb03a6b0b65f46dba4f8c08ab160d7 100644 (file)
@@ -43,7 +43,7 @@ M: integer ^n
     [ factor-2s ] dip [ (^n) ] keep rot * shift ;
 
 M: ratio ^n
-    [ >fraction ] dip tuck [ ^n ] 2bi@ / ;
+    [ >fraction ] dip [ ^n ] curry bi@ / ;
 
 M: float ^n
     (^n) ;
diff --git a/basis/math/geometry/geometry.factor b/basis/math/geometry/geometry.factor
deleted file mode 100644 (file)
index d82478d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-IN: math.geometry
-
-GENERIC: width  ( object -- width )
-GENERIC: height ( object -- width )
-
-GENERIC# set-width!  1 ( object width  -- object )
-GENERIC# set-height! 1 ( object height -- object )
-
-GENERIC# set-x! 1 ( object x -- object )
-GENERIC# set-y! 1 ( object y -- object )
\ No newline at end of file
diff --git a/basis/math/geometry/rect/rect-docs.factor b/basis/math/geometry/rect/rect-docs.factor
deleted file mode 100644 (file)
index 2077d82..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-USING: help.markup help.syntax ;
-
-IN: math.geometry.rect
-
-HELP: rect
-{ $class-description "A rectangle with the following slots:"
-    { $list
-        { { $link rect-loc } " - the top-left corner of the rectangle as an x/y pair" }
-        { { $link rect-dim } " - the dimensions of the rectangle as a width/height pair" }
-    }
-    "Rectangles are constructed by calling " { $link <rect> } " and " { $link <extent-rect> } "."
-} ;
-
-HELP: <rect>
-{ $values { "loc" "a pair of integers" } { "dim" "a pair of integers" } { "rect" "a new " { $link rect } } }
-{ $description "Creates a new rectangle with the specified top-left location and dimensions." } ;
-
-{ <zero-rect> <rect> <extent-rect> } related-words
-
-HELP: rect-bounds
-{ $values { "rect" rect } { "loc" "a pair of integers" } { "dim" "a pair of integers" } }
-{ $description "Outputs the location and dimensions of a rectangle." } ;
-
-{ rect-bounds rect-extent } related-words
-
-HELP: <extent-rect>
-{ $values { "loc" "a pair of integers" } { "ext" "a pair of integers" } { "rect" "a new " { $link rect } } }
-{ $description "Creates a new rectangle with the specified top-left and bottom-right corner locations." } ;
-
-HELP: rect-extent
-{ $values { "rect" rect } { "loc" "a pair of integers" } { "ext" "a pair of integers" } }
-{ $description "Outputs the location of the top-left and bottom-right corners of a rectangle." } ;
-
-HELP: offset-rect
-{ $values { "rect" rect } { "loc" "a pair of integers" } { "newrect" "a new " { $link rect } } }
-{ $description "Creates a new rectangle with the same dimensions, and top-left corner translated by " { $snippet "loc" } "." } ;
-
-HELP: rect-intersect
-{ $values { "rect1" rect } { "rect2" rect } { "newrect" "a new " { $link rect } } }
-{ $description "Computes the intersection of two rectangles." } ;
-
-HELP: intersects?
-{ $values { "rect/point" "a " { $link rect } " or a pair of integers" } { "rect" rect } { "?" "a boolean" } }
-{ $description "Tests if two rectangles (or a point and a rectangle, respectively) have a non-empty intersection." } ;
-
-HELP: <zero-rect>
-{ $values { "rect" "a new " { $link rect } } }
-{ $description "Creates a rectangle located at the origin with zero dimensions." } ;
-
-ARTICLE: "math.geometry.rect" "Rectangles"
-"The " { $vocab-link "math.geometry.rect" } " vocabulary defines a rectangle data type and operations on them."
-{ $subsection rect }
-"Rectangles can be taken apart:"
-{ $subsection rect-loc }
-{ $subsection rect-dim }
-{ $subsection rect-bounds }
-{ $subsection rect-extent }
-"New rectangles can be created:"
-{ $subsection <zero-rect> }
-{ $subsection <rect> }
-{ $subsection <extent-rect> }
-"More utility words for working with rectangles:"
-{ $subsection offset-rect }
-{ $subsection rect-intersect }
-{ $subsection intersects? } ;
-
-ABOUT: "math.geometry.rect"
diff --git a/basis/math/geometry/rect/rect-tests.factor b/basis/math/geometry/rect/rect-tests.factor
deleted file mode 100644 (file)
index 0d2a8bc..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-
-USING: tools.test math.geometry.rect ;
-
-IN: math.geometry.rect.tests
-
-[ T{ rect f { 10 10 } { 20 20 } } ]
-[
-    T{ rect f { 10 10 } { 50 50 } }
-    T{ rect f { -10 -10 } { 40 40 } }
-    rect-intersect
-] unit-test
-
-[ T{ rect f { 200 200 } { 0 0 } } ]
-[
-    T{ rect f { 100 100 } { 50 50 } }
-    T{ rect f { 200 200 } { 40 40 } }
-    rect-intersect
-] unit-test
-
-[ f ] [
-    T{ rect f { 100 100 } { 50 50 } }
-    T{ rect f { 200 200 } { 40 40 } }
-    intersects?
-] unit-test
-
-[ t ] [
-    T{ rect f { 100 100 } { 50 50 } }
-    T{ rect f { 120 120 } { 40 40 } }
-    intersects?
-] unit-test
-
-[ f ] [
-    T{ rect f { 1000 100 } { 50 50 } }
-    T{ rect f { 120 120 } { 40 40 } }
-    intersects?
-] unit-test
-
diff --git a/basis/math/geometry/rect/rect.factor b/basis/math/geometry/rect/rect.factor
deleted file mode 100644 (file)
index 08cfbbc..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-
-USING: kernel arrays sequences
-       math math.points math.vectors math.geometry
-       accessors ;
-
-IN: math.geometry.rect
-
-TUPLE: rect loc dim ;
-
-GENERIC: rect-loc ( obj -- loc )
-GENERIC: rect-dim ( obj -- dim )
-
-: init-rect ( rect -- rect ) { 0 0 } clone >>loc { 0 0 } clone >>dim ;
-
-: <rect> ( loc dim -- rect ) rect boa ;
-
-: <zero-rect> ( -- rect ) rect new init-rect ;
-
-M: array rect-loc ;
-
-M: array rect-dim drop { 0 0 } ;
-
-M: rect rect-loc loc>> ;
-
-M: rect rect-dim dim>> ;
-
-: rect-bounds ( rect -- loc dim ) dup rect-loc swap rect-dim ;
-
-: rect-extent ( rect -- loc ext ) rect-bounds over v+ ;
-
-: 2rect-extent ( rect rect -- loc1 loc2 ext1 ext2 )
-    [ rect-extent ] bi@ swapd ;
-
-: <extent-rect> ( loc ext -- rect ) over [v-] <rect> ;
-
-: offset-rect ( rect loc -- newrect )
-    over rect-loc v+ swap rect-dim <rect> ;
-
-: (rect-intersect) ( rect rect -- array array )
-    2rect-extent [ vmax ] [ vmin ] 2bi* ;
-
-: rect-intersect ( rect1 rect2 -- newrect )
-    (rect-intersect) <extent-rect> ;
-
-: intersects? ( rect/point rect -- ? )
-    (rect-intersect) [v-] { 0 0 } = ;
-
-: (rect-union) ( rect rect -- array array )
-    2rect-extent [ vmin ] [ vmax ] 2bi* ;
-
-: rect-union ( rect1 rect2 -- newrect )
-    (rect-union) <extent-rect> ;
-
-M: rect width  ( rect -- width  ) dim>> first  ;
-M: rect height ( rect -- height ) dim>> second ;
-
-M: rect set-width!  ( rect width  -- rect ) over dim>> set-first  ;
-M: rect set-height! ( rect height -- rect ) over dim>> set-second ;
-
-M: rect set-x! ( rect x -- rect ) over loc>> set-first  ;
-M: rect set-y! ( rect y -- rect ) over loc>> set-second ;
-
-: rect-containing ( points -- rect )
-    [ vleast ] [ vgreatest ] bi
-    [ drop ] [ swap v- ] 2bi <rect> ;
-
-! Accessing corners
-
-: top-left     ( rect -- point ) loc>> ;
-: top-right    ( rect -- point ) [ loc>> ] [ width  1 - ] bi v+x ;
-: bottom-left  ( rect -- point ) [ loc>> ] [ height 1 - ] bi v+y ;
-: bottom-right ( rect -- point ) [ loc>> ] [ dim>> ] bi v+ { 1 1 } v- ;
-
index 089de35ac5147807066d5a7c41b0862a8fddd491..4fbc88097122989f9dde59e3b8a514a0e002ba1e 100755 (executable)
@@ -120,9 +120,9 @@ TUPLE: interval { from read-only } { to read-only } ;
         { [ over full-interval eq? ] [ nip ] }
         { [ dup full-interval eq? ] [ drop ] }
         [
-            [ interval>points ] bi@ swapd
+            [ interval>points ] bi@
             [ [ swap endpoint< ] most ]
-            [ [ swap endpoint> ] most ] 2bi*
+            [ [ swap endpoint> ] most ] bi-curry* bi*
             <interval>
         ]
     } cond ;
index 19715357eec1c77c03349820ea1e33bc36e13e08..6618578a990cb63c3428bd062db94014e5d6eff2 100644 (file)
@@ -104,10 +104,10 @@ M: word integer-op-input-classes
 
 : define-integer-ops ( word fix-word big-word -- )
     [
-        rot tuck
+        rot
         [ fixnum fixnum 3array "derived-from" set-word-prop ]
         [ bignum bignum 3array "derived-from" set-word-prop ]
-        2bi*
+        bi-curry bi*
     ] [
         [ integer-op-triples ] 2dip
         [ define-integer-op-words ]
index e44dbd1a757f8e01fe4c5e0d8522185ca7437497..54e4bee1a85582376d185fd275e3ba81748efdaf 100644 (file)
@@ -24,7 +24,7 @@ M: integer /
         "Division by zero" throw
     ] [
         dup 0 < [ [ neg ] bi@ ] when
-        2dup gcd nip tuck [ /i ] 2bi@ fraction>
+        2dup gcd nip [ /i ] curry bi@ fraction>
     ] if ;
 
 M: ratio hashcode*
diff --git a/basis/math/rectangles/positioning/authors.txt b/basis/math/rectangles/positioning/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/math/rectangles/positioning/positioning-tests.factor b/basis/math/rectangles/positioning/positioning-tests.factor
new file mode 100644 (file)
index 0000000..a292775
--- /dev/null
@@ -0,0 +1,53 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test math.rectangles math.rectangles.positioning ;
+IN: math.rectangles.positioning.tests
+
+[ T{ rect f { 0 1 } { 30 30 } } ] [
+    { 0 0 } { 1 1 } <rect>
+    { 30 30 }
+    { 100 100 }
+    popup-rect
+] unit-test
+
+[ T{ rect f { 10 21 } { 30 30 } } ] [
+    { 10 20 } { 1 1 } <rect>
+    { 30 30 }
+    { 100 100 }
+    popup-rect
+] unit-test
+
+[ T{ rect f { 10 30 } { 30 30 } } ] [
+    { 10 20 } { 1 10 } <rect>
+    { 30 30 }
+    { 100 100 }
+    popup-rect
+] unit-test
+
+[ T{ rect f { 20 20 } { 80 30 } } ] [
+    { 40 10 } { 1 10 } <rect>
+    { 80 30 }
+    { 100 100 }
+    popup-rect
+] unit-test
+
+[ T{ rect f { 50 20 } { 50 50 } } ] [
+    { 50 70 } { 0 0 } <rect>
+    { 50 50 }
+    { 100 100 }
+    popup-rect
+] unit-test
+
+[ T{ rect f { 0 20 } { 50 50 } } ] [
+    { -50 70 } { 0 0 } <rect>
+    { 50 50 }
+    { 100 100 }
+    popup-rect
+] unit-test
+
+[ T{ rect f { 0 50 } { 50 50 } } ] [
+    { 0 50 } { 0 0 } <rect>
+    { 50 60 }
+    { 100 100 }
+    popup-rect
+] unit-test
\ No newline at end of file
diff --git a/basis/math/rectangles/positioning/positioning.factor b/basis/math/rectangles/positioning/positioning.factor
new file mode 100644 (file)
index 0000000..4b1a60a
--- /dev/null
@@ -0,0 +1,37 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: sequences kernel accessors math math.vectors
+math.rectangles math.order arrays locals
+combinators.short-circuit ;
+IN: math.rectangles.positioning
+
+! Some geometry code for positioning popups and menus
+! in a semi-intelligent manner
+
+: popup-x ( visible-rect popup-dim screen-dim -- x )
+    [ loc>> first ] 2dip swap [ first ] bi@ - min 0 max ;
+
+: preferred-y ( visible-rect -- y )
+    [ loc>> ] [ dim>> ] bi [ second ] bi@ + ;
+
+: alternate-y ( visible-rect popup-dim -- y )
+    [ loc>> ] dip [ second ] bi@ - ;
+
+: preferred-fit? ( visible-rect popup-dim screen-dim -- ? )
+    [ [ preferred-y ] [ second ] bi* + ] dip second < ;
+
+: alternate-fit? ( visible-rect popup-dim -- ? )
+    alternate-y 0 >= ;
+
+: popup-y ( visible-rect popup-dim screen-dim -- y )
+    3dup { [ preferred-fit? not ] [ drop alternate-fit? ] } 3&&
+    [ drop alternate-y ] [ 2drop preferred-y ] if ;
+
+: popup-loc ( visible-rect popup-dim screen-dim -- loc )
+    [ popup-x ] [ popup-y ] 3bi 2array ;
+
+:: popup-dim ( loc popup-dim screen-dim -- dim )
+    screen-dim loc v- popup-dim vmin ;
+
+: popup-rect ( visible-rect popup-dim screen-dim -- rect )
+    [ popup-loc dup ] 2keep popup-dim <rect> ;
\ No newline at end of file
diff --git a/basis/math/rectangles/rectangles-docs.factor b/basis/math/rectangles/rectangles-docs.factor
new file mode 100644 (file)
index 0000000..1d5c32d
--- /dev/null
@@ -0,0 +1,71 @@
+USING: help.markup help.syntax ;
+IN: math.rectangles
+
+HELP: rect
+{ $class-description "A rectangle with the following slots:"
+    { $list
+        { { $slot "loc" } " - the top-left corner of the rectangle as an x/y pair" }
+        { { $slot "dim" } " - the dimensions of the rectangle as a width/height pair" }
+    }
+    "Rectangles are constructed by calling " { $link <rect> } " and " { $link <extent-rect> } "."
+} ;
+
+HELP: <rect>
+{ $values { "loc" "a pair of integers" } { "dim" "a pair of integers" } { "rect" "a new " { $link rect } } }
+{ $description "Creates a new rectangle with the specified top-left location and dimensions." } ;
+
+{ <zero-rect> <rect> <extent-rect> } related-words
+
+HELP: rect-bounds
+{ $values { "rect" rect } { "loc" "a pair of integers" } { "dim" "a pair of integers" } }
+{ $description "Outputs the location and dimensions of a rectangle." } ;
+
+{ rect-bounds rect-extent } related-words
+
+HELP: <extent-rect>
+{ $values { "loc" "a pair of integers" } { "ext" "a pair of integers" } { "rect" "a new " { $link rect } } }
+{ $description "Creates a new rectangle with the specified top-left and bottom-right corner locations." } ;
+
+HELP: rect-extent
+{ $values { "rect" rect } { "loc" "a pair of integers" } { "ext" "a pair of integers" } }
+{ $description "Outputs the location of the top-left and bottom-right corners of a rectangle." } ;
+
+HELP: offset-rect
+{ $values { "rect" rect } { "loc" "a pair of integers" } { "newrect" "a new " { $link rect } } }
+{ $description "Creates a new rectangle with the same dimensions, and top-left corner translated by " { $snippet "loc" } "." } ;
+
+HELP: rect-intersect
+{ $values { "rect1" rect } { "rect2" rect } { "newrect" "a new " { $link rect } } }
+{ $description "Computes the intersection of two rectangles." } ;
+
+HELP: contains-rect?
+{ $values { "rect1" rect } { "rect2" rect } { "?" "a boolean" } }
+{ $description "Tests if two rectangles have a non-empty intersection." } ;
+
+HELP: contains-point?
+{ $values { "point" "a pair of integers" } { "rect" rect } { "?" "a boolean" } }
+{ $description "Tests if a rectangle contains a point." } ;
+
+HELP: <zero-rect>
+{ $values { "rect" "a new " { $link rect } } }
+{ $description "Creates a rectangle located at the origin with zero dimensions." } ;
+
+ARTICLE: "math.rectangles" "Rectangles"
+"The " { $vocab-link "math.rectangles" } " vocabulary defines a rectangle data type and operations on them."
+{ $subsection rect }
+"Rectangles can be taken apart:"
+{ $subsection rect-bounds }
+{ $subsection rect-extent }
+"New rectangles can be created:"
+{ $subsection <zero-rect> }
+{ $subsection <rect> }
+{ $subsection <extent-rect> }
+"Set-theoretic operations on rectangles:"
+{ $subsection rect-intersect }
+{ $subsection rect-union }
+{ $subsection contains-rect? }
+{ $subsection contains-point? }
+"A utility word:"
+{ $subsection offset-rect } ;
+
+ABOUT: "math.rectangles"
diff --git a/basis/math/rectangles/rectangles-tests.factor b/basis/math/rectangles/rectangles-tests.factor
new file mode 100644 (file)
index 0000000..ca72285
--- /dev/null
@@ -0,0 +1,42 @@
+USING: tools.test math.rectangles ;
+IN: math.rectangles.tests
+
+[ T{ rect f { 10 10 } { 20 20 } } ]
+[
+    T{ rect f { 10 10 } { 50 50 } }
+    T{ rect f { -10 -10 } { 40 40 } }
+    rect-intersect
+] unit-test
+
+[ T{ rect f { 200 200 } { 0 0 } } ]
+[
+    T{ rect f { 100 100 } { 50 50 } }
+    T{ rect f { 200 200 } { 40 40 } }
+    rect-intersect
+] unit-test
+
+[ f ] [
+    T{ rect f { 100 100 } { 50 50 } }
+    T{ rect f { 200 200 } { 40 40 } }
+    contains-rect?
+] unit-test
+
+[ t ] [
+    T{ rect f { 100 100 } { 50 50 } }
+    T{ rect f { 120 120 } { 40 40 } }
+    contains-rect?
+] unit-test
+
+[ f ] [
+    T{ rect f { 1000 100 } { 50 50 } }
+    T{ rect f { 120 120 } { 40 40 } }
+    contains-rect?
+] unit-test
+
+[ T{ rect f { 10 20 } { 20 20 } } ] [
+    {
+        { 20 20 }
+        { 10 40 }
+        { 30 30 }
+    } rect-containing
+] unit-test
\ No newline at end of file
diff --git a/basis/math/rectangles/rectangles.factor b/basis/math/rectangles/rectangles.factor
new file mode 100644 (file)
index 0000000..1d9c913
--- /dev/null
@@ -0,0 +1,58 @@
+! Copyright (C) 2008, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel arrays sequences math math.vectors accessors ;
+IN: math.rectangles
+
+TUPLE: rect { loc initial: { 0 0 } } { dim initial: { 0 0 } } ;
+
+: <rect> ( loc dim -- rect ) rect boa ; inline
+
+: <zero-rect> ( -- rect ) rect new ; inline
+
+: point>rect ( loc -- rect ) { 0 0 } <rect> ; inline
+
+: rect-bounds ( rect -- loc dim ) [ loc>> ] [ dim>> ] bi ;
+
+: rect-extent ( rect -- loc ext ) rect-bounds over v+ ;
+
+: with-rect-extents ( rect1 rect2 loc-quot: ( loc1 loc2 -- ) ext-quot: ( ext1 ext2 -- ) -- )
+    [ [ rect-extent ] bi@ ] 2dip bi-curry* bi* ; inline
+
+: <extent-rect> ( loc ext -- rect ) over [v-] <rect> ;
+
+: offset-rect ( rect loc -- newrect )
+    over loc>> v+ swap dim>> <rect> ;
+
+: (rect-intersect) ( rect rect -- array array )
+    [ vmax ] [ vmin ] with-rect-extents ;
+
+: rect-intersect ( rect1 rect2 -- newrect )
+    (rect-intersect) <extent-rect> ;
+
+GENERIC: contains-rect? ( rect1 rect2 -- ? )
+
+M: rect contains-rect?
+    (rect-intersect) [v-] { 0 0 } = ;
+
+GENERIC: contains-point? ( point rect -- ? )
+
+M: rect contains-point?
+    [ point>rect ] dip contains-rect? ;
+
+: (rect-union) ( rect rect -- array array )
+    [ vmin ] [ vmax ] with-rect-extents ;
+
+: rect-union ( rect1 rect2 -- newrect )
+    (rect-union) <extent-rect> ;
+
+: rect-containing ( points -- rect )
+    [ vsupremum ] [ vinfimum ] bi
+    [ nip ] [ v- ] 2bi <rect> ;
+
+: rect-min ( rect dim -- rect' )
+    [ rect-bounds ] dip vmin <rect> ;
+
+: set-rect-bounds ( rect1 rect -- )
+    [ [ loc>> ] dip (>>loc) ]
+    [ [ dim>> ] dip (>>dim) ]
+    2bi ; inline
\ No newline at end of file
index 09caebcf0757bd81bcaf39194133002c45ae8907..589876184ff2ad826dd7ed7d7648ddd7a7fd0b90 100644 (file)
@@ -22,7 +22,7 @@ IN: math.statistics
 
 : minmax ( seq -- min max )
     #! find the min and max of a seq in one pass
-    [ 1/0. -1/0. ] dip [ tuck [ min ] [ max ] 2bi* ] each ;
+    [ 1/0. -1/0. ] dip [ [ min ] [ max ] bi-curry bi* ] each ;
 
 : range ( seq -- n )
     minmax swap - ;
index 4d9a0916b5c37c6718e0b6a01154eddd65e2250f..eb5fa7b9705135ae33a099ea5b0ddf4aef1bb8bc 100644 (file)
@@ -19,8 +19,8 @@ IN: math.vectors
 : vmax ( u v -- w ) [ max ] 2map ;
 : vmin ( u v -- w ) [ min ] 2map ;
 
-: vgreatest ( array -- vmax ) { -1.0/0.0 -1.0/0.0 } [ vmax ] reduce ; 
-: vleast    ( array -- vmax ) {  1.0/0.0  1.0/0.0 } [ vmin ] reduce ; 
+: vsupremum ( seq -- vmax ) [ ] [ vmax ] map-reduce ; 
+: vinfimum ( seq -- vmin ) [ ] [ vmin ] map-reduce ; 
 
 : v. ( u v -- x ) [ * ] [ + ] 2map-reduce ;
 : norm-sq ( v -- x ) [ absq ] [ + ] map-reduce ;
diff --git a/basis/models/arrow/arrow-docs.factor b/basis/models/arrow/arrow-docs.factor
new file mode 100644 (file)
index 0000000..91b292f
--- /dev/null
@@ -0,0 +1,27 @@
+USING: help.syntax help.markup kernel math classes classes.tuple\r
+calendar models ;\r
+IN: models.arrow\r
+\r
+HELP: arrow\r
+{ $class-description "Arrow model values are computed by applying a quotation to the value of another model. Arrows are automatically updated when the underlying model changes. Arrows are constructed by " { $link <arrow> } "." }\r
+{ $examples\r
+    "The following code displays a label showing the result of applying " { $link sq } " to the value 5:"\r
+    { $code\r
+        "USING: models ui.gadgets.labels ui.gadgets.panes ;"\r
+        "5 <model> [ sq ] <arrow> [ number>string ] <arrow>"\r
+        "<label-control> gadget."\r
+    }\r
+    "An exercise for the reader is to keep the original model around on the stack, and change its value to 6, observing that the label will immediately display 36."\r
+} ;\r
+\r
+HELP: <arrow>\r
+{ $values { "model" model } { "quot" { $quotation "( obj -- newobj )" } } { "arrow" "a new " { $link arrow } } }\r
+{ $description "Creates a new instance of " { $link arrow } ". The value of the new arrow model is computed by applying the quotation to the value." }\r
+{ $examples "See the example in the documentation for " { $link arrow } "." } ;\r
+\r
+ARTICLE: "models.arrow" "Arrow models"\r
+"Arrow model values are computed by applying a quotation to the value of another model."\r
+{ $subsection arrow }\r
+{ $subsection <arrow> } ;\r
+\r
+ABOUT: "models.arrow"\r
diff --git a/basis/models/arrow/arrow-tests.factor b/basis/models/arrow/arrow-tests.factor
new file mode 100644 (file)
index 0000000..6984e0e
--- /dev/null
@@ -0,0 +1,23 @@
+USING: arrays generic kernel math models namespaces sequences assocs\r
+tools.test models.arrow accessors ;\r
+IN: models.arrow.tests\r
+\r
+3 <model> "x" set\r
+"x" get [ 2 * ] <arrow> dup "z" set\r
+[ 1+ ] <arrow> "y" set\r
+[ ] [ "y" get activate-model ] unit-test\r
+[ t ] [ "z" get "x" get connections>> memq? ] unit-test\r
+[ 7 ] [ "y" get value>> ] unit-test\r
+[ ] [ 4 "x" get set-model ] unit-test\r
+[ 9 ] [ "y" get value>> ] unit-test\r
+[ ] [ "y" get deactivate-model ] unit-test\r
+[ f ] [ "z" get "x" get connections>> memq? ] unit-test\r
+\r
+3 <model> "x" set\r
+"x" get [ sq ] <arrow> "y" set\r
+\r
+4 "x" get set-model\r
+\r
+"y" get activate-model\r
+[ 16 ] [ "y" get value>> ] unit-test\r
+"y" get deactivate-model\r
diff --git a/basis/models/arrow/arrow.factor b/basis/models/arrow/arrow.factor
new file mode 100644 (file)
index 0000000..fcdfd16
--- /dev/null
@@ -0,0 +1,18 @@
+! Copyright (C) 2008, 2009 Slava Pestov.\r
+! See http://factorcode.org/license.txt for BSD license.\r
+USING: accessors models kernel call ;\r
+IN: models.arrow\r
+\r
+TUPLE: arrow < model model quot ;\r
+\r
+: <arrow> ( model quot -- arrow )\r
+    f arrow new-model\r
+        swap >>quot\r
+        over >>model\r
+        [ add-dependency ] keep ;\r
+\r
+M: arrow model-changed\r
+    [ [ value>> ] [ quot>> ] bi* call( old -- new ) ] [ nip ] 2bi\r
+    set-model ;\r
+\r
+M: arrow model-activated [ model>> ] keep model-changed ;\r
diff --git a/basis/models/arrow/summary.txt b/basis/models/arrow/summary.txt
new file mode 100644 (file)
index 0000000..d929dc3
--- /dev/null
@@ -0,0 +1 @@
+Arrow models apply a quotation to the value of an underlying model
diff --git a/basis/models/compose/compose-docs.factor b/basis/models/compose/compose-docs.factor
deleted file mode 100644 (file)
index 0f88499..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-USING: help.syntax help.markup kernel math classes classes.tuple\r
-calendar models ;\r
-IN: models.compose\r
-\r
-HELP: compose\r
-{ $class-description "Composed model values are computed by collecting the values from a sequence of underlying models into a new sequence. Composed models are automatically updated when underlying models change. Composed models are constructed by " { $link <compose> } "."\r
-$nl\r
-"A composed model whose children are all " { $link "models-range" } " conforms to the " { $link "range-model-protocol" } " and represents a point in n-dimensional space which is bounded by a rectangle." }\r
-{ $examples\r
-    "The following code displays a pair of sliders, and an updating label showing their current values:"\r
-    { $code\r
-        "USING: models ui.gadgets.labels ui.gadgets.sliders ui.gadgets.panes ;"\r
-        ": <funny-slider> <x-slider> 100 over set-slider-max ;"\r
-        "<funny-slider> <funny-slider> 2array"\r
-        "dup make-pile gadget."\r
-        "dup [ gadget-model ] map <compose> [ unparse ] <filter>"\r
-        "<label-control> gadget."\r
-    }\r
-} ;\r
-\r
-HELP: <compose>\r
-{ $values { "models" "a sequence of models" } { "compose" "a new " { $link compose } } }\r
-{ $description "Creates a new instance of " { $link compose } ". The value of the new compose model is obtained by mapping the " { $snippet "value" } " slot accessor over the given sequence of models." }\r
-{ $examples "See the example in the documentation for " { $link compose } "." } ;\r
-\r
-ARTICLE: "models-compose" "Composed models"\r
-"Composed model values are computed by collecting the values from a sequence of underlying models into a new sequence."\r
-{ $subsection compose }\r
-{ $subsection <compose> } ;\r
-\r
-ABOUT: "models-compose"\r
diff --git a/basis/models/compose/compose-tests.factor b/basis/models/compose/compose-tests.factor
deleted file mode 100644 (file)
index 0644bb6..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-USING: arrays generic kernel math models namespaces sequences assocs\r
-tools.test models.compose accessors locals ;\r
-IN: models.compose.tests\r
-\r
-! Test compose\r
-[ ] [\r
-    1 <model> "a" set\r
-    2 <model> "b" set\r
-    "a" get "b" get 2array <compose> "c" set\r
-] unit-test\r
-\r
-[ ] [ "c" get activate-model ] unit-test\r
-\r
-[ { 1 2 } ] [ "c" get value>> ] unit-test\r
-\r
-[ ] [ 3 "b" get set-model ] unit-test\r
-\r
-[ { 1 3 } ] [ "c" get value>> ] unit-test\r
-\r
-[ ] [ { 4 5 } "c" get set-model ] unit-test\r
-\r
-[ { 4 5 } ] [ "c" get value>> ] unit-test\r
-\r
-[ ] [ "c" get deactivate-model ] unit-test\r
-\r
-TUPLE: an-observer { i integer } ;\r
-\r
-M: an-observer model-changed nip [ 1+ ] change-i drop ;\r
-\r
-[ 1 0 ] [\r
-    [let* | m1 [ 1 <model> ]\r
-            m2 [ 2 <model> ]\r
-            c [ { m1 m2 } <compose> ]\r
-            o1 [ an-observer new ]\r
-            o2 [ an-observer new ] |\r
-        \r
-        o1 m1 add-connection\r
-        o2 m2 add-connection\r
-\r
-        c activate-model\r
-    \r
-        "OH HAI" m1 set-model\r
-        o1 i>>\r
-        o2 i>>\r
-    ]\r
-] unit-test
\ No newline at end of file
diff --git a/basis/models/compose/compose.factor b/basis/models/compose/compose.factor
deleted file mode 100644 (file)
index 386a067..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-! Copyright (C) 2008 Slava Pestov.\r
-! See http://factorcode.org/license.txt for BSD license.\r
-USING: accessors models kernel sequences ;\r
-IN: models.compose\r
-\r
-TUPLE: compose < model ;\r
-\r
-: new-compose ( models class -- compose )\r
-    f swap new-model\r
-        swap clone >>dependencies ; inline\r
-\r
-: <compose> ( models -- compose )\r
-    compose new-compose ;\r
-\r
-: composed-value [ dependencies>> ] dip map ; inline\r
-\r
-: set-composed-value [ dependencies>> ] dip 2each ; inline\r
-\r
-M: compose model-changed\r
-    nip\r
-    dup [ value>> ] composed-value >>value\r
-    notify-connections ;\r
-\r
-M: compose model-activated dup model-changed ;\r
-\r
-M: compose update-model\r
-    dup value>> swap [ set-model ] set-composed-value ;\r
-\r
-M: compose range-value\r
-    [ range-value ] composed-value ;\r
-\r
-M: compose range-page-value\r
-    [ range-page-value ] composed-value ;\r
-\r
-M: compose range-min-value\r
-    [ range-min-value ] composed-value ;\r
-\r
-M: compose range-max-value\r
-    [ range-max-value ] composed-value ;\r
-\r
-M: compose range-max-value*\r
-    [ range-max-value* ] composed-value ;\r
-\r
-M: compose set-range-value\r
-    [ clamp-value ] keep\r
-    [ set-range-value ] set-composed-value ;\r
-\r
-M: compose set-range-page-value\r
-    [ set-range-page-value ] set-composed-value ;\r
-\r
-M: compose set-range-min-value\r
-    [ set-range-min-value ] set-composed-value ;\r
-\r
-M: compose set-range-max-value\r
-    [ set-range-max-value ] set-composed-value ;\r
diff --git a/basis/models/compose/summary.txt b/basis/models/compose/summary.txt
deleted file mode 100644 (file)
index 962b30a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Composed models combine the values of a sequence of models into one
index 1f7aff12862d6f58538ce1e9db8bc575ebc88341..be3a2b3b594b46f781cc934c0dbea8d7f2eebacb 100644 (file)
@@ -7,11 +7,15 @@ HELP: delay
 { $examples\r
     "The following code displays a sliders and a label which is updated half a second after the slider stops changing:"\r
     { $code\r
-        "USING: models ui.gadgets.labels ui.gadgets.sliders ui.gadgets.panes calendar ;"\r
-        ": <funny-slider>"\r
-        "    0 0 0 100 <range> <x-slider> 500 over set-slider-max ;"\r
+        "USING: models models.delay models.arrow models.range"\r
+        "ui.gadgets ui.gadgets.labels ui.gadgets.sliders ui.gadgets.panes"\r
+        "math.parser calendar ;"\r
+        ""\r
+        ": <funny-slider> ( -- slider )"\r
+        "    0 10 0 100 <range> horizontal <slider> ;"\r
+        ""\r
         "<funny-slider> dup gadget."\r
-        "gadget-model 1/2 seconds <delay> [ number>string ] <filter>"\r
+        "model>> 1/2 seconds <delay> [ unparse ] <arrow>"\r
         "<label-control> gadget."\r
     }\r
 } ;\r
diff --git a/basis/models/filter/filter-docs.factor b/basis/models/filter/filter-docs.factor
deleted file mode 100644 (file)
index c3f4df3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-USING: help.syntax help.markup kernel math classes classes.tuple\r
-calendar models ;\r
-IN: models.filter\r
-\r
-HELP: filter\r
-{ $class-description "Filter model values are computed by applying a quotation to the value of another model. Filters are automatically updated when the underlying model changes. Filters are constructed by " { $link <filter> } "." }\r
-{ $examples\r
-    "The following code displays a label showing the result of applying " { $link sq } " to the value 5:"\r
-    { $code\r
-        "USING: models ui.gadgets.labels ui.gadgets.panes ;"\r
-        "5 <model> [ sq ] <filter> [ number>string ] <filter>"\r
-        "<label-control> gadget."\r
-    }\r
-    "An exercise for the reader is to keep the original model around on the stack, and change its value to 6, observing that the label will immediately display 36."\r
-} ;\r
-\r
-HELP: <filter>\r
-{ $values { "model" model } { "quot" { $quotation "( obj -- newobj )" } } { "filter" "a new " { $link filter } } }\r
-{ $description "Creates a new instance of " { $link filter } ". The value of the new filter model is computed by applying the quotation to the value." }\r
-{ $examples "See the example in the documentation for " { $link filter } "." } ;\r
-\r
-ARTICLE: "models-filter" "Filter models"\r
-"Filter model values are computed by applying a quotation to the value of another model."\r
-{ $subsection filter }\r
-{ $subsection <filter> } ;\r
-\r
-ABOUT: "models-filter"\r
diff --git a/basis/models/filter/filter-tests.factor b/basis/models/filter/filter-tests.factor
deleted file mode 100644 (file)
index ad43568..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-USING: arrays generic kernel math models namespaces sequences assocs\r
-tools.test models.filter accessors ;\r
-IN: models.filter.tests\r
-\r
-! Test multiple filters\r
-3 <model> "x" set\r
-"x" get [ 2 * ] <filter> dup "z" set\r
-[ 1+ ] <filter> "y" set\r
-[ ] [ "y" get activate-model ] unit-test\r
-[ t ] [ "z" get "x" get connections>> memq? ] unit-test\r
-[ 7 ] [ "y" get value>> ] unit-test\r
-[ ] [ 4 "x" get set-model ] unit-test\r
-[ 9 ] [ "y" get value>> ] unit-test\r
-[ ] [ "y" get deactivate-model ] unit-test\r
-[ f ] [ "z" get "x" get connections>> memq? ] unit-test\r
-\r
-3 <model> "x" set\r
-"x" get [ sq ] <filter> "y" set\r
-\r
-4 "x" get set-model\r
-\r
-"y" get activate-model\r
-[ 16 ] [ "y" get value>> ] unit-test\r
-"y" get deactivate-model\r
diff --git a/basis/models/filter/filter.factor b/basis/models/filter/filter.factor
deleted file mode 100644 (file)
index b16bdc9..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-! Copyright (C) 2008 Slava Pestov.\r
-! See http://factorcode.org/license.txt for BSD license.\r
-USING: accessors models kernel ;\r
-IN: models.filter\r
-\r
-TUPLE: filter < model model quot ;\r
-\r
-: <filter> ( model quot -- filter )\r
-    f filter new-model\r
-        swap >>quot\r
-        over >>model\r
-        [ add-dependency ] keep ;\r
-\r
-M: filter model-changed\r
-    [ [ value>> ] [ quot>> ] bi* call ] [ nip ] 2bi set-model ;\r
-\r
-M: filter model-activated [ model>> ] keep model-changed ;\r
diff --git a/basis/models/filter/summary.txt b/basis/models/filter/summary.txt
deleted file mode 100644 (file)
index a8267ac..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Filter models apply a quotation to the value of an underlying model
index 5295420ee31bab34412eb5623c2962f55fa36e73..4db71c459567b92a63364dcde8ef7cc8b49efaf0 100644 (file)
@@ -130,8 +130,8 @@ $nl
 { $subsection activate-model }
 { $subsection deactivate-model }
 { $subsection "models-impl" }
-{ $subsection "models-filter" }
-{ $subsection "models-compose" }
+{ $subsection "models.arrow" }
+{ $subsection "models.product" }
 { $subsection "models-history" }
 { $subsection "models-range" }
 { $subsection "models-delay" } ;
index fe10d3ab8e435e0777aeb1167e81ed269d4dee70..67155b83032f2ae6d877a63a45ab756bdfd99d81 100644 (file)
@@ -1,4 +1,4 @@
-USING: arrays generic kernel math models models.compose
+USING: arrays generic kernel math models models.product
 namespaces sequences assocs accessors tools.test ;
 IN: models.tests
 
@@ -16,7 +16,7 @@ M: model-tester model-changed nip t >>hit? drop ;
 
 3 <model> "model-a" set
 4 <model> "model-b" set
-"model-a" get "model-b" get 2array <compose> "model-c" set
+"model-a" get "model-b" get 2array <product> "model-c" set
 
 "model-c" get activate-model
 [ { 3 4 } ] [ "model-c" get value>>  ] unit-test
@@ -31,3 +31,6 @@ T{ model-tester f f } "tester" set
     "tester" get
     "model-c" get value>>
 ] unit-test
+
+\ model-changed must-infer
+\ set-model must-infer
index 5da564b9d08fed793d59b8761504c7c3cbd1985e..4f7aafe3e33ac1b4093b90a50a152c9593cbbfc8 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2006, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors generic kernel math sequences arrays assocs
-alarms calendar math.order ;
+alarms calendar math.order continuations fry ;
 IN: models
 
 TUPLE: model < identity-tuple
@@ -68,10 +68,9 @@ GENERIC: model-changed ( model observer -- )
     drop ;
 
 : with-locked-model ( model quot -- )
-    swap
-    t >>locked?
-    slip
-    f >>locked? drop ; inline
+    [ '[ _ t >>locked? @ ] ]
+    [ drop '[ _ f >>locked? drop ] ]
+    2bi [ ] cleanup ; inline
 
 GENERIC: update-model ( model -- )
 
@@ -84,7 +83,7 @@ M: model update-model drop ;
     dup locked?>> [
         2drop
     ] [
-        dup [
+        [
             swap >>value
             [ update-model ] [ notify-connections ] bi
         ] with-locked-model
diff --git a/basis/models/product/product-docs.factor b/basis/models/product/product-docs.factor
new file mode 100644 (file)
index 0000000..a74f30f
--- /dev/null
@@ -0,0 +1,36 @@
+USING: help.syntax help.markup kernel math classes classes.tuple\r
+calendar models ;\r
+IN: models.product\r
+\r
+HELP: product\r
+{ $class-description "Product model values are computed by collecting the values from a sequence of underlying models into a new sequence. Product models are automatically updated when underlying models change. Product models are constructed by " { $link <product> } "."\r
+$nl\r
+"A product model whose children are all " { $link "models-range" } " conforms to the " { $link "range-model-protocol" } " and represents a point in n-dimensional space which is bounded by a rectangle." }\r
+{ $examples\r
+    "The following code displays a pair of sliders, and an updating label showing their current values:"\r
+    { $code\r
+        "USING: models models.product models.range ui.gadgets"\r
+        "ui.gadgets.labels ui.gadgets.packs ui.gadgets.panes"\r
+        "ui.gadgets.sliders ;"\r
+        ""\r
+        ": <funny-model> ( -- model ) 0 10 0 100 <range> ;"\r
+        ": <funny-slider> ( model -- slider ) horizontal <slider> ;"\r
+        ""\r
+        "<funny-model> <funny-model> 2array"\r
+        "[ <pile> [ horizontal <slider> add-gadget ] reduce gadget. ]"\r
+        "[ <product> [ unparse ] <arrow> <label-control> gadget. ]"\r
+        "bi"\r
+    }\r
+} ;\r
+\r
+HELP: <product>\r
+{ $values { "models" "a sequence of models" } { "product" "a new " { $link product } } }\r
+{ $description "Creates a new instance of " { $link product } ". The value of the new product model is obtained by mapping the " { $snippet "value" } " slot accessor over the given sequence of models." }\r
+{ $examples "See the example in the documentation for " { $link product } "." } ;\r
+\r
+ARTICLE: "models.product" "Product models"\r
+"Product model values are computed by collecting the values from a sequence of underlying models into a new sequence."\r
+{ $subsection product }\r
+{ $subsection <product> } ;\r
+\r
+ABOUT: "models.product"\r
diff --git a/basis/models/product/product-tests.factor b/basis/models/product/product-tests.factor
new file mode 100644 (file)
index 0000000..84ac738
--- /dev/null
@@ -0,0 +1,45 @@
+USING: arrays generic kernel math models namespaces sequences assocs\r
+tools.test models.product accessors locals ;\r
+IN: models.product.tests\r
+\r
+[ ] [\r
+    1 <model> "a" set\r
+    2 <model> "b" set\r
+    "a" get "b" get 2array <product> "c" set\r
+] unit-test\r
+\r
+[ ] [ "c" get activate-model ] unit-test\r
+\r
+[ { 1 2 } ] [ "c" get value>> ] unit-test\r
+\r
+[ ] [ 3 "b" get set-model ] unit-test\r
+\r
+[ { 1 3 } ] [ "c" get value>> ] unit-test\r
+\r
+[ ] [ { 4 5 } "c" get set-model ] unit-test\r
+\r
+[ { 4 5 } ] [ "c" get value>> ] unit-test\r
+\r
+[ ] [ "c" get deactivate-model ] unit-test\r
+\r
+TUPLE: an-observer { i integer } ;\r
+\r
+M: an-observer model-changed nip [ 1+ ] change-i drop ;\r
+\r
+[ 1 0 ] [\r
+    [let* | m1 [ 1 <model> ]\r
+            m2 [ 2 <model> ]\r
+            c [ { m1 m2 } <product> ]\r
+            o1 [ an-observer new ]\r
+            o2 [ an-observer new ] |\r
+        \r
+        o1 m1 add-connection\r
+        o2 m2 add-connection\r
+\r
+        c activate-model\r
+    \r
+        "OH HAI" m1 set-model\r
+        o1 i>>\r
+        o2 i>>\r
+    ]\r
+] unit-test
\ No newline at end of file
diff --git a/basis/models/product/product.factor b/basis/models/product/product.factor
new file mode 100644 (file)
index 0000000..efce437
--- /dev/null
@@ -0,0 +1,57 @@
+! Copyright (C) 2008 Slava Pestov.\r
+! See http://factorcode.org/license.txt for BSD license.\r
+USING: accessors models kernel sequences ;\r
+IN: models.product\r
+\r
+TUPLE: product < model ;\r
+\r
+: new-product ( models class -- product )\r
+    f swap new-model\r
+        swap clone >>dependencies ; inline\r
+\r
+: <product> ( models -- product )\r
+    product new-product ;\r
+\r
+: product-value ( model quot -- seq )\r
+    [ dependencies>> ] dip map ; inline\r
+\r
+: set-product-value ( seq model quot -- )\r
+    [ dependencies>> ] dip 2each ; inline\r
+\r
+M: product model-changed\r
+    nip\r
+    dup [ value>> ] product-value >>value\r
+    notify-connections ;\r
+\r
+M: product model-activated dup model-changed ;\r
+\r
+M: product update-model\r
+    dup value>> swap [ set-model ] set-product-value ;\r
+\r
+M: product range-value\r
+    [ range-value ] product-value ;\r
+\r
+M: product range-page-value\r
+    [ range-page-value ] product-value ;\r
+\r
+M: product range-min-value\r
+    [ range-min-value ] product-value ;\r
+\r
+M: product range-max-value\r
+    [ range-max-value ] product-value ;\r
+\r
+M: product range-max-value*\r
+    [ range-max-value* ] product-value ;\r
+\r
+M: product set-range-value\r
+    [ clamp-value ] keep\r
+    [ set-range-value ] set-product-value ;\r
+\r
+M: product set-range-page-value\r
+    [ set-range-page-value ] set-product-value ;\r
+\r
+M: product set-range-min-value\r
+    [ set-range-min-value ] set-product-value ;\r
+\r
+M: product set-range-max-value\r
+    [ set-range-max-value ] set-product-value ;\r
diff --git a/basis/models/product/summary.txt b/basis/models/product/summary.txt
new file mode 100644 (file)
index 0000000..ee2de60
--- /dev/null
@@ -0,0 +1 @@
+Product models combine the values of a sequence of models into one
index 6a767b2e134c31e709a175aff5c9fc4cbaa9ea9e..1adba493b46210e36d65187511f32a2a732dec37 100644 (file)
@@ -6,6 +6,10 @@ HELP: range
 { $class-description "Range models implement the " { $link "range-model-protocol" } " with real numbers as the minimum, current, maximum, and page size. Range models are created with " { $link <range> } "." }\r
 { $notes { $link "ui.gadgets.sliders" } " use range models." } ;\r
 \r
+HELP: <range>\r
+{ $values { "value" real } { "page" real } { "min" real } { "max" real } { "range" range } }\r
+{ $description "Creates a new " { $link range } " model." } ;\r
+\r
 HELP: range-model\r
 { $values { "range" range } { "model" model } }\r
 { $description "Outputs a model holding a range model's current value." }\r
index 53d99ab1620bc6251444493eb65bef055a20ce49..a1abd9aeea1b79fc3254b12b441e73066301f4b1 100644 (file)
@@ -1,13 +1,13 @@
 ! Copyright (C) 2008 Slava Pestov.\r
 ! See http://factorcode.org/license.txt for BSD license.\r
 USING: accessors kernel models arrays sequences math math.order\r
-models.compose ;\r
+models.product ;\r
 IN: models.range\r
 \r
-TUPLE: range < compose ;\r
+TUPLE: range < product ;\r
 \r
 : <range> ( value page min max -- range )\r
-    4array [ <model> ] map range new-compose ;\r
+    4array [ <model> ] map range new-product ;\r
 \r
 : range-model ( range -- model ) dependencies>> first ;\r
 : range-page ( range -- model ) dependencies>> second ;\r
diff --git a/basis/models/search/search.factor b/basis/models/search/search.factor
new file mode 100644 (file)
index 0000000..4bf74b3
--- /dev/null
@@ -0,0 +1,12 @@
+! Copyright (C) 2008, 2009 Slava Pestov
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays fry kernel models.product models.arrow
+sequences unicode.case ;
+IN: models.search
+
+: <search> ( values search quot -- model )
+    [ 2array <product> ] dip
+    '[ first2 _ curry filter ] <arrow> ;
+
+: <string-search> ( values search quot -- model )
+    '[ swap @ [ >case-fold ] bi@ subseq? ] <search> ;
diff --git a/basis/models/sort/sort.factor b/basis/models/sort/sort.factor
new file mode 100644 (file)
index 0000000..23c1507
--- /dev/null
@@ -0,0 +1,8 @@
+! Copyright (C) 2008 Slava Pestov
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays fry kernel models.product models.arrow
+sequences sorting ;
+IN: models.sort
+
+: <sort> ( values sort -- model )
+    2array <product> [ first2 sort ] <arrow> ;
\ No newline at end of file
index adc4d6f7740b097245bad53931b0581c0b554b92..83331decee86edf544e4ba1a9f0dd3f50c7a8ea7 100644 (file)
@@ -8,7 +8,7 @@ ARTICLE: "opengl-low-level" "OpenGL binding"
   { $subsection "opengl-geometric-primitives" }
   { $subsection "opengl-modeling-transformations" } ;
 
-ARTICLE: "opengl-specifying-vertices" "Specifying Vertices"
+ARTICLE: "opengl-specifying-vertices" "Specifying vertices"
 
   { $subsection glVertex2d }
   { $subsection glVertex2f }
@@ -35,7 +35,7 @@ ARTICLE: "opengl-specifying-vertices" "Specifying Vertices"
   { $subsection glVertex4iv }
   { $subsection glVertex4sv } ;
 
-ARTICLE: "opengl-geometric-primitives" "OpenGL Geometric Primitives"
+ARTICLE: "opengl-geometric-primitives" "OpenGL geometric primitives"
 
   { $table
       { { $link GL_POINTS         } "individual points" }
@@ -70,7 +70,7 @@ HELP: glPolygonMode
                          { $link GL_LINE }
                          { $link GL_FILL } } } } } ;
 
-ARTICLE: "opengl-modeling-transformations" "Modeling Transformations"
+ARTICLE: "opengl-modeling-transformations" "Modeling transformations"
   { $subsection glTranslatef }
   { $subsection glTranslated }
   { $subsection glRotatef }
index b1ea89178bf22f2e09ab3473ec7ef06cd1dc049a..acff2dcd9e0a7b04b5b1e418b56e51052b9af0ea 100644 (file)
@@ -1,10 +1,11 @@
-USING: help.markup help.syntax io kernel math quotations
-opengl.gl assocs vocabs.loader sequences accessors ;
+USING: alien help.markup help.syntax io kernel math quotations
+opengl.gl assocs vocabs.loader sequences accessors colors ;
 IN: opengl
 
 HELP: gl-color
-{ $values { "color" "a color specifier" } }
-{ $description "Wrapper for " { $link glColor4d } " taking a color specifier." } ;
+{ $values { "color" color } }
+{ $description "Wrapper for " { $link glColor4d } " taking an instance of " { $link color } "." }
+{ $notes "See " { $link "colors" } "." } ;
 
 HELP: gl-error
 { $description "If the most recent OpenGL call resulted in an error, print the error to " { $link output-stream } "." } ;
@@ -29,23 +30,14 @@ HELP: gl-rect
 { $values { "dim" "a pair of integers" } }
 { $description "Draws the outline of a rectangle with the top-left corner at the origin and the given dimensions." } ;
 
-HELP: gen-texture
-{ $values { "id" integer } }
-{ $description "Wrapper for " { $link glGenTextures } " to handle the common case of generating a single texture ID." } ;
-
 HELP: gen-gl-buffer
 { $values { "id" integer } }
 { $description "Wrapper for " { $link glGenBuffers } " to handle the common case of generating a single buffer ID." } ;
 
-HELP: delete-texture
-{ $values { "id" integer } }
-{ $description "Wrapper for " { $link glDeleteTextures } " to handle the common case of deleting a single texture ID." } ;
-
 HELP: delete-gl-buffer
 { $values { "id" integer } }
 { $description "Wrapper for " { $link glDeleteBuffers } " to handle the common case of deleting a single buffer ID." } ;
 
-{ gen-texture delete-texture } related-words
 { gen-gl-buffer delete-gl-buffer } related-words
 
 HELP: bind-texture-unit
@@ -60,21 +52,6 @@ HELP: do-attribs
 { $values { "bits" integer } { "quot" quotation } }
 { $description "Wraps a quotation in " { $link glPushAttrib } "/" { $link glPopAttrib } " calls." } ;
 
-HELP: sprite
-{ $class-description "A sprite is an OpenGL texture together with a display list which renders a textured quad. Sprites are used to draw text in the UI. Sprites have the following slots:"
-    { $list
-        { { $snippet "dlist" } " - an OpenGL display list ID" }
-        { { $snippet "texture" } " - an OpenGL texture ID" }
-        { { $snippet "loc" } " - top-left corner of the sprite" }
-        { { $snippet "dim" } " - dimensions of the sprite" }
-        { { $snippet "dim2" } " - dimensions of the sprite, rounded up to the nearest powers of two" }
-    }
-} ;
-
-HELP: gray-texture
-{ $values { "sprite" sprite } { "pixmap" "an alien or byte array" } { "id" "an OpenGL texture ID" } }
-{ $description "Creates a new OpenGL texture from a 1 byte per pixel image whose dimensions are equal to " { $snippet "dim2" } "." } ;
-
 HELP: gen-dlist
 { $values { "id" integer } }
 { $description "Wrapper for " { $link glGenLists } " to handle the common case of generating a single display list ID." } ;
@@ -87,15 +64,10 @@ HELP: gl-translate
 { $values { "point" "a pair of integers" } }
 { $description "Wrapper for " { $link glTranslated } " taking a point object." } ;
 
-HELP: free-sprites
-{ $values { "sprites" "a sequence of " { $link sprite } " instances" } }
-{ $description "Deallocates native resources associated toa  sequence of sprites." } ;
-
 HELP: with-translation
 { $values { "loc" "a pair of integers" } { "quot" quotation } }
 { $description "Calls the quotation with a translation by " { $snippet "loc" } " pixels applied to the current " { $link GL_MODELVIEW } " matrix, restoring the matrix when the quotation is done." } ;
 
-
 ARTICLE: "gl-utilities" "OpenGL utility words"
 "The " { $vocab-link "opengl" } " vocabulary implements some utility words to give OpenGL a more Factor-like feel."
 $nl
@@ -104,7 +76,6 @@ $nl
 "Wrappers:"
 { $subsection gl-color }
 { $subsection gl-translate }
-{ $subsection gen-texture }
 { $subsection bind-texture-unit }
 "Combinators:"
 { $subsection do-enabled }
index 6d9ac95965767fbe5cb5245b78394f1919da6401..4b2906db95aaf94bf951e744612bab12078f208c 100644 (file)
@@ -1,21 +1,17 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! Portions copyright (C) 2007 Eduardo Cavazos.
 ! Portions copyright (C) 2008 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types continuations kernel libc math macros
-namespaces math.vectors math.constants math.functions
-math.parser opengl.gl opengl.glu combinators arrays sequences
-splitting words byte-arrays assocs colors accessors
-generalizations locals fry specialized-arrays.float
-specialized-arrays.uint ;
+namespaces math.vectors math.parser opengl.gl opengl.glu
+combinators arrays sequences splitting words byte-arrays assocs
+colors colors.constants accessors generalizations locals fry
+specialized-arrays.float specialized-arrays.uint ;
 IN: opengl
 
-: color>raw ( object -- r g b a )
-    >rgba { [ red>> ] [ green>> ] [ blue>> ] [ alpha>> ] } cleave ; inline
+: gl-color ( color -- ) >rgba-components glColor4d ; inline
 
-: gl-color ( color -- ) color>raw glColor4d ; inline
-
-: gl-clear-color ( color -- ) color>raw glClearColor ;
+: gl-clear-color ( color -- ) >rgba-components glClearColor ;
 
 : gl-clear ( color -- )
     gl-clear-color GL_COLOR_BUFFER_BIT glClear ;
@@ -43,10 +39,10 @@ IN: opengl
     [ glDisableClientState ] each ; inline
 
 MACRO: all-enabled ( seq quot -- )
-    [ words>values ] dip [ (all-enabled) ] 2curry ;
+    [ words>values ] dip '[ _ _ (all-enabled) ] ;
 
 MACRO: all-enabled-client-state ( seq quot -- )
-    [ words>values ] dip [ (all-enabled-client-state) ] 2curry ;
+    [ words>values ] dip '[ _ (all-enabled-client-state) ] ;
 
 : do-matrix ( mode quot -- )
     swap [ glMatrixMode glPushMatrix call ] keep
@@ -109,48 +105,18 @@ MACRO: all-enabled-client-state ( seq quot -- )
 : gl-fill-rect ( dim -- )
     fill-rect-vertices (gl-fill-rect) ;
 
-: circle-steps ( steps -- angles )
-    dup length v/n 2 pi * v*n ;
-
-: unit-circle ( angles -- points1 points2 )
-    [ [ sin ] map ] [ [ cos ] map ] bi ;
-
-: adjust-points ( points1 points2 -- points1' points2' )
-    [ [ 1 + 0.5 * ] map ] bi@ ;
-
-: scale-points ( loc dim points1 points2 -- points )
-    zip [ v* ] with map [ v+ ] with map ;
-
-: circle-points ( loc dim steps -- points )
-    circle-steps unit-circle adjust-points scale-points ;
-
-: close-path ( points -- points' )
-    dup first suffix ;
-
-: circle-vertices ( loc dim steps -- vertices )
-    #! We use GL_LINE_STRIP with a duplicated first vertex
-    #! instead of GL_LINE_LOOP to work around a bug in Apple's
-    #! X3100 driver.
-    circle-points close-path concat >float-array ;
-
-: fill-circle-vertices ( loc dim steps -- vertices )
-    circle-points concat >float-array ;
+: do-attribs ( bits quot -- )
+    swap glPushAttrib call glPopAttrib ; inline
 
 : (gen-gl-object) ( quot -- id )
     [ 1 0 <uint> ] dip keep *uint ; inline
 
-: gen-texture ( -- id )
-    [ glGenTextures ] (gen-gl-object) ;
-
 : gen-gl-buffer ( -- id )
     [ glGenBuffers ] (gen-gl-object) ;
 
 : (delete-gl-object) ( id quot -- )
     [ 1 swap <uint> ] dip call ; inline
 
-: delete-texture ( id -- )
-    [ glDeleteTextures ] (delete-gl-object) ;
-
 : delete-gl-buffer ( id -- )
     [ glDeleteBuffers ] (delete-gl-object) ;
 
@@ -180,79 +146,20 @@ MACRO: all-enabled-client-state ( seq quot -- )
     [ length ] [ >uint-array ] bi glDrawBuffers ;
 
 MACRO: set-draw-buffers ( buffers -- )
-    words>values [ (set-draw-buffers) ] curry ;
-
-: do-attribs ( bits quot -- )
-    swap glPushAttrib call glPopAttrib ; inline
+    words>values '[ _ (set-draw-buffers) ] ;
 
 : gl-look-at ( eye focus up -- )
     [ first3 ] tri@ gluLookAt ;
 
-TUPLE: sprite loc dim dim2 dlist texture ;
-
-: <sprite> ( loc dim dim2 -- sprite )
-    f f sprite boa ;
-
-: sprite-size2 ( sprite -- w h ) dim2>> first2 ;
-
-: sprite-width ( sprite -- w ) dim>> first ;
-
-: gray-texture ( sprite pixmap -- id )
-    gen-texture [
-        GL_TEXTURE_BIT [
-            GL_TEXTURE_2D swap glBindTexture
-            [
-                [ GL_TEXTURE_2D 0 GL_RGBA ] dip
-                sprite-size2 0 GL_LUMINANCE_ALPHA
-                GL_UNSIGNED_BYTE
-            ] dip glTexImage2D
-        ] do-attribs
-    ] keep ;
-    
 : gen-dlist ( -- id ) 1 glGenLists ;
 
 : make-dlist ( type quot -- id )
-    gen-dlist [ rot glNewList call glEndList ] keep ; inline
-
-: init-texture ( -- )
-    GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER GL_LINEAR glTexParameteri
-    GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER GL_LINEAR glTexParameteri
-    GL_TEXTURE_2D GL_TEXTURE_WRAP_S GL_CLAMP glTexParameterf
-    GL_TEXTURE_2D GL_TEXTURE_WRAP_T GL_CLAMP glTexParameterf ;
+    [ gen-dlist ] 2dip '[ _ glNewList @ glEndList ] keep ; inline
 
 : gl-translate ( point -- ) first2 0.0 glTranslated ;
 
-: rect-texture-coords ( -- )
-    float-array{ 0 0 1 0 1 1 0 1 } gl-texture-coord-pointer ;
-
-: draw-sprite ( sprite -- )
-    GL_TEXTURE_COORD_ARRAY [
-        dup loc>> gl-translate
-        GL_TEXTURE_2D over texture>> glBindTexture
-        init-texture rect-texture-coords
-        dim2>> fill-rect-vertices
-        (gl-fill-rect)
-        GL_TEXTURE_2D 0 glBindTexture
-    ] do-enabled-client-state ;
-
-: make-sprite-dlist ( sprite -- id )
-    GL_MODELVIEW [
-        GL_COMPILE [ draw-sprite ] make-dlist
-    ] do-matrix ;
-
-: init-sprite ( texture sprite -- )
-    swap >>texture
-    dup make-sprite-dlist >>dlist drop ;
-
 : delete-dlist ( id -- ) 1 glDeleteLists ;
 
-: free-sprite ( sprite -- )
-    [ dlist>> delete-dlist ]
-    [ texture>> delete-texture ] bi ;
-
-: free-sprites ( sprites -- )
-    [ nip [ free-sprite ] when* ] assoc-each ;
-
 : with-translation ( loc quot -- )
     GL_MODELVIEW [ [ gl-translate ] dip call ] do-matrix ; inline
 
@@ -269,4 +176,4 @@ TUPLE: sprite loc dim dim2 dlist texture ;
     GL_PROJECTION glMatrixMode
     glLoadIdentity
     GL_MODELVIEW glMatrixMode
-    glLoadIdentity ;
+    glLoadIdentity ;
\ No newline at end of file
diff --git a/basis/opengl/textures/authors.txt b/basis/opengl/textures/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/opengl/textures/textures-docs.factor b/basis/opengl/textures/textures-docs.factor
new file mode 100644 (file)
index 0000000..b209ee5
--- /dev/null
@@ -0,0 +1,15 @@
+IN: opengl.textures
+USING: help.markup help.syntax opengl.gl opengl.textures.private math alien images ;
+
+HELP: gen-texture
+{ $values { "id" integer } }
+{ $description "Wrapper for " { $link glGenTextures } " to handle the common case of generating a single texture ID." } ;
+
+HELP: delete-texture
+{ $values { "id" integer } }
+{ $description "Wrapper for " { $link glDeleteTextures } " to handle the common case of deleting a single texture ID." } ;
+
+HELP: make-texture
+{ $values { "image" image } { "id" "an OpenGL texture ID" } }
+{ $description "Creates a new OpenGL texture from a pixmap image whose dimensions are equal to " { $snippet "dim" } "." } ;
+  
\ No newline at end of file
diff --git a/basis/opengl/textures/textures-tests.factor b/basis/opengl/textures/textures-tests.factor
new file mode 100644 (file)
index 0000000..45b1d8f
--- /dev/null
@@ -0,0 +1,51 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test opengl.textures opengl.textures.private
+images kernel namespaces ;
+IN: opengl.textures.tests
+
+[ ] [
+    { 3 5 }
+    RGB
+    B{
+        1 2 3 4 5 6 7 8 9
+        10 11 12 13 14 15 16 17 18
+        19 20 21 22 23 24 25 26 27
+        28 29 30 31 32 33 34 35 36
+        37 38 39 40 41 42 43 44 45
+    } image boa "image" set
+] unit-test
+
+[
+    T{ image
+        { dim { 4 8 } }
+        { component-order RGB }
+        { bitmap
+          B{
+              1 2 3 4 5 6 7 8 9 7 8 9
+              10 11 12 13 14 15 16 17 18 16 17 18
+              19 20 21 22 23 24 25 26 27 25 26 27
+              28 29 30 31 32 33 34 35 36 34 35 36
+              37 38 39 40 41 42 43 44 45 43 44 45
+              37 38 39 40 41 42 43 44 45 43 44 45
+              37 38 39 40 41 42 43 44 45 43 44 45
+              37 38 39 40 41 42 43 44 45 43 44 45
+          }
+        }
+    }
+] [
+    "image" get power-of-2-image
+] unit-test
+
+[
+    T{ image
+       { dim { 0 0 } }
+       { component-order R32G32B32 }
+       { bitmap B{ } } }
+] [
+    T{ image
+       { dim { 0 0 } }
+       { component-order R32G32B32 }
+       { bitmap B{ } }
+    } power-of-2-image
+] unit-test
\ No newline at end of file
diff --git a/basis/opengl/textures/textures.factor b/basis/opengl/textures/textures.factor
new file mode 100644 (file)
index 0000000..79af9be
--- /dev/null
@@ -0,0 +1,114 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors assocs cache colors.constants destructors fry kernel
+opengl opengl.gl combinators images grouping specialized-arrays.float
+locals sequences math math.vectors generalizations ;
+IN: opengl.textures
+
+: gen-texture ( -- id ) [ glGenTextures ] (gen-gl-object) ;
+
+: delete-texture ( id -- ) [ glDeleteTextures ] (delete-gl-object) ;
+
+TUPLE: texture loc dim texture-coords texture display-list disposed ;
+
+<PRIVATE
+
+GENERIC: component-order>format ( component-order -- format type )
+
+M: RGBA component-order>format drop GL_RGBA GL_UNSIGNED_BYTE ;
+M: ARGB component-order>format drop GL_BGRA_EXT GL_UNSIGNED_INT_8_8_8_8_REV ;
+M: BGRA component-order>format drop GL_BGRA_EXT GL_UNSIGNED_BYTE ;
+
+: repeat-last ( seq n -- seq' )
+    over peek pad-tail concat ;
+
+: power-of-2-bitmap ( rows dim size -- bitmap dim )
+    '[
+        first2
+        [ [ _ ] dip '[ _ group _ repeat-last ] map ]
+        [ repeat-last ]
+        bi*
+    ] keep ;
+
+: image-rows ( image -- rows )
+    [ bitmap>> ]
+    [ dim>> first ]
+    [ component-order>> bytes-per-pixel ]
+    tri * group ; inline
+
+: power-of-2-image ( image -- image )
+    dup dim>> [ 0 = ] all? [
+        clone dup
+        [ image-rows ]
+        [ dim>> [ next-power-of-2 ] map ]
+        [ component-order>> bytes-per-pixel ] tri
+        power-of-2-bitmap
+        [ >>bitmap ] [ >>dim ] bi*
+    ] unless ;
+
+:: make-texture ( image -- id )
+    gen-texture [
+        GL_TEXTURE_BIT [
+            GL_TEXTURE_2D swap glBindTexture
+            GL_TEXTURE_2D
+            0
+            GL_RGBA
+            image dim>> first2
+            0
+            image component-order>> component-order>format
+            image bitmap>>
+            glTexImage2D
+        ] do-attribs
+    ] keep ;
+
+: init-texture ( -- )
+    GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER GL_LINEAR glTexParameteri
+    GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER GL_LINEAR glTexParameteri
+    GL_TEXTURE_2D GL_TEXTURE_WRAP_S GL_REPEAT glTexParameteri
+    GL_TEXTURE_2D GL_TEXTURE_WRAP_T GL_REPEAT glTexParameteri ;
+
+: draw-textured-rect ( dim texture -- )
+    GL_TEXTURE_2D [
+        GL_TEXTURE_BIT [
+            GL_TEXTURE_COORD_ARRAY [
+                COLOR: white gl-color
+                dup loc>> [
+                    [ [ GL_TEXTURE_2D ] dip texture>> glBindTexture ]
+                    [ init-texture texture-coords>> gl-texture-coord-pointer ] bi
+                    fill-rect-vertices (gl-fill-rect)
+                    GL_TEXTURE_2D 0 glBindTexture
+                ] with-translation
+            ] do-enabled-client-state
+        ] do-attribs
+    ] do-enabled ;
+
+: texture-coords ( dim -- coords )
+    [ dup next-power-of-2 /f ] map
+    { { 0 0 } { 1 0 } { 1 1 } { 0 1 } } [ v* ] with map
+    float-array{ } join ;
+
+: make-texture-display-list ( texture -- dlist )
+    GL_COMPILE [ [ dim>> ] keep draw-textured-rect ] make-dlist ;
+
+PRIVATE>
+
+: <texture> ( image loc -- texture )
+    texture new swap >>loc
+    swap
+    [ dim>> >>dim ] keep
+    [ dim>> product 0 = ] keep '[
+        _
+        [ dim>> texture-coords >>texture-coords ]
+        [ power-of-2-image make-texture >>texture ] bi
+        dup make-texture-display-list >>display-list
+    ] unless ;
+
+M: texture dispose*
+    [ texture>> [ delete-texture ] when* ]
+    [ display-list>> [ delete-dlist ] when* ] bi ;
+
+: draw-texture ( texture -- )
+    display-list>> [ glCallList ] when* ;
+
+: draw-scaled-texture ( dim texture -- )
+    dup texture>> [ draw-textured-rect ] [ 2drop ] if ;
\ No newline at end of file
diff --git a/basis/pango/cairo/authors.txt b/basis/pango/cairo/authors.txt
new file mode 100644 (file)
index 0000000..367ba74
--- /dev/null
@@ -0,0 +1,2 @@
+Matthew Willis
+Slava Pestov
diff --git a/basis/pango/cairo/cairo.factor b/basis/pango/cairo/cairo.factor
new file mode 100644 (file)
index 0000000..7683b78
--- /dev/null
@@ -0,0 +1,88 @@
+! Copyright (C) 2008 Matthew Willis.
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+!
+! pangocairo bindings, from pango/pangocairo.h
+USING: alien alien.syntax combinators system cairo.ffi ;
+IN: pango.cairo
+
+<< {
+    { [ os winnt? ] [ "pangocairo" "libpangocairo-1.0-0.dll" "cdecl" add-library ] }
+    { [ os macosx? ] [ "pangocairo" "/opt/local/lib/libpangocairo-1.0.0.dylib" "cdecl" add-library ] }
+    { [ os unix? ] [ ] }
+} cond >>
+
+LIBRARY: pangocairo
+
+FUNCTION: PangoFontMap*
+pango_cairo_font_map_new ( ) ;
+
+FUNCTION: PangoFontMap*
+pango_cairo_font_map_new_for_font_type ( cairo_font_type_t fonttype ) ;
+
+FUNCTION: PangoFontMap*
+pango_cairo_font_map_get_default ( ) ;
+
+FUNCTION: cairo_font_type_t
+pango_cairo_font_map_get_font_type ( PangoCairoFontMap* fontmap ) ;
+
+FUNCTION: void
+pango_cairo_font_map_set_resolution ( PangoCairoFontMap* fontmap, double dpi ) ;
+
+FUNCTION: double
+pango_cairo_font_map_get_resolution ( PangoCairoFontMap* fontmap ) ;
+
+FUNCTION: PangoContext*
+pango_cairo_font_map_create_context ( PangoCairoFontMap* fontmap ) ;
+
+FUNCTION: cairo_scaled_font_t*
+pango_cairo_font_get_scaled_font ( PangoCairoFont* font ) ;
+
+! Update a Pango context for the current state of a cairo context
+FUNCTION: void
+pango_cairo_update_context ( cairo_t* cr, PangoContext* context ) ;
+
+FUNCTION: void
+pango_cairo_context_set_font_options ( PangoContext* context, cairo_font_options_t* options ) ;
+
+FUNCTION: cairo_font_options_t*
+pango_cairo_context_get_font_options ( PangoContext* context ) ;
+
+FUNCTION: void
+pango_cairo_context_set_resolution ( PangoContext* context, double dpi ) ;
+
+FUNCTION: double
+pango_cairo_context_get_resolution ( PangoContext* context ) ;
+
+! Convenience
+FUNCTION: PangoLayout*
+pango_cairo_create_layout ( cairo_t* cr ) ;
+
+FUNCTION: void
+pango_cairo_update_layout ( cairo_t* cr, PangoLayout* layout ) ;
+
+! Rendering
+FUNCTION: void
+pango_cairo_show_glyph_string ( cairo_t* cr, PangoFont* font, PangoGlyphString* glyphs ) ;
+
+FUNCTION: void
+pango_cairo_show_layout_line ( cairo_t* cr, PangoLayoutLine* line ) ;
+
+FUNCTION: void
+pango_cairo_show_layout ( cairo_t* cr, PangoLayout* layout ) ;
+
+FUNCTION: void
+pango_cairo_show_error_underline ( cairo_t* cr, double x, double y, double width, double height ) ;
+
+! Rendering to a path
+FUNCTION: void
+pango_cairo_glyph_string_path ( cairo_t* cr, PangoFont* font, PangoGlyphString* glyphs ) ;
+
+FUNCTION: void
+pango_cairo_layout_line_path  ( cairo_t* cr, PangoLayoutLine* line ) ;
+
+FUNCTION: void
+pango_cairo_layout_path ( cairo_t* cr, PangoLayout* layout ) ;
+
+FUNCTION: void
+pango_cairo_error_underline_path ( cairo_t* cr, double x, double y, double width, double height ) ;
\ No newline at end of file
diff --git a/basis/pango/fonts/authors.txt b/basis/pango/fonts/authors.txt
new file mode 100644 (file)
index 0000000..367ba74
--- /dev/null
@@ -0,0 +1,2 @@
+Matthew Willis
+Slava Pestov
diff --git a/basis/pango/fonts/fonts.factor b/basis/pango/fonts/fonts.factor
new file mode 100644 (file)
index 0000000..abfc086
--- /dev/null
@@ -0,0 +1,105 @@
+! Copyright (C) 2008 Matthew Willis.
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license
+USING: pango alien.syntax alien.c-types alien.destructors
+kernel glib accessors combinators destructors init fonts
+memoize math ;
+IN: pango.fonts
+
+LIBRARY: pango
+
+TYPEDEF: int PangoStyle
+C-ENUM:
+PANGO_STYLE_NORMAL
+PANGO_STYLE_OBLIQUE
+PANGO_STYLE_ITALIC ;
+
+TYPEDEF: int PangoWeight
+CONSTANT: PANGO_WEIGHT_THIN 100
+CONSTANT: PANGO_WEIGHT_ULTRALIGHT 200
+CONSTANT: PANGO_WEIGHT_LIGHT 300
+CONSTANT: PANGO_WEIGHT_BOOK 380
+CONSTANT: PANGO_WEIGHT_NORMAL 400
+CONSTANT: PANGO_WEIGHT_MEDIUM 500
+CONSTANT: PANGO_WEIGHT_SEMIBOLD 600
+CONSTANT: PANGO_WEIGHT_BOLD 700
+CONSTANT: PANGO_WEIGHT_ULTRABOLD 800
+CONSTANT: PANGO_WEIGHT_HEAVY 900
+CONSTANT: PANGO_WEIGHT_ULTRAHEAVY 1000
+
+FUNCTION: PangoFontDescription*
+pango_font_description_new ( ) ;
+
+FUNCTION: void
+pango_font_description_free ( PangoFontDescription* desc ) ;
+
+DESTRUCTOR: pango_font_description_free
+
+FUNCTION: PangoFontDescription*
+pango_font_description_from_string ( char* str ) ;
+
+FUNCTION: char*
+pango_font_description_to_string ( PangoFontDescription* desc ) ;
+
+FUNCTION: char*
+pango_font_description_to_filename ( PangoFontDescription* desc ) ;
+
+FUNCTION: void
+pango_font_description_set_family ( PangoFontDescription* desc, char* family ) ;
+
+FUNCTION: void
+pango_font_description_set_style ( PangoFontDescription* desc, PangoStyle style ) ;
+
+FUNCTION: void
+pango_font_description_set_weight ( PangoFontDescription* desc, PangoWeight weight ) ;
+
+FUNCTION: void
+pango_font_description_set_size ( PangoFontDescription* desc, gint size ) ;
+
+FUNCTION: void
+pango_font_map_list_families ( PangoFontMap* fontmap, PangoFontFamily*** families, int* n_families ) ;
+
+FUNCTION: char*
+pango_font_family_get_name ( PangoFontFamily* family ) ;
+
+FUNCTION: int
+pango_font_family_is_monospace ( PangoFontFamily* family ) ;
+
+FUNCTION: void
+pango_font_family_list_faces ( PangoFontFamily* family, PangoFontFace*** faces, int* n_faces ) ;
+
+FUNCTION: char*
+pango_font_face_get_face_name ( PangoFontFace* face ) ;
+
+FUNCTION: void
+pango_font_face_list_sizes ( PangoFontFace* face, int** sizes, int* n_sizes ) ;
+
+FUNCTION: void pango_font_metrics_unref ( PangoFontMetrics* metrics ) ;
+
+DESTRUCTOR: pango_font_metrics_unref
+
+FUNCTION: int pango_font_metrics_get_ascent ( PangoFontMetrics* metrics ) ;
+
+FUNCTION: int pango_font_metrics_get_descent ( PangoFontMetrics* metrics ) ;
+
+FUNCTION: PangoFont* pango_font_map_load_font ( PangoFontMap* fontmap, PangoContext* context, PangoFontDescription* desc ) ;
+
+FUNCTION: PangoFontMetrics* pango_context_get_metrics ( PangoContext* context, PangoFontDescription* desc, PangoLanguage* language ) ;
+
+FUNCTION: PangoFontMetrics* pango_font_get_metrics ( PangoFont* font, PangoLanguage* language ) ;
+                                                         
+MEMO: (cache-font-description) ( font -- description )
+    [
+        [ pango_font_description_new |pango_font_description_free ] dip {
+            [ name>> pango_font_description_set_family ]
+            [ size>> float>pango pango_font_description_set_size ]
+            [ bold?>> PANGO_WEIGHT_BOLD PANGO_WEIGHT_NORMAL ? pango_font_description_set_weight ]
+            [ italic?>> PANGO_STYLE_ITALIC PANGO_STYLE_NORMAL ? pango_font_description_set_style ]
+            [ drop ]
+        } 2cleave
+    ] with-destructors ;
+
+: cache-font-description ( font -- description )
+    strip-font-colors (cache-font-description) ;
+
+[ \ (cache-font-description) reset-memoized ] "pango.fonts" add-init-hook
\ No newline at end of file
diff --git a/basis/pango/fonts/tags.txt b/basis/pango/fonts/tags.txt
new file mode 100644 (file)
index 0000000..bb863cf
--- /dev/null
@@ -0,0 +1 @@
+bindings
diff --git a/basis/pango/layouts/layouts-tests.factor b/basis/pango/layouts/layouts-tests.factor
new file mode 100644 (file)
index 0000000..5959edd
--- /dev/null
@@ -0,0 +1,11 @@
+IN: pango.layouts.tests
+USING: pango.layouts tools.test glib fonts accessors
+sequences combinators.short-circuit math destructors ;
+
+[ t ] [
+    [
+        <font> "Helvetica" >>name 12 >>size
+        "OH, HAI"
+        cached-layout ink-rect>> dim>>
+    ] with-destructors [ 0 > ] all?
+] unit-test
\ No newline at end of file
diff --git a/basis/pango/layouts/layouts.factor b/basis/pango/layouts/layouts.factor
new file mode 100644 (file)
index 0000000..defcdec
--- /dev/null
@@ -0,0 +1,208 @@
+! Copyright (C) 2008 Matthew Willis.
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays sequences alien alien.c-types alien.destructors
+alien.syntax math math.functions math.vectors destructors combinators
+colors fonts accessors assocs namespaces kernel pango pango.fonts
+pango.cairo cairo cairo.ffi glib unicode.data images cache init
+math.rectangles fry memoize io.encodings.utf8 ;
+IN: pango.layouts
+
+LIBRARY: pango
+
+FUNCTION: PangoLayout*
+pango_layout_new ( PangoContext* context ) ;
+
+FUNCTION: PangoContext*
+pango_layout_get_context ( PangoLayout* layout ) ;
+
+FUNCTION: void
+pango_layout_set_text ( PangoLayout* layout, char* text, int length ) ;
+
+FUNCTION: char*
+pango_layout_get_text ( PangoLayout* layout ) ;
+
+FUNCTION: void
+pango_layout_get_size ( PangoLayout* layout, int* width, int* height ) ;
+
+FUNCTION: void
+pango_layout_set_font_description ( PangoLayout* layout, PangoFontDescription* desc ) ;
+
+FUNCTION: PangoFontDescription*
+pango_layout_get_font_description ( PangoLayout* layout ) ;
+
+FUNCTION: void
+pango_layout_get_pixel_size ( PangoLayout* layout, int* width, int* height ) ;
+
+FUNCTION: void
+pango_layout_get_extents ( PangoLayout* layout, PangoRectangle* ink_rect, PangoRectangle* logical_rect ) ;
+
+FUNCTION: void
+pango_layout_get_pixel_extents ( PangoLayout* layout, PangoRectangle* ink_rect, PangoRectangle* logical_rect ) ;
+
+FUNCTION: PangoLayoutLine*
+pango_layout_get_line_readonly ( PangoLayout* layout, int line ) ;
+                                                         
+FUNCTION: void
+pango_layout_line_index_to_x ( PangoLayoutLine* line, int index_, gboolean trailing, int* x_pos ) ;
+
+FUNCTION: gboolean
+pango_layout_line_x_to_index ( PangoLayoutLine* line, int x_pos, int* index_, int* trailing ) ;
+
+FUNCTION: PangoLayoutIter*
+pango_layout_get_iter ( PangoLayout* layout ) ;
+
+FUNCTION: int
+pango_layout_iter_get_baseline ( PangoLayoutIter* iter ) ;
+
+FUNCTION: void
+pango_layout_iter_free ( PangoLayoutIter* iter ) ;
+
+DESTRUCTOR: pango_layout_iter_free
+
+TUPLE: layout font string selection layout metrics ink-rect logical-rect image disposed ;
+
+SYMBOL: dpi
+
+72 dpi set-global
+
+: set-layout-font ( font layout -- )
+    swap cache-font-description pango_layout_set_font_description ;
+
+: set-layout-text ( str layout -- )
+    #! Replace nulls with something else since Pango uses null-terminated
+    #! strings
+    swap -1 pango_layout_set_text ;
+
+: set-layout-resolution ( layout -- )
+    pango_layout_get_context dpi get pango_cairo_context_set_resolution ;
+
+: <PangoLayout> ( text font -- layout )
+    dummy-cairo pango_cairo_create_layout |g_object_unref
+    [ set-layout-resolution ] keep
+    [ set-layout-font ] keep
+    [ set-layout-text ] keep ;
+
+: layout-extents ( layout -- ink-rect logical-rect )
+    "PangoRectangle" <c-object>
+    "PangoRectangle" <c-object>
+    [ pango_layout_get_extents ] 2keep
+    [ PangoRectangle>rect ] bi@ ;
+
+: glyph-height ( font string -- y )
+    swap <PangoLayout> &g_object_unref layout-extents drop dim>> second ;
+
+MEMO: missing-font-metrics ( font -- metrics )
+    #! Pango doesn't provide x-height and cap-height but Core Text does, so we
+    #! simulate them on Pango.
+    [
+        [ metrics new ] dip
+        [ "x" glyph-height >>x-height ]
+        [ "Y" glyph-height >>cap-height ] bi
+    ] with-destructors ;
+
+: layout-baseline ( layout -- baseline )
+    pango_layout_get_iter &pango_layout_iter_free
+    pango_layout_iter_get_baseline
+    pango>float ;
+
+: set-foreground ( cr font -- )
+    foreground>> set-source-color ;
+
+: fill-background ( cr font dim -- )
+    [ background>> set-source-color ]
+    [ [ { 0 0 } ] dip <rect> fill-rect ] bi-curry* bi ;
+
+: rect-translate-x ( rect x -- rect' )
+    '[ _ 0 2array v- ] change-loc ;
+
+: first-line ( layout -- line )
+    layout>> 0 pango_layout_get_line_readonly ;
+
+: line-offset>x ( layout n -- x )
+    #! n is an index into the UTF8 encoding of the text
+    [ drop first-line ] [ swap string>> >utf8-index ] 2bi
+    f 0 <int> [ pango_layout_line_index_to_x ] keep
+    *int pango>float ;
+
+: x>line-offset ( layout x -- n )
+    #! n is an index into the UTF8 encoding of the text
+    [
+        [ first-line ] dip
+        float>pango 0 <int> 0 <int>
+        [ pango_layout_line_x_to_index drop ] 2keep
+        [ *int ] bi@ swap
+    ] [ drop string>> ] 2bi utf8-index> + ;
+
+: selection-start/end ( selection -- start end )
+    selection>> [ start>> ] [ end>> ] bi ;
+
+: selection-rect ( layout -- rect )
+    [ ink-rect>> dim>> ] [ ] [ selection-start/end ] tri [ line-offset>x ] bi-curry@ bi
+    [ drop nip 0 2array ] [ swap - swap second 2array ] 3bi <rect> ;
+
+: fill-selection-background ( cr layout -- )
+    dup selection>> [
+        [ selection>> color>> set-source-color ]
+        [
+            [ selection-rect ] [ ink-rect>> loc>> first ] bi
+            rect-translate-x
+            fill-rect
+        ] 2bi
+    ] [ 2drop ] if ;
+
+: text-position ( layout -- loc )
+    [ logical-rect>> ] [ ink-rect>> ] bi [ loc>> ] bi@ v- ;
+
+: set-text-position ( cr loc -- )
+    first2 cairo_move_to ;
+
+: layout-metrics ( layout -- metrics )
+    dup font>> missing-font-metrics clone
+        swap
+        [ layout>> layout-baseline >>ascent ]
+        [ logical-rect>> dim>> [ first >>width ] [ second >>height ] bi ] bi
+        dup [ height>> ] [ ascent>> ] bi - >>descent ;
+
+: draw-layout ( layout -- image )
+    dup ink-rect>> dim>> [ >fixnum ] map [
+        swap {
+            [ layout>> pango_cairo_update_layout ]
+            [ [ font>> ] [ ink-rect>> dim>> ] bi fill-background ]
+            [ fill-selection-background ]
+            [ text-position set-text-position ]
+            [ font>> set-foreground ]
+            [ layout>> pango_cairo_show_layout ]
+        } 2cleave
+    ] make-bitmap-image ;
+
+: escape-nulls ( str -- str' )
+    { { 0 CHAR: zero-width-no-break-space } } substitute ;
+
+: unpack-selection ( layout string/selection -- layout )
+    dup selection? [
+        [ string>> escape-nulls >>string ] [ >>selection ] bi
+    ] [ escape-nulls >>string ] if ; inline
+
+: <layout> ( font string -- line )
+    [
+        layout new
+            swap unpack-selection
+            swap >>font
+            dup [ string>> ] [ font>> ] bi <PangoLayout> >>layout
+            dup layout>> layout-extents [ >>ink-rect ] [ >>logical-rect ] bi*
+            dup layout-metrics >>metrics
+            dup draw-layout >>image
+    ] with-destructors ;
+
+M: layout dispose* layout>> g_object_unref ;
+
+SYMBOL: cached-layouts
+
+: cached-layout ( font string -- layout )
+    cached-layouts get [ <layout> ] 2cache ;
+
+: cached-line ( font string -- line )
+    cached-layout layout>> first-line ;
+
+[ <cache-assoc> cached-layouts set-global ] "pango.layouts" add-init-hook
\ No newline at end of file
diff --git a/basis/pango/pango.factor b/basis/pango/pango.factor
new file mode 100644 (file)
index 0000000..540d1cb
--- /dev/null
@@ -0,0 +1,37 @@
+! Copyright (C) 2008 Matthew Willis.
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license
+USING: arrays system alien.destructors alien.c-types alien.syntax alien
+combinators math.rectangles kernel math ;
+IN: pango
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! Helpful functions from other parts of pango
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+<< {
+    { [ os winnt? ] [ "pango" "libpango-1.0-0.dll" "cdecl" add-library ] }
+    { [ os macosx? ] [ "pango" "/opt/local/lib/libpango-1.0.0.dylib" "cdecl" add-library ] }
+    { [ os unix? ] [ ] }
+} cond >>
+
+LIBRARY: pango
+
+CONSTANT: PANGO_SCALE 1024
+
+: pango>float ( n -- x ) PANGO_SCALE /f ; inline
+: float>pango ( x -- n ) PANGO_SCALE * >integer ; inline
+
+FUNCTION: PangoContext*
+pango_context_new ( ) ;
+
+C-STRUCT: PangoRectangle
+    { "int" "x" }
+    { "int" "y" }
+    { "int" "width" }
+    { "int" "height" } ;
+
+: PangoRectangle>rect ( PangoRectangle -- rect )
+    [ [ PangoRectangle-x pango>float ] [ PangoRectangle-y pango>float ] bi 2array ]
+    [ [ PangoRectangle-width pango>float ] [ PangoRectangle-height pango>float ] bi 2array ] bi
+    <rect> ;
\ No newline at end of file
diff --git a/basis/present/present-tests.factor b/basis/present/present-tests.factor
new file mode 100644 (file)
index 0000000..22d352c
--- /dev/null
@@ -0,0 +1,8 @@
+IN: present.tests
+USING: tools.test present math vocabs tools.vocabs sequences kernel ;
+
+[ "3" ] [ 3 present ] unit-test
+[ "Hi" ] [ "Hi" present ] unit-test
+[ "+" ] [ \ + present ] unit-test
+[ "kernel" ] [ "kernel" vocab present ] unit-test
+[ ] [ all-vocabs-seq [ present ] map drop ] unit-test
\ No newline at end of file
index fe7025d559a05987a993b6c04f3c8680185dc834..1d9f8d5445a303f27647738014b43156169dc193 100644 (file)
@@ -1,6 +1,7 @@
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors math math.parser strings words kernel effects ;
+USING: accessors math math.parser strings words vocabs
+kernel effects ;
 IN: present
 
 GENERIC: present ( object -- string )
@@ -11,6 +12,8 @@ M: string present ;
 
 M: word present name>> ;
 
+M: vocab-spec present name>> ;
+
 M: effect present effect>string ;
 
 M: f present drop "" ;
index 95f05c21ffbdff0a24b9413ffd26dfa71ce62951..63d7bf217a1babc1813ba94b6e11b3914562b740 100644 (file)
@@ -149,14 +149,16 @@ PRIVATE>
 
 : .c ( -- ) callstack callstack. ;
 
-: pprint-cell ( obj -- ) [ pprint ] with-cell ;
+: pprint-cell ( obj -- ) [ pprint-short ] with-cell ;
+
+SYMBOL: pprint-string-cells?
 
 : simple-table. ( values -- )
     standard-table-style [
         [
             [
                 [
-                    dup string?
+                    dup string? pprint-string-cells? get not and
                     [ [ write ] with-cell ]
                     [ pprint-cell ]
                     if
@@ -234,15 +236,6 @@ M: pathname synopsis* pprint* ;
 
 M: word summary synopsis ;
 
-: synopsis-alist ( definitions -- alist )
-    [ dup synopsis swap ] { } map>assoc ;
-
-: definitions. ( alist -- )
-    [ write-object nl ] assoc-each ;
-
-: sorted-definitions. ( definitions -- )
-    synopsis-alist sort-keys definitions. ;
-
 GENERIC: declarations. ( obj -- )
 
 M: object declarations. drop ;
index 26b328b29134546bcc92ab767226f8d36a1f7f55..ebde3802b458066c58ddd7e948fd7a9ec6346b95 100755 (executable)
@@ -15,12 +15,12 @@ GENERIC: random-32* ( tuple -- r )
 GENERIC: random-bytes* ( n tuple -- byte-array )
 
 M: object random-bytes* ( n tuple -- byte-array )
-    [ [ <byte-vector> ] keep 4 /mod ] dip tuck
+    [ [ <byte-vector> ] keep 4 /mod ] dip
     [ pick '[ _ random-32* 4 >le _ push-all ] times ]
     [
         over zero?
         [ 2drop ] [ random-32* 4 >le swap head over push-all ] if
-    ] 2bi* ;
+    ] bi-curry bi* ;
 
 M: object random-32* ( tuple -- r ) 4 random-bytes* le> ;
 
index afb7e0843ca9cd733580a4d0b7377e6bf6652ab5..791e0e65c113d51317e31c560f2271217775c835 100755 (executable)
@@ -4,8 +4,8 @@ USING: fry accessors arrays kernel words sequences generic math
 namespaces make quotations assocs combinators classes.tuple
 classes.tuple.private effects summary hashtables classes generic
 sets definitions generic.standard slots.private continuations locals
-stack-checker.backend stack-checker.state stack-checker.visitor
-stack-checker.errors stack-checker.values
+generalizations stack-checker.backend stack-checker.state
+stack-checker.visitor stack-checker.errors stack-checker.values
 stack-checker.recursive-state ;
 IN: stack-checker.transforms
 
@@ -155,3 +155,12 @@ CONSTANT: bit-member-n 256
 \ memq? [
     dup sequence? [ memq-quot ] [ drop f ] if
 ] 1 define-transform
+
+! Shuffling
+: nths-quot ( indices -- quot )
+    [ [ '[ _ swap nth ] ] map ] [ length ] bi
+    '[ _ cleave _ narray ] ;
+
+\ shuffle [
+    shuffle-mapping nths-quot
+] 1 define-transform
\ No newline at end of file
diff --git a/basis/strings/tables/authors.txt b/basis/strings/tables/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/strings/tables/tables-tests.factor b/basis/strings/tables/tables-tests.factor
new file mode 100644 (file)
index 0000000..a773128
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test strings.tables ;
+IN: strings.tables.tests
diff --git a/basis/strings/tables/tables.factor b/basis/strings/tables/tables.factor
new file mode 100644 (file)
index 0000000..c6ccba5
--- /dev/null
@@ -0,0 +1,21 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel sequences fry math.order ;
+IN: strings.tables
+
+<PRIVATE
+
+: format-column ( seq ? -- seq )
+    [
+        dup [ length ] [ max ] map-reduce
+        '[ _ CHAR: \s pad-tail ] map
+    ] unless ;
+
+: map-last ( seq quot -- seq )
+    [ dup length <reversed> ] dip '[ 0 = @ ] 2map ; inline
+
+PRIVATE>
+
+: format-table ( table -- seq )
+    flip [ format-column ] map-last
+    flip [ " " join ] map ;
\ No newline at end of file
diff --git a/basis/tools/apropos/apropos-docs.factor b/basis/tools/apropos/apropos-docs.factor
new file mode 100644 (file)
index 0000000..b50b51b
--- /dev/null
@@ -0,0 +1,6 @@
+IN: tools.apropos
+USING: help.markup help.syntax strings ;
+
+HELP: apropos
+{ $values { "str" string } }
+{ $description "Lists all words, vocabularies and help articles whose name contains a subsequence equal to " { $snippet "str" } ". Results are ranked using a simple distance algorithm." } ;
diff --git a/basis/tools/apropos/apropos-tests.factor b/basis/tools/apropos/apropos-tests.factor
new file mode 100644 (file)
index 0000000..96ce9d3
--- /dev/null
@@ -0,0 +1,4 @@
+IN: tools.apropos.tests
+USING: tools.apropos tools.test ;
+
+[ ] [ "swp" apropos ] unit-test
diff --git a/basis/tools/apropos/apropos.factor b/basis/tools/apropos/apropos.factor
new file mode 100644 (file)
index 0000000..c7126c1
--- /dev/null
@@ -0,0 +1,71 @@
+! Copyright (C) 2008 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays assocs fry help.markup help.topics io
+kernel make math math.parser namespaces sequences sorting
+summary tools.completion tools.vocabs tools.vocabs.browser
+vocabs words unicode.case help ;
+IN: tools.apropos
+
+: $completions ( seq -- )
+    dup [ word? ] all? [ words-table ] [
+        dup [ vocab-spec? ] all? [
+            $vocabs
+        ] [
+            [ <$pretty-link> 1array ] map $table
+        ] if
+    ] if ;
+
+TUPLE: more-completions seq ;
+
+CONSTANT: max-completions 5
+
+M: more-completions article-title
+    seq>> length number>string " results" append ;
+
+M: more-completions article-name
+    seq>> length max-completions - number>string " more results" append ;
+
+M: more-completions article-content
+    seq>> sort-values keys \ $completions prefix ;
+
+: (apropos) ( str candidates title -- element )
+    [
+        [ completions ] dip '[
+            _ 1array \ $heading prefix ,
+            [ max-completions short head keys \ $completions prefix , ]
+            [ dup length max-completions > [ more-completions boa <$link> , ] [ drop ] if ]
+            bi
+        ] unless-empty
+    ] { } make ;
+
+: word-candidates ( words -- candidates )
+    [ dup name>> >lower ] { } map>assoc ;
+
+: vocab-candidates ( -- candidates )
+    all-vocabs-seq [ dup vocab-name >lower ] { } map>assoc ;
+
+: help-candidates ( seq -- candidates )
+    [ [ >link ] [ article-title >lower ] bi ] { } map>assoc
+    sort-values ;
+
+: $apropos ( str -- )
+    first
+    [ all-words word-candidates "Words" (apropos) ]
+    [ vocab-candidates "Vocabularies" (apropos) ]
+    [ articles get keys help-candidates "Help articles" (apropos) ]
+    tri 3array print-element ;
+
+TUPLE: apropos search ;
+
+C: <apropos> apropos
+
+M: apropos article-title
+    search>> "Search results for “" "”" surround ;
+
+M: apropos article-name article-title ;
+
+M: apropos article-content
+    search>> 1array \ $apropos prefix ;
+
+: apropos ( str -- )
+    <apropos> print-topic ;
index 084b97970d63e00ffc260fda7c6f69b13f55adcf..14cec8e85fc32db68027a4a874f1913774a27d43 100644 (file)
@@ -1,12 +1,13 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel arrays sequences math namespaces strings io
-vectors words assocs combinators sorting unicode.case
-unicode.categories math.order ;
+USING: accessors kernel arrays sequences math namespaces
+strings io fry vectors words assocs combinators sorting
+unicode.case unicode.categories math.order vocabs
+tools.vocabs unicode.data ;
 IN: tools.completion
 
 : (fuzzy) ( accum ch i full -- accum i ? )
-    index-from 
+    index-from
     [
         [ swap push ] 2keep 1+ t
     ] [
@@ -61,20 +62,20 @@ IN: tools.completion
     dupd fuzzy score max ;
 
 : completion ( short candidate -- result )
-    [ second >lower swap complete ] keep first 2array ;
+    [ second >lower swap complete ] keep 2array ;
 
 : completions ( short candidates -- seq )
-    over empty? [
-        nip [ first ] map
-    ] [
-        [ >lower ] dip [ completion ] with map
-        rank-completions
-    ] if ;
+    [ ] [ [ >lower ] dip [ completion ] with map rank-completions ]
+    bi-curry if-empty ;
+
+: name-completions ( str seq -- seq' )
+    [ dup name>> ] { } map>assoc completions ;
+
+: words-matching ( str -- seq )
+    all-words name-completions ;
 
-: string-completions ( short strs -- seq )
-    dup zip completions ;
+: vocabs-matching ( str -- seq )
+    all-vocabs-seq name-completions ;
 
-: limited-completions ( short candidates -- seq )
-    [ completions ] [ drop ] 2bi
-    2dup [ length 50 > ] [ empty? ] bi* and
-    [ 2drop f ] [ drop 50 short head ] if ;
+: chars-matching ( str -- seq )
+    name-map keys dup zip completions ;
\ No newline at end of file
index b7ec0d07a2af2f7fa71f1de243677e9d36b1e2a4..820c957cbc3b3c54ad5e1d4e0afdafb87690041d 100644 (file)
@@ -3,7 +3,6 @@ IN: tools.crossref
 
 ARTICLE: "tools.crossref" "Cross-referencing tools" 
 { $subsection usage. }
-{ $subsection apropos }
 { $see-also "definitions" "words" see see-methods } ;
 
 ABOUT: "tools.crossref"
@@ -14,7 +13,3 @@ HELP: usage.
 { $examples { $code "\\ reverse usage." } } ;
 
 { usage usage. } related-words
-
-HELP: apropos
-{ $values { "str" "a string" } }
-{ $description "Lists all words whose name contains a subsequence equal to " { $snippet "str" } ". Results are ranked using a simple distance algorithm." } ;
index c4b046ecccb26d87479119166fbac44d30806fe9..494e022243f5afd269808281f9fb6d90380a6ab2 100644 (file)
@@ -1,16 +1,17 @@
-! Copyright (C) 2005, 2007 Slava Pestov.
+! Copyright (C) 2005, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays definitions assocs io kernel
-math namespaces prettyprint sequences strings io.styles words
-generic tools.completion quotations parser summary
-sorting hashtables vocabs parser source-files ;
+USING: assocs definitions io io.styles kernel prettyprint
+sorting ;
 IN: tools.crossref
 
-: usage. ( word -- )
-    smart-usage sorted-definitions. ;
+: synopsis-alist ( definitions -- alist )
+    [ dup synopsis swap ] { } map>assoc ;
+
+: definitions. ( alist -- )
+    [ write-object nl ] assoc-each ;
 
-: words-matching ( str -- seq )
-    all-words [ dup name>> ] { } map>assoc completions ;
+: sorted-definitions. ( definitions -- )
+    synopsis-alist sort-keys definitions. ;
 
-: apropos ( str -- )
-    words-matching synopsis-alist reverse definitions. ;
+: usage. ( word -- )
+    smart-usage sorted-definitions. ;
index 8fe31ac6ccd756ad417b7e2b12698700865ce620..11e2b8957b8ce96e2ae40b806a31c34e24a404ab 100755 (executable)
@@ -1,4 +1,4 @@
-! Copyright (C) 2007, 2008 Slava Pestov.
+! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: io io.files io.files.info.unix io.pathnames
 io.directories io.directories.hierarchy kernel namespaces make
@@ -35,9 +35,6 @@ IN: tools.deploy.macosx
 : copy-dll ( bundle-name -- )
     "Frameworks/libfactor.dylib" copy-bundle-dir ;
 
-: copy-freetype ( bundle-name -- )
-    deploy-ui? get [ "Frameworks" copy-bundle-dir ] [ drop ] if ;
-
 : copy-nib ( bundle-name -- )
     deploy-ui? get [
         "Resources/English.lproj/MiniFactor.nib" copy-bundle-dir
@@ -45,13 +42,11 @@ IN: tools.deploy.macosx
 
 : create-app-dir ( vocab bundle-name -- vm )
     [
-        nip {
-            [ copy-dll ]
-            [ copy-freetype ]
-            [ copy-nib ]
-            [ "Contents/Resources/" copy-fonts ]
-            [ "Contents/Resources" append-path make-directories ]
-        } cleave
+        nip
+        [ copy-dll ]
+        [ copy-nib ]
+        [ "Contents/Resources" append-path make-directories ]
+        tri
     ]
     [ create-app-plist ]
     [ "Contents/MacOS/" append-path copy-vm ] 2tri
index 2ad16a4d8d6d34cff4886ff4e64c133b4a81e638..9b727b48deec0c8a89e009916589a332d3dd1ca2 100644 (file)
@@ -40,21 +40,20 @@ IN: tools.memory
     "Decks" write-total
     "Cards" write-total ;
 
-: write-labelled-size ( n string -- )
+: write-labeled-size ( n string -- )
     [ write-cell write-size ] with-row ;
 
 : (code-room.) ( -- )
     code-room {
-        [ "Size:" write-labelled-size ]
-        [ "Used:" write-labelled-size ]
-        [ "Total free space:" write-labelled-size ]
-        [ "Largest free block:" write-labelled-size ]
+        [ "Size:" write-labeled-size ]
+        [ "Used:" write-labeled-size ]
+        [ "Total free space:" write-labeled-size ]
+        [ "Largest free block:" write-labeled-size ]
     } spread ;
 
 : heap-stat-step ( obj counts sizes -- )
-    [ over ] dip
     [ [ class ] dip inc-at ]
-    [ [ [ size ] [ class ] bi ] dip at+ ] 2bi* ;
+    [ [ [ size ] [ class ] bi ] dip at+ ] bi-curry* bi ;
 
 PRIVATE>
 
@@ -71,8 +70,8 @@ PRIVATE>
     ] tabular-output ;
 
 : heap-stats ( -- counts sizes )
-    H{ } clone H{ } clone
-    2dup '[ _ _ heap-stat-step ] each-object ;
+    [ ] instances H{ } clone H{ } clone
+    [ '[ _ _ heap-stat-step ] each ] 2keep ;
 
 : heap-stats. ( -- )
     heap-stats dup keys natural-sort standard-table-style [
index da9171cedf734c20a8ba800198db279a3880b9f9..a786cdfef1c122eb5b8e500d27ac724804513b6a 100644 (file)
@@ -28,7 +28,7 @@ $nl
 ABOUT: "profiling"
 
 HELP: counters
-{ $values { "words" "a sequence of words" } { "assoc" "an association list mapping words to integers" } }
+{ $values { "words" "a sequence of words" } { "alist" "an association list mapping words to integers" } }
 { $description "Outputs an association list of word call counts." } ;
 
 HELP: counters.
index 83915363749f6ef62dfed14c2903cba72b80a153..19646e55c2df814f8db3954b9a754aa69a383b98 100644 (file)
@@ -3,45 +3,51 @@
 USING: accessors words sequences math prettyprint kernel arrays io
 io.styles namespaces assocs kernel.private strings combinators
 sorting math.parser vocabs definitions tools.profiler.private
-continuations generic compiler.units sets ;
+continuations generic compiler.units sets classes fry ;
 IN: tools.profiler
 
 : profile ( quot -- )
     [ t profiling call ] [ f profiling ] [ ] cleanup ;
 
-: counters ( words -- assoc )
-    [ dup counter>> ] { } map>assoc ;
+: filter-counts ( alist -- alist' )
+    [ second 0 > ] filter ;
 
-GENERIC: (profile.) ( obj -- )
+: map-counters ( obj quot -- alist )
+    { } map>assoc filter-counts ; inline
 
-TUPLE: usage-profile word ;
+: counters ( words -- alist )
+    [ dup counter>> ] map-counters ;
 
-C: <usage-profile> usage-profile
+: cumulative-counters ( obj quot -- alist )
+    '[ dup @ [ counter>> ] sigma ] map-counters ; inline
 
-M: word (profile.)
-    [ name>> "( no name )" or ] [ <usage-profile> ] bi write-object ;
+: vocab-counters ( -- alist )
+    vocabs [ words [ predicate? not ] filter ] cumulative-counters ;
 
-TUPLE: vocab-profile vocab ;
+: generic-counters ( -- alist )
+    all-words [ subwords ] cumulative-counters ;
 
-C: <vocab-profile> vocab-profile
+: methods-on ( class -- methods )
+    dup implementors [ method ] with map ;
 
-M: string (profile.)
-    dup <vocab-profile> write-object ;
+: class-counters ( -- alist )
+    classes [ methods-on ] cumulative-counters ;
 
-M: method-body (profile.)
-    [ synopsis ] [ "method-generic" word-prop <usage-profile> ] bi
-    write-object ;
+: method-counters ( -- alist )
+    all-words [ subwords ] map concat counters ;
 
-: counter. ( obj n -- )
-    [
-        [ [ (profile.) ] with-cell ] dip
-        [ number>string write ] with-cell
-    ] with-row ;
+: profiler-usage ( word -- words )
+    [ smart-usage [ word? ] filter ]
+    [ compiled-generic-usage keys ]
+    [ compiled-usage keys ]
+    tri 3append prune ;
+
+: usage-counters ( word -- alist )
+    profiler-usage counters ;
 
 : counters. ( assoc -- )
-    [ second 0 > ] filter sort-values
     standard-table-style [
-        [ counter. ] assoc-each
+        sort-values simple-table.
     ] tabular-output ;
 
 : profile. ( -- )
@@ -58,19 +64,20 @@ M: method-body (profile.)
     "Call counts for words which call " write
     dup pprint
     ":" print
-    [ smart-usage [ word? ] filter ]
-    [ compiled-generic-usage keys ]
-    [ compiled-usage keys ]
-    tri 3append prune counters counters. ;
+    usage-counters counters. ;
 
 : vocabs-profile. ( -- )
     "Call counts for all vocabularies:" print
-    vocabs [
-        dup words
-        [ "predicating" word-prop not ] filter
-        [ counter>> ] map sum
-    ] { } map>assoc counters. ;
+    vocab-counters counters. ;
+
+: generic-profile. ( -- )
+    "Call counts for methods on generic words:" print
+    generic-counters counters. ;
+
+: class-profile. ( -- )
+    "Call counts for methods on classes:" print
+    class-counters counters. ;
 
 : method-profile. ( -- )
-    all-words [ subwords ] map concat
-    counters counters. ;
+    "Call counts for all methods:" print
+    method-counters counters. ;
diff --git a/basis/tools/test/tools.factor b/basis/tools/test/tools.factor
deleted file mode 100644 (file)
index bf74c1a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-IN: tools.test.tests
-USING: completion words sequences test ;
-
-[ ] [ "swp" apropos ] unit-test
-[ f ] [ "swp" words-matching empty? ] unit-test
index 666a7d24d9cf51ba60806d06b9c873a644fbc539..c37e7799cb73865d66ff985d9508091474512d77 100644 (file)
@@ -1,5 +1,5 @@
-USING: dlists ui.gadgets kernel ui namespaces io.streams.string
-io ;
+USING: dlists ui.gadgets ui.gadgets.private
+kernel ui namespaces io.streams.string io ;
 IN: tools.test.ui
 
 ! We can't print to output-stream here because that might be a pane
index 508b4a34938703fe4af0e0e6ffbefee0e3cd2575..723c4ac483278da4153c8103d4a095de1ab20697 100644 (file)
@@ -10,7 +10,7 @@ ARTICLE: "vocab-authors" "Vocabulary authors"
 ARTICLE: "vocab-index" "Vocabulary index"
 { $subsection "vocab-tags" }
 { $subsection "vocab-authors" }
-{ $describe-vocab "" } ;
+{ $vocab "" } ;
 
 HELP: words.
 { $values { "vocab" "a vocabulary name" } }
index 7e12a56cf28eb8bdba6fbc0618c82daf71ad8a0a..385d1b2d462bf90522555203d96ca9ada260649c 100644 (file)
@@ -1,4 +1,5 @@
 IN: tools.vocabs.browser.tests
-USING: tools.vocabs.browser tools.test help.markup ;
+USING: tools.vocabs.browser tools.test help.markup help vocabs ;
 
-[ ] [ { $describe-vocab "scratchpad" } print-content ] unit-test
+[ ] [ { $vocab "scratchpad" } print-content ] unit-test
+[ ] [ "classes" vocab print-topic ] unit-test
\ No newline at end of file
index 36f23a8298aa2f6244406db3fbc7a15d8db501e9..3550424b83f30d293f9e885971123ac054932e88 100644 (file)
@@ -6,47 +6,37 @@ classes.singleton classes.tuple classes.union combinators
 definitions effects fry generic help help.markup help.stylesheet
 help.topics io io.files io.pathnames io.styles kernel macros
 make namespaces prettyprint sequences sets sorting summary
-tools.vocabs vocabs vocabs.loader words words.symbol ;
+tools.vocabs vocabs vocabs.loader words words.symbol
+combinators.smart definitions.icons ;
 IN: tools.vocabs.browser
 
-: vocab-status-string ( vocab -- string )
-    {
-        { [ dup not ] [ drop "" ] }
-        { [ dup vocab-main ] [ drop "[Runnable]" ] }
-        [ drop "[Loaded]" ]
-    } cond ;
-
-: write-status ( vocab -- )
-    vocab vocab-status-string write ;
-
-: vocab. ( vocab -- )
+: <$pretty-link> ( definition -- element )
     [
-        [ [ write-status ] with-cell ]
-        [ [ ($link) ] with-cell ]
-        [ [ vocab-summary write ] with-cell ] tri
-    ] with-row ;
+        [ definition-icon 1array \ $image prefix ]
+        [ drop " " ]
+        [ 1array \ $definition-link prefix ]
+        tri
+    ] output>array ;
 
-: vocab-headings. ( -- )
-    [
-        [ "State" write ] with-cell
-        [ "Vocabulary" write ] with-cell
-        [ "Summary" write ] with-cell
-    ] with-row ;
+: vocab-row ( vocab -- row )
+    [ <$pretty-link> ] [ vocab-summary ] bi 2array ;
 
-: root-heading. ( root -- )
+: vocab-headings ( -- headings )
+    {
+        { $strong "Vocabulary" }
+        { $strong "Summary" }
+    } ;
+
+: root-heading ( root -- )
     [ "Children from " prepend ] [ "Children" ] if*
     $heading ;
 
-: $vocabs ( assoc -- )
+: $vocabs ( seq -- )
+    [ vocab-row ] map vocab-headings prefix $table ;
+
+: $vocab-roots ( assoc -- )
     [
-        [ drop ] [
-            [ root-heading. ]
-            [
-                standard-table-style [
-                    vocab-headings. [ vocab. ] each
-                ] ($grid)
-            ] bi*
-        ] if-empty
+        [ drop ] [ [ root-heading ] [ $vocabs ] bi* ] if-empty
     ] assoc-each ;
 
 TUPLE: vocab-tag name ;
@@ -74,7 +64,7 @@ C: <vocab-author> vocab-author
     ] unless-empty ;
 
 : describe-children ( vocab -- )
-    vocab-name all-child-vocabs $vocabs ;
+    vocab-name all-child-vocabs $vocab-roots ;
 
 : describe-files ( vocab -- )
     vocab-files [ <pathname> ] map [
@@ -92,9 +82,9 @@ C: <vocab-author> vocab-author
     [
         "Tuple classes" $subheading
         [
-            [ <$link> ]
-            [ superclass <$link> ]
-            [ "slots" word-prop [ name>> ] map " " join \ $snippet swap 2array ]
+            [ <$pretty-link> ]
+            [ superclass <$pretty-link> ]
+            [ "slots" word-prop [ name>> ] map " " join <$snippet> ]
             tri 3array
         ] map
         { { $strong "Class" } { $strong "Superclass" } { $strong "Slots" } } prefix
@@ -105,8 +95,8 @@ C: <vocab-author> vocab-author
     [
         "Predicate classes" $subheading
         [
-            [ <$link> ]
-            [ superclass <$link> ]
+            [ <$pretty-link> ]
+            [ superclass <$pretty-link> ]
             bi 2array
         ] map
         { { $strong "Class" } { $strong "Superclass" } } prefix
@@ -116,7 +106,7 @@ C: <vocab-author> vocab-author
 : (describe-classes) ( classes heading -- )
     '[
         _ $subheading
-        [ <$link> 1array ] map $table
+        [ <$pretty-link> 1array ] map $table
     ] unless-empty ;
 
 : describe-builtin-classes ( classes -- )
@@ -160,25 +150,27 @@ C: <vocab-author> vocab-author
     [
         "Parsing words" $subheading
         [
-            [ <$link> ]
-            [ word-syntax dup [ \ $snippet swap 2array ] when ]
+            [ <$pretty-link> ]
+            [ word-syntax dup [ <$snippet> ] when ]
             bi 2array
         ] map
         { { $strong "Word" } { $strong "Syntax" } } prefix
         $table
     ] unless-empty ;
 
+: word-row ( word -- element )
+    [ <$pretty-link> ]
+    [ stack-effect dup [ effect>string <$snippet> ] when ]
+    bi 2array ;
+
+: word-headings ( -- element )
+    { { $strong "Word" } { $strong "Stack effect" } } ;
+
+: words-table ( words -- )
+    [ word-row ] map word-headings prefix $table ;
+
 : (describe-words) ( words heading -- )
-    '[
-        _ $subheading
-        [
-            [ <$link> ]
-            [ stack-effect dup [ effect>string \ $snippet swap 2array ] when ]
-            bi 2array
-        ] map
-        { { $strong "Word" } { $strong "Stack effect" } } prefix
-        $table
-    ] unless-empty ;
+    '[ _ $subheading words-table ] unless-empty ;
 
 : describe-generics ( words -- )
     "Generic words" (describe-words) ;
@@ -198,11 +190,11 @@ C: <vocab-author> vocab-author
 : describe-symbols ( words -- )
     [
         "Symbol words" $subheading
-        [ <$link> 1array ] map $table
+        [ <$pretty-link> 1array ] map $table
     ] unless-empty ;
 
-: describe-words ( vocab -- )
-    words [
+: $words ( words -- )
+    [
         "Words" $heading
 
         natural-sort
@@ -229,7 +221,7 @@ C: <vocab-author> vocab-author
 
 : words. ( vocab -- )
     last-element off
-    vocab-name describe-words ;
+    [ require ] [ words $words ] bi ;
 
 : describe-metadata ( vocab -- )
     [
@@ -239,11 +231,11 @@ C: <vocab-author> vocab-author
     ] { } make
     [ "Meta-data" $heading $table ] unless-empty ;
 
-: $describe-vocab ( element -- )
+: $vocab ( element -- )
     first {
         [ describe-help ]
         [ describe-metadata ]
-        [ describe-words ]
+        [ words $words ]
         [ describe-files ]
         [ describe-children ]
     } cleave ;
@@ -262,10 +254,10 @@ C: <vocab-author> vocab-author
     [ vocab-authors ] keyed-vocabs ;
 
 : $tagged-vocabs ( element -- )
-    first tagged $vocabs ;
+    first tagged $vocab-roots ;
 
 : $authored-vocabs ( element -- )
-    first authored $vocabs ;
+    first authored $vocab-roots ;
 
 : $all-tags ( element -- )
     drop "Tags" $heading all-tags $tags ;
@@ -282,14 +274,14 @@ M: vocab-spec article-title vocab-name " vocabulary" append ;
 M: vocab-spec article-name vocab-name ;
 
 M: vocab-spec article-content
-    vocab-name \ $describe-vocab swap 2array ;
+    vocab-name \ $vocab swap 2array ;
 
 M: vocab-spec article-parent drop "vocab-index" ;
 
 M: vocab-tag >link ;
 
 M: vocab-tag article-title
-    name>> "Vocabularies tagged ``" "''" surround ;
+    name>> "Vocabularies tagged “" "”" surround ;
 
 M: vocab-tag article-name name>> ;
 
index 119a2e8587f0ae8d90b96b50c249b6b41e0c97da..f0d9a084b13677494a1df9859cbf6c5f9f5eb0df 100644 (file)
@@ -3,7 +3,7 @@
 USING: threads kernel namespaces continuations combinators
 sequences math namespaces.private continuations.private
 concurrency.messaging quotations kernel.private words
-sequences.private assocs models models.filter arrays accessors
+sequences.private assocs models models.arrow arrays accessors
 generic generic.standard definitions make sbufs ;
 IN: tools.walker
 
@@ -228,7 +228,7 @@ SYMBOL: +stopped+
                 { step-into-all [ step-into-all-loop ] }
                 { abandon [ drop f keep-running ] }
                 ! Pass quotation to debugged thread
-                { call-in [ nip keep-running ] }
+                { call-in [ keep-running ] }
                 ! Pass previous continuation to debugged thread
                 { step-back [ step-back-msg ] }
             } case f
index eaa0953d2571de0babd08ca442d140a5b8cb9595..76fbc7286b0e4c62081162797edcb909285bfda4 100755 (executable)
@@ -27,8 +27,8 @@ GENERIC: flush-gl-context ( handle -- )
 
 HOOK: offscreen-pixels ui-backend ( world -- alien w h )
 
-HOOK: beep ui-backend ( -- )
-
 : with-gl-context ( handle quot -- )
     swap [ select-gl-context call ] keep
     glFlush flush-gl-context gl-error ; inline
+
+HOOK: (with-ui) ui-backend ( quot -- )
\ No newline at end of file
diff --git a/basis/ui/backend/cocoa/authors.txt b/basis/ui/backend/cocoa/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/basis/ui/backend/cocoa/cocoa.factor b/basis/ui/backend/cocoa/cocoa.factor
new file mode 100755 (executable)
index 0000000..9888fc4
--- /dev/null
@@ -0,0 +1,166 @@
+! Copyright (C) 2006, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors math arrays assocs cocoa cocoa.application
+command-line kernel memory namespaces cocoa.messages
+cocoa.runtime cocoa.subclassing cocoa.pasteboard cocoa.types
+cocoa.windows cocoa.classes cocoa.nibs sequences ui ui.private
+ui.backend ui.clipboards ui.gadgets ui.gadgets.worlds
+ui.backend.cocoa.views core-foundation core-foundation.run-loop
+core-graphics.types threads math.rectangles fry libc
+generalizations alien.c-types cocoa.views
+combinators io.thread locals ;
+IN: ui.backend.cocoa
+
+TUPLE: handle ;
+TUPLE: window-handle < handle view window ;
+TUPLE: offscreen-handle < handle context buffer ;
+
+C: <window-handle> window-handle
+C: <offscreen-handle> offscreen-handle
+
+SINGLETON: cocoa-ui-backend
+
+TUPLE: pasteboard handle ;
+
+C: <pasteboard> pasteboard
+
+M: pasteboard clipboard-contents
+    handle>> pasteboard-string ;
+
+M: pasteboard set-clipboard-contents
+    handle>> set-pasteboard-string ;
+
+: init-clipboard ( -- )
+    NSPasteboard -> generalPasteboard <pasteboard>
+    clipboard set-global
+    <clipboard> selection set-global ;
+
+: world>NSRect ( world -- NSRect )
+    [ 0 0 ] dip dim>> first2 <CGRect> ;
+
+: auto-position ( window loc -- )
+    dup { 0 0 } = [
+        drop
+        windows get [ -> center ] [
+            peek second window-loc>>
+            dupd first2 <CGPoint> -> cascadeTopLeftFromPoint:
+            -> setFrameTopLeftPoint:
+        ] if-empty
+    ] [ first2 <CGPoint> -> setFrameTopLeftPoint: ] if ;
+
+M: cocoa-ui-backend set-title ( string world -- )
+    handle>> window>> swap <NSString> -> setTitle: ;
+
+: enter-fullscreen ( world -- )
+    handle>> view>>
+    NSScreen -> mainScreen
+    f -> enterFullScreenMode:withOptions:
+    drop ;
+
+: exit-fullscreen ( world -- )
+    handle>> view>> f -> exitFullScreenModeWithOptions: ;
+
+M: cocoa-ui-backend set-fullscreen* ( ? world -- )
+    swap [ enter-fullscreen ] [ exit-fullscreen ] if ;
+
+M: cocoa-ui-backend fullscreen* ( world -- ? )
+    handle>> view>> -> isInFullScreenMode zero? not ;
+
+M:: cocoa-ui-backend (open-window) ( world -- )
+    world dim>> <FactorView> :> view
+    view world world>NSRect <ViewWindow> :> window
+    view -> release
+    window world window-loc>> auto-position
+    world view register-window
+    world window save-position
+    window install-window-delegate
+    view window <window-handle> world (>>handle)
+    window f -> makeKeyAndOrderFront: ;
+
+M: cocoa-ui-backend (close-window) ( handle -- )
+    window>> -> release ;
+
+M: cocoa-ui-backend close-window ( gadget -- )
+    find-world [
+        handle>> [
+            window>> f -> performClose:
+        ] when*
+    ] when* ;
+
+M: cocoa-ui-backend raise-window* ( world -- )
+    handle>> [
+        window>> dup f -> orderFront: -> makeKeyWindow
+        NSApp 1 -> activateIgnoringOtherApps:
+    ] when* ;
+
+: pixel-size ( pixel-format -- size )
+    0 <int> [ NSOpenGLPFAColorSize 0 -> getValues:forAttribute:forVirtualScreen: ]
+    keep *int -3 shift ;
+
+: offscreen-buffer ( world pixel-format -- alien w h pitch )
+    [ dim>> first2 ] [ pixel-size ] bi*
+    { [ * * malloc ] [ 2drop ] [ drop nip ] [ nip * ] } 3cleave ;
+
+: gadget-offscreen-context ( world -- context buffer )
+    NSOpenGLPFAOffScreen 1array <PixelFormat>
+    [ nip NSOpenGLContext -> alloc swap f -> initWithFormat:shareContext: dup ]
+    [ offscreen-buffer ] 2bi
+    4 npick [ -> setOffScreen:width:height:rowbytes: ] dip ;
+
+M: cocoa-ui-backend (open-offscreen-buffer) ( world -- )
+    dup gadget-offscreen-context <offscreen-handle> >>handle drop ;
+
+M: cocoa-ui-backend (close-offscreen-buffer) ( handle -- )
+    [ context>> -> release ]
+    [ buffer>> free ] bi ;
+
+GENERIC: (gl-context) ( handle -- context )
+M: window-handle (gl-context) view>> -> openGLContext ;
+M: offscreen-handle (gl-context) context>> ;
+
+M: handle select-gl-context ( handle -- )
+    (gl-context) -> makeCurrentContext ;
+
+M: handle flush-gl-context ( handle -- )
+    (gl-context) -> flushBuffer ;
+
+M: cocoa-ui-backend offscreen-pixels ( world -- alien w h )
+    [ handle>> buffer>> ] [ dim>> first2 neg ] bi ;
+
+M: cocoa-ui-backend beep ( -- )
+    NSBeep ;
+
+CLASS: {
+    { +superclass+ "NSObject" }
+    { +name+ "FactorApplicationDelegate" }
+}
+
+{  "applicationDidUpdate:" "void" { "id" "SEL" "id" }
+    [ 3drop reset-run-loop ]
+} ;
+
+: install-app-delegate ( -- )
+    NSApp FactorApplicationDelegate install-delegate ;
+
+SYMBOL: cocoa-init-hook
+
+cocoa-init-hook [
+    [ "MiniFactor.nib" load-nib install-app-delegate ]
+] initialize
+
+M: cocoa-ui-backend (with-ui)
+    "UI" assert.app [
+        [
+            init-clipboard
+            cocoa-init-hook get call
+            start-ui
+            f io-thread-running? set-global
+            init-thread-timer
+            reset-run-loop
+            NSApp -> run
+        ] ui-running
+    ] with-cocoa ;
+
+cocoa-ui-backend ui-backend set-global
+
+[ running.app? "ui.tools" "listener" ? ] main-vocab-hook set-global
diff --git a/basis/ui/backend/cocoa/summary.txt b/basis/ui/backend/cocoa/summary.txt
new file mode 100644 (file)
index 0000000..dc5a8b5
--- /dev/null
@@ -0,0 +1 @@
+Cocoa UI backend
diff --git a/basis/ui/backend/cocoa/tags.txt b/basis/ui/backend/cocoa/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
diff --git a/basis/ui/backend/cocoa/tools/authors.txt b/basis/ui/backend/cocoa/tools/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/basis/ui/backend/cocoa/tools/summary.txt b/basis/ui/backend/cocoa/tools/summary.txt
new file mode 100644 (file)
index 0000000..8441c02
--- /dev/null
@@ -0,0 +1 @@
+Cocoa integration for UI developer tools
diff --git a/basis/ui/backend/cocoa/tools/tags.txt b/basis/ui/backend/cocoa/tools/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
diff --git a/basis/ui/backend/cocoa/tools/tools.factor b/basis/ui/backend/cocoa/tools/tools.factor
new file mode 100644 (file)
index 0000000..02b2f0a
--- /dev/null
@@ -0,0 +1,98 @@
+! Copyright (C) 2006, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: alien.syntax cocoa cocoa.nibs cocoa.application
+cocoa.classes cocoa.dialogs cocoa.pasteboard cocoa.subclassing
+core-foundation core-foundation.strings help.topics kernel
+memory namespaces parser system ui ui.tools.browser
+ui.tools.listener ui.backend.cocoa eval locals tools.vocabs ;
+IN: ui.backend.cocoa.tools
+
+: finder-run-files ( alien -- )
+    CF>string-array listener-run-files
+    NSApp NSApplicationDelegateReplySuccess
+    -> replyToOpenOrPrint: ;
+
+: menu-run-files ( -- )
+    open-panel [ listener-run-files ] when* ;
+
+: menu-save-image ( -- )
+    image save-panel [ save-image ] when* ;
+
+! Handle Open events from the Finder
+CLASS: {
+    { +superclass+ "FactorApplicationDelegate" }
+    { +name+ "FactorWorkspaceApplicationDelegate" }
+}
+
+{ "application:openFiles:" "void" { "id" "SEL" "id" "id" }
+    [ [ 3drop ] dip finder-run-files ]
+}
+
+{ "factorListener:" "id" { "id" "SEL" "id" }
+    [ 3drop show-listener f ]
+}
+
+{ "factorBrowser:" "id" { "id" "SEL" "id" }
+    [ 3drop show-browser f ]
+}
+
+{ "newFactorListener:" "id" { "id" "SEL" "id" }
+    [ 3drop listener-window f ]
+}
+
+{ "newFactorBrowser:" "id" { "id" "SEL" "id" }
+    [ 3drop browser-window f ]
+}
+
+{ "runFactorFile:" "id" { "id" "SEL" "id" }
+    [ 3drop menu-run-files f ]
+}
+
+{ "saveFactorImage:" "id" { "id" "SEL" "id" }
+    [ 3drop save f ]
+}
+
+{ "saveFactorImageAs:" "id" { "id" "SEL" "id" }
+    [ 3drop menu-save-image f ]
+}
+
+{ "refreshAll:" "id" { "id" "SEL" "id" }
+    [ 3drop [ refresh-all ] \ refresh-all call-listener f ]
+} ;
+
+: install-app-delegate ( -- )
+    NSApp FactorWorkspaceApplicationDelegate install-delegate ;
+
+! Service support; evaluate Factor code from other apps
+:: do-service ( pboard error quot -- )
+    pboard error ?pasteboard-string
+    dup [ quot call ] when
+    [ pboard set-pasteboard-string ] when* ;
+
+CLASS: {
+    { +superclass+ "NSObject" }
+    { +name+ "FactorServiceProvider" }
+} {
+    "evalInListener:userData:error:"
+    "void"
+    { "id" "SEL" "id" "id" "id" }
+    [ nip [ eval-listener f ] do-service 2drop ]
+} {
+    "evalToString:userData:error:"
+    "void"
+    { "id" "SEL" "id" "id" "id" }
+    [ nip [ eval>string ] do-service 2drop ]
+} ;
+
+: register-services ( -- )
+    NSApp
+    FactorServiceProvider -> alloc -> init
+    -> setServicesProvider: ;
+
+FUNCTION: void NSUpdateDynamicServices ;
+
+[
+    install-app-delegate
+    "Factor.nib" load-nib
+    register-services
+] cocoa-init-hook set-global
diff --git a/basis/ui/backend/cocoa/views/authors.txt b/basis/ui/backend/cocoa/views/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/basis/ui/backend/cocoa/views/summary.txt b/basis/ui/backend/cocoa/views/summary.txt
new file mode 100644 (file)
index 0000000..afbfa2a
--- /dev/null
@@ -0,0 +1 @@
+Cocoa NSView implementation displaying Factor gadgets
diff --git a/basis/ui/backend/cocoa/views/tags.txt b/basis/ui/backend/cocoa/views/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
diff --git a/basis/ui/backend/cocoa/views/views-tests.factor b/basis/ui/backend/cocoa/views/views-tests.factor
new file mode 100644 (file)
index 0000000..a964396
--- /dev/null
@@ -0,0 +1,15 @@
+IN: ui.backend.cocoa.views.tests
+USING: ui.backend.cocoa.views tools.test kernel math.rectangles
+namespaces ;
+
+[ t ] [
+    T{ rect
+        { loc { 0 0 } }
+        { dim { 1000 1000 } }
+    } "world" set
+
+    T{ rect
+        { loc { 1.5 2.25 } }
+        { dim { 13.0 14.0 } }
+    } dup "world" get rect>NSRect "world" get NSRect>rect =
+] unit-test
diff --git a/basis/ui/backend/cocoa/views/views.factor b/basis/ui/backend/cocoa/views/views.factor
new file mode 100644 (file)
index 0000000..b598482
--- /dev/null
@@ -0,0 +1,411 @@
+! Copyright (C) 2006, 2008 Slava Pestov
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors alien alien.c-types arrays assocs cocoa kernel math
+cocoa.messages cocoa.subclassing cocoa.classes cocoa.views
+cocoa.application cocoa.pasteboard cocoa.types cocoa.windows sequences
+ui ui.private ui.gadgets ui.gadgets.private ui.gadgets.worlds
+ui.gestures core-foundation.strings core-graphics core-graphics.types
+threads combinators math.rectangles ;
+IN: ui.backend.cocoa.views
+
+: send-mouse-moved ( view event -- )
+    [ mouse-location ] [ drop window ] 2bi move-hand fire-motion ;
+
+: button ( event -- n )
+    #! Cocoa -> Factor UI button mapping
+    -> buttonNumber H{ { 0 1 } { 2 2 } { 1 3 } } at ;
+
+CONSTANT: modifiers
+    {
+        { S+ HEX: 20000 }
+        { C+ HEX: 40000 }
+        { A+ HEX: 100000 }
+        { M+ HEX: 80000 }
+    }
+
+CONSTANT: key-codes
+    H{
+        { 71 "CLEAR" }
+        { 36 "RET" }
+        { 76 "ENTER" }
+        { 53 "ESC" }
+        { 48 "TAB" }
+        { 51 "BACKSPACE" }
+        { 115 "HOME" }
+        { 117 "DELETE" }
+        { 119 "END" }
+        { 122 "F1" }
+        { 120 "F2" }
+        { 99 "F3" }
+        { 118 "F4" }
+        { 96 "F5" }
+        { 97 "F6" }
+        { 98 "F7" }
+        { 100 "F8" }
+        { 123 "LEFT" }
+        { 124 "RIGHT" }
+        { 125 "DOWN" }
+        { 126 "UP" }
+        { 116 "PAGE_UP" }
+        { 121 "PAGE_DOWN" }
+    }
+
+: key-code ( event -- string ? )
+    dup -> keyCode key-codes at
+    [ t ] [ -> charactersIgnoringModifiers CF>string f ] ?if ;
+
+: event-modifiers ( event -- modifiers )
+    -> modifierFlags modifiers modifier ;
+
+: key-event>gesture ( event -- modifiers keycode action? )
+    [ event-modifiers ] [ key-code ] bi ;
+
+: send-key-event ( view gesture -- )
+    swap window propagate-key-gesture ;
+
+: interpret-key-event ( view event -- )
+    NSArray swap -> arrayWithObject: -> interpretKeyEvents: ;
+
+: send-key-down-event ( view event -- )
+    [ key-event>gesture <key-down> send-key-event ]
+    [ interpret-key-event ]
+    2bi ;
+
+: send-key-up-event ( view event -- )
+    key-event>gesture <key-up> send-key-event ;
+
+: mouse-event>gesture ( event -- modifiers button )
+    [ event-modifiers ] [ button ] bi ;
+
+: send-button-down$ ( view event -- )
+    [ nip mouse-event>gesture <button-down> ]
+    [ mouse-location ]
+    [ drop window ]
+    2tri send-button-down ;
+
+: send-button-up$ ( view event -- )
+    [ nip mouse-event>gesture <button-up> ]
+    [ mouse-location ]
+    [ drop window ]
+    2tri send-button-up ;
+
+: send-wheel$ ( view event -- )
+    [ nip [ -> deltaX ] [ -> deltaY ] bi [ sgn neg ] bi@ 2array ]
+    [ mouse-location ]
+    [ drop window ]
+    2tri send-wheel ;
+
+: send-action$ ( view event gesture -- junk )
+    [ drop window ] dip send-action f ;
+
+: add-resize-observer ( observer object -- )
+    [
+        "updateFactorGadgetSize:"
+        "NSViewFrameDidChangeNotification" <NSString>
+    ] dip add-observer ;
+
+: string-or-nil? ( NSString -- ? )
+    [ CF>string NSStringPboardType = ] [ t ] if* ;
+
+: valid-service? ( gadget send-type return-type -- ? )
+    2dup [ string-or-nil? ] [ string-or-nil? ] bi* and
+    [ drop [ gadget-selection? ] [ drop t ] if ] [ 3drop f ] if ;
+
+: NSRect>rect ( NSRect world -- rect )
+    [ [ [ CGRect-x ] [ CGRect-y ] bi ] [ dim>> second ] bi* swap - 2array ]
+    [ drop [ CGRect-w ] [ CGRect-h ] bi 2array ]
+    2bi <rect> ;
+
+: rect>NSRect ( rect world -- NSRect )
+    [ [ loc>> first2 ] [ dim>> second ] bi* swap - ]
+    [ drop dim>> first2 ]
+    2bi <CGRect> ;
+
+CLASS: {
+    { +superclass+ "NSOpenGLView" }
+    { +name+ "FactorView" }
+    { +protocols+ { "NSTextInput" } }
+}
+
+! Rendering
+{ "drawRect:" "void" { "id" "SEL" "NSRect" }
+    [ 2drop window relayout-1 ]
+}
+
+! Events
+{ "acceptsFirstMouse:" "char" { "id" "SEL" "id" }
+    [ 3drop 1 ]
+}
+
+{ "mouseEntered:" "void" { "id" "SEL" "id" }
+    [ nip send-mouse-moved ]
+}
+
+{ "mouseExited:" "void" { "id" "SEL" "id" }
+    [ 3drop forget-rollover ]
+}
+
+{ "mouseMoved:" "void" { "id" "SEL" "id" }
+    [ nip send-mouse-moved ]
+}
+
+{ "mouseDragged:" "void" { "id" "SEL" "id" }
+    [ nip send-mouse-moved ]
+}
+
+{ "rightMouseDragged:" "void" { "id" "SEL" "id" }
+    [ nip send-mouse-moved ]
+}
+
+{ "otherMouseDragged:" "void" { "id" "SEL" "id" }
+    [ nip send-mouse-moved ]
+}
+
+{ "mouseDown:" "void" { "id" "SEL" "id" }
+    [ nip send-button-down$ ]
+}
+
+{ "mouseUp:" "void" { "id" "SEL" "id" }
+    [ nip send-button-up$ ]
+}
+
+{ "rightMouseDown:" "void" { "id" "SEL" "id" }
+    [ nip send-button-down$ ]
+}
+
+{ "rightMouseUp:" "void" { "id" "SEL" "id" }
+    [ nip send-button-up$ ]
+}
+
+{ "otherMouseDown:" "void" { "id" "SEL" "id" }
+    [ nip send-button-down$ ]
+}
+
+{ "otherMouseUp:" "void" { "id" "SEL" "id" }
+    [ nip send-button-up$ ]
+}
+
+{ "scrollWheel:" "void" { "id" "SEL" "id" }
+    [ nip send-wheel$ ]
+}
+
+{ "keyDown:" "void" { "id" "SEL" "id" }
+    [ nip send-key-down-event ]
+}
+
+{ "keyUp:" "void" { "id" "SEL" "id" }
+    [ nip send-key-up-event ]
+}
+
+{ "undo:" "id" { "id" "SEL" "id" }
+    [ nip undo-action send-action$ ]
+}
+
+{ "redo:" "id" { "id" "SEL" "id" }
+    [ nip redo-action send-action$ ]
+}
+
+{ "cut:" "id" { "id" "SEL" "id" }
+    [ nip cut-action send-action$ ]
+}
+
+{ "copy:" "id" { "id" "SEL" "id" }
+    [ nip copy-action send-action$ ]
+}
+
+{ "paste:" "id" { "id" "SEL" "id" }
+    [ nip paste-action send-action$ ]
+}
+
+{ "delete:" "id" { "id" "SEL" "id" }
+    [ nip delete-action send-action$ ]
+}
+
+{ "selectAll:" "id" { "id" "SEL" "id" }
+    [ nip select-all-action send-action$ ]
+}
+
+! Multi-touch gestures: this is undocumented.
+! http://cocoadex.com/2008/02/nsevent-modifications-swipe-ro.html
+{ "magnifyWithEvent:" "void" { "id" "SEL" "id" }
+    [
+        nip
+        dup -> deltaZ sgn {
+            {  1 [ zoom-in-action send-action$ ] }
+            { -1 [ zoom-out-action send-action$ ] }
+            {  0 [ 2drop ] }
+        } case
+    ]
+}
+
+{ "swipeWithEvent:" "void" { "id" "SEL" "id" }
+    [
+        nip
+        dup -> deltaX sgn {
+            {  1 [ left-action send-action$ ] }
+            { -1 [ right-action send-action$ ] }
+            {  0
+                [
+                    dup -> deltaY sgn {
+                        {  1 [ up-action send-action$ ] }
+                        { -1 [ down-action send-action$ ] }
+                        {  0 [ 2drop ] }
+                    } case
+                ]
+            }
+        } case
+    ]
+}
+
+! "rotateWithEvent:" "void" { "id" "SEL" "id" }}
+
+{ "acceptsFirstResponder" "char" { "id" "SEL" }
+    [ 2drop 1 ]
+}
+
+! Services
+{ "validRequestorForSendType:returnType:" "id" { "id" "SEL" "id" "id" }
+    [
+        ! We return either self or nil
+        [ over window-focus ] 2dip
+        valid-service? [ drop ] [ 2drop f ] if
+    ]
+}
+
+{ "writeSelectionToPasteboard:types:" "char" { "id" "SEL" "id" "id" }
+    [
+        CF>string-array NSStringPboardType swap member? [
+            [ drop window-focus gadget-selection ] dip over
+            [ set-pasteboard-string 1 ] [ 2drop 0 ] if
+        ] [ 3drop 0 ] if
+    ]
+}
+
+{ "readSelectionFromPasteboard:" "char" { "id" "SEL" "id" }
+    [
+        pasteboard-string dup [
+            [ drop window ] dip swap user-input 1
+        ] [ 3drop 0 ] if
+    ]
+}
+
+! Text input
+{ "insertText:" "void" { "id" "SEL" "id" }
+    [ nip CF>string swap window user-input ]
+}
+
+{ "hasMarkedText" "char" { "id" "SEL" }
+    [ 2drop 0 ]
+}
+
+{ "markedRange" "NSRange" { "id" "SEL" }
+    [ 2drop 0 0 <NSRange> ]
+}
+
+{ "selectedRange" "NSRange" { "id" "SEL" }
+    [ 2drop 0 0 <NSRange> ]
+}
+
+{ "setMarkedText:selectedRange:" "void" { "id" "SEL" "id" "NSRange" }
+    [ 2drop 2drop ]
+}
+
+{ "unmarkText" "void" { "id" "SEL" }
+    [ 2drop ]
+}
+
+{ "validAttributesForMarkedText" "id" { "id" "SEL" }
+    [ 2drop NSArray -> array ]
+}
+
+{ "attributedSubstringFromRange:" "id" { "id" "SEL" "NSRange" }
+    [ 3drop f ]
+}
+
+{ "characterIndexForPoint:" "NSUInteger" { "id" "SEL" "NSPoint" }
+    [ 3drop 0 ]
+}
+
+{ "firstRectForCharacterRange:" "NSRect" { "id" "SEL" "NSRange" }
+    [ 3drop 0 0 0 0 <CGRect> ]
+}
+
+{ "conversationIdentifier" "NSInteger" { "id" "SEL" }
+    [ drop alien-address ]
+}
+
+! Initialization
+{ "updateFactorGadgetSize:" "void" { "id" "SEL" "id" }
+    [ 2drop dup view-dim swap window (>>dim) yield ]
+}
+
+{ "doCommandBySelector:" "void" { "id" "SEL" "SEL" }
+    [ 3drop ]
+}
+
+{ "initWithFrame:pixelFormat:" "id" { "id" "SEL" "NSRect" "id" }
+    [
+        [ drop ] 2dip
+        SUPER-> initWithFrame:pixelFormat:
+        dup dup add-resize-observer
+    ]
+}
+
+{ "dealloc" "void" { "id" "SEL" }
+    [
+        drop
+        [ unregister-window ]
+        [ remove-observer ]
+        [ SUPER-> dealloc ]
+        tri
+    ]
+} ;
+
+: sync-refresh-to-screen ( GLView -- )
+    -> openGLContext -> CGLContextObj NSOpenGLCPSwapInterval 1 <int>
+    CGLSetParameter drop ;
+
+: <FactorView> ( dim -- view )
+    FactorView swap <GLView> [ sync-refresh-to-screen ] keep ;
+
+: save-position ( world window -- )
+    -> frame CGRect-top-left 2array >>window-loc drop ;
+
+CLASS: {
+    { +superclass+ "NSObject" }
+    { +name+ "FactorWindowDelegate" }
+}
+
+{ "windowDidMove:" "void" { "id" "SEL" "id" }
+    [
+        2nip -> object [ -> contentView window ] keep save-position
+    ]
+}
+
+{ "windowDidBecomeKey:" "void" { "id" "SEL" "id" }
+    [
+        2nip -> object -> contentView window focus-world
+    ]
+}
+
+{ "windowDidResignKey:" "void" { "id" "SEL" "id" }
+    [
+        forget-rollover
+        2nip -> object -> contentView window unfocus-world
+    ]
+}
+
+{ "windowShouldClose:" "char" { "id" "SEL" "id" }
+    [
+        3drop 1
+    ]
+}
+
+{ "windowWillClose:" "void" { "id" "SEL" "id" }
+    [
+        2nip -> object -> contentView window ungraft
+    ]
+} ;
+
+: install-window-delegate ( window -- )
+    FactorWindowDelegate install-delegate ;
diff --git a/basis/ui/backend/windows/authors.txt b/basis/ui/backend/windows/authors.txt
new file mode 100755 (executable)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/ui/backend/windows/tags.txt b/basis/ui/backend/windows/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
diff --git a/basis/ui/backend/windows/windows.factor b/basis/ui/backend/windows/windows.factor
new file mode 100755 (executable)
index 0000000..54d9ed4
--- /dev/null
@@ -0,0 +1,587 @@
+! Copyright (C) 2005, 2006 Doug Coleman.
+! Portions copyright (C) 2007, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: alien alien.c-types alien.strings arrays assocs ui
+ui.private ui.gadgets ui.gadgets.private ui.backend
+ui.clipboards ui.gadgets.worlds ui.gestures ui.event-loop io
+kernel math math.vectors namespaces make sequences strings
+vectors words windows.kernel32 windows.gdi32 windows.user32
+windows.opengl32 windows.messages windows.types windows.nt
+windows threads libc combinators fry combinators.short-circuit
+continuations command-line shuffle opengl ui.render ascii
+math.bitwise locals accessors math.rectangles math.order ascii
+calendar io.encodings.utf16n ;
+IN: ui.backend.windows
+
+SINGLETON: windows-ui-backend
+
+: crlf>lf ( str -- str' )
+    CHAR: \r swap remove ;
+
+: lf>crlf ( str -- str' )
+    [ [ dup CHAR: \n = [ CHAR: \r , ] when , ] each ] "" make ;
+
+: enum-clipboard ( -- seq )
+    0
+    [ EnumClipboardFormats win32-error dup dup 0 > ]
+    [ ]
+    produce 2nip ;
+
+: with-clipboard ( quot -- )
+    f OpenClipboard win32-error=0/f
+    call
+    CloseClipboard win32-error=0/f ; inline
+
+: paste ( -- str )
+    [
+        CF_UNICODETEXT IsClipboardFormatAvailable zero? [
+            ! nothing to paste
+            ""
+        ] [
+            CF_UNICODETEXT GetClipboardData dup win32-error=0/f
+            dup GlobalLock dup win32-error=0/f
+            GlobalUnlock win32-error=0/f
+            utf16n alien>string
+        ] if
+    ] with-clipboard
+    crlf>lf ;
+
+: copy ( str -- )
+    lf>crlf [
+        utf16n string>alien
+        EmptyClipboard win32-error=0/f
+        GMEM_MOVEABLE over length 1+ GlobalAlloc
+            dup win32-error=0/f
+    
+        dup GlobalLock dup win32-error=0/f
+        swapd byte-array>memory
+        dup GlobalUnlock win32-error=0/f
+        CF_UNICODETEXT swap SetClipboardData win32-error=0/f
+    ] with-clipboard ;
+
+TUPLE: pasteboard ;
+C: <pasteboard> pasteboard
+
+M: pasteboard clipboard-contents drop paste ;
+M: pasteboard set-clipboard-contents drop copy ;
+
+: init-clipboard ( -- )
+    <pasteboard> clipboard set-global
+    <clipboard> selection set-global ;
+
+TUPLE: win-base hDC hRC ;
+TUPLE: win < win-base hWnd world title ;
+TUPLE: win-offscreen < win-base hBitmap bits ;
+C: <win> win
+C: <win-offscreen> win-offscreen
+
+SYMBOLS: msg-obj class-name-ptr mouse-captured ;
+
+: style ( -- n ) WS_OVERLAPPEDWINDOW ; inline
+: ex-style ( -- n ) WS_EX_APPWINDOW WS_EX_WINDOWEDGE bitor ; inline
+
+: get-RECT-top-left ( RECT -- x y )
+    [ RECT-left ] keep RECT-top ;
+
+: get-RECT-dimensions ( RECT -- x y width height )
+    [ get-RECT-top-left ] keep
+    [ RECT-right ] keep [ RECT-left - ] keep
+    [ RECT-bottom ] keep RECT-top - ;
+
+: handle-wm-paint ( hWnd uMsg wParam lParam -- )
+    #! wParam and lParam are unused
+    #! only paint if width/height both > 0
+    3drop window relayout-1 yield ;
+
+: handle-wm-size ( hWnd uMsg wParam lParam -- )
+    2nip
+    [ lo-word ] keep hi-word 2array
+    dup { 0 0 } = [ 2drop ] [ swap window (>>dim) ] if ;
+
+: handle-wm-move ( hWnd uMsg wParam lParam -- )
+    2nip
+    [ lo-word ] keep hi-word 2array
+    swap window (>>window-loc) ;
+
+CONSTANT: wm-keydown-codes
+    H{
+        { 8 "BACKSPACE" }
+        { 9 "TAB" }
+        { 13 "RET" }
+        { 27 "ESC" }
+        { 33 "PAGE_UP" }
+        { 34 "PAGE_DOWN" }
+        { 35 "END" }
+        { 36 "HOME" }
+        { 37 "LEFT" }
+        { 38 "UP" }
+        { 39 "RIGHT" }
+        { 40 "DOWN" }
+        { 45 "INSERT" }
+        { 46 "DELETE" }
+        { 112 "F1" }
+        { 113 "F2" }
+        { 114 "F3" }
+        { 115 "F4" }
+        { 116 "F5" }
+        { 117 "F6" }
+        { 118 "F7" }
+        { 119 "F8" }
+        { 120 "F9" }
+        { 121 "F10" }
+        { 122 "F11" }
+        { 123 "F12" }
+    }
+
+: key-state-down? ( key -- ? )
+    GetKeyState 16 bit? ;
+
+: left-shift? ( -- ? ) VK_LSHIFT key-state-down? ;
+: left-ctrl? ( -- ? ) VK_LCONTROL key-state-down? ;
+: left-alt? ( -- ? ) VK_LMENU key-state-down? ;
+: right-shift? ( -- ? ) VK_RSHIFT key-state-down? ;
+: right-ctrl? ( -- ? ) VK_RCONTROL key-state-down? ;
+: right-alt? ( -- ? ) VK_RMENU key-state-down? ;
+: shift? ( -- ? ) left-shift? right-shift? or ;
+: ctrl? ( -- ? ) left-ctrl? right-ctrl? or ;
+: alt? ( -- ? ) left-alt? right-alt? or ;
+: caps-lock? ( -- ? ) VK_CAPITAL GetKeyState zero? not ;
+
+: key-modifiers ( -- seq )
+    [
+        shift? [ S+ , ] when
+        ctrl? [ C+ , ] when
+        alt? [ A+ , ] when
+    ] { } make [ empty? not ] keep f ? ;
+
+CONSTANT: exclude-keys-wm-keydown
+    H{
+        { 16 "SHIFT" }
+        { 17 "CTRL" }
+        { 18 "ALT" }
+        { 20 "CAPS-LOCK" }
+    }
+
+! Values are ignored
+CONSTANT: exclude-keys-wm-char
+    H{
+        { 8 "BACKSPACE" }
+        { 9 "TAB" }
+        { 13 "RET" }
+        { 27 "ESC" }
+    }
+
+: exclude-key-wm-keydown? ( n -- ? )
+    exclude-keys-wm-keydown key? ;
+
+: exclude-key-wm-char? ( n -- ? )
+    exclude-keys-wm-char key? ;
+
+: keystroke>gesture ( n -- mods sym )
+    wm-keydown-codes at* [ key-modifiers swap ] [ drop f f ] if ;
+
+: send-key-gesture ( sym action? quot hWnd -- )
+    [ [ key-modifiers ] 3dip call ] dip
+    window propagate-key-gesture ; inline
+
+: send-key-down ( sym action? hWnd -- )
+    [ [ <key-down> ] ] dip send-key-gesture ;
+
+: send-key-up ( sym action? hWnd -- )
+    [ [ <key-up> ] ] dip send-key-gesture ;
+
+: key-sym ( wParam -- string/f action? )
+    {
+        {
+            [ dup LETTER? ]
+            [ shift? caps-lock? xor [ CHAR: a + CHAR: A - ] unless 1string f ]
+        }
+        { [ dup digit? ] [ 1string f ] }
+        [ wm-keydown-codes at t ]
+    } cond ;
+
+:: handle-wm-keydown ( hWnd uMsg wParam lParam -- )
+    wParam exclude-key-wm-keydown? [
+        wParam key-sym over [
+            dup ctrl? alt? xor or [
+                hWnd send-key-down
+            ] [ 2drop ] if
+        ] [ 2drop ] if
+    ] unless ;
+
+:: handle-wm-char ( hWnd uMsg wParam lParam -- )
+    wParam exclude-key-wm-char? [
+        ctrl? alt? xor [
+            wParam 1string
+            [ f hWnd send-key-down ]
+            [ hWnd window user-input ] bi
+        ] unless
+    ] unless ;
+
+:: handle-wm-keyup ( hWnd uMsg wParam lParam -- )
+    wParam exclude-key-wm-keydown? [
+        wParam key-sym over [
+            hWnd send-key-up
+        ] [ 2drop ] if
+    ] unless ;
+
+:: set-window-active ( hwnd uMsg wParam lParam ? -- n )
+    ? hwnd window (>>active?)
+    hwnd uMsg wParam lParam DefWindowProc ;
+
+: handle-wm-syscommand ( hWnd uMsg wParam lParam -- n )
+    {
+        { [ over SC_MINIMIZE = ] [ f set-window-active ] }
+        { [ over SC_RESTORE = ] [ t set-window-active ] }
+        { [ over SC_MAXIMIZE = ] [ t set-window-active ] }
+        { [ dup alpha? ] [ 4drop 0 ] }
+        { [ t ] [ DefWindowProc ] }
+    } cond ;
+
+: cleanup-window ( handle -- )
+    dup title>> [ free ] when*
+    dup hRC>> wglDeleteContext win32-error=0/f
+    dup hWnd>> swap hDC>> ReleaseDC win32-error=0/f ;
+
+M: windows-ui-backend (close-window)
+    dup hWnd>> unregister-window
+    dup cleanup-window
+    hWnd>> DestroyWindow win32-error=0/f ;
+
+: handle-wm-close ( hWnd uMsg wParam lParam -- )
+    3drop window ungraft ;
+
+: handle-wm-set-focus ( hWnd uMsg wParam lParam -- )
+    3drop window [ focus-world ] when* ;
+
+: handle-wm-kill-focus ( hWnd uMsg wParam lParam -- )
+    3drop window [ unfocus-world ] when* ;
+
+: message>button ( uMsg -- button down? )
+    {
+        { WM_LBUTTONDOWN   [ 1 t ] }
+        { WM_LBUTTONUP     [ 1 f ] }
+        { WM_MBUTTONDOWN   [ 2 t ] }
+        { WM_MBUTTONUP     [ 2 f ] }
+        { WM_RBUTTONDOWN   [ 3 t ] }
+        { WM_RBUTTONUP     [ 3 f ] }
+
+        { WM_NCLBUTTONDOWN [ 1 t ] }
+        { WM_NCLBUTTONUP   [ 1 f ] }
+        { WM_NCMBUTTONDOWN [ 2 t ] }
+        { WM_NCMBUTTONUP   [ 2 f ] }
+        { WM_NCRBUTTONDOWN [ 3 t ] }
+        { WM_NCRBUTTONUP   [ 3 f ] }
+    } case ;
+
+! If the user clicks in the window border ("non-client area")
+! Windows sends us an NC[LMR]BUTTONDOWN message; but if the
+! mouse is subsequently released outside the NC area, we receive
+! a [LMR]BUTTONUP message and Factor can get confused. So we
+! ignore BUTTONUP's that are a result of an NC*BUTTONDOWN.
+SYMBOL: nc-buttons
+
+: handle-wm-ncbutton ( hWnd uMsg wParam lParam -- )
+    2drop nip
+    message>button nc-buttons get
+    swap [ push ] [ delete ] if ;
+
+: >lo-hi ( WORD -- array ) [ lo-word ] [ hi-word ] bi 2array ;
+
+: mouse-wheel ( wParam -- array ) >lo-hi [ sgn neg ] map ;
+
+: mouse-event>gesture ( uMsg -- button )
+    key-modifiers swap message>button
+    [ <button-down> ] [ <button-up> ] if ;
+
+:: prepare-mouse ( hWnd uMsg wParam lParam -- button coordinate world )
+    uMsg mouse-event>gesture
+    lParam >lo-hi
+    hWnd window ;
+
+: set-capture ( hwnd -- )
+    mouse-captured get [
+        drop
+    ] [
+        [ SetCapture drop ] keep
+        mouse-captured set
+    ] if ;
+
+: release-capture ( -- )
+    ReleaseCapture win32-error=0/f
+    mouse-captured off ;
+
+: handle-wm-buttondown ( hWnd uMsg wParam lParam -- )
+    [
+        over set-capture
+        dup message>button drop nc-buttons get delete
+    ] 2dip prepare-mouse send-button-down ;
+
+: handle-wm-buttonup ( hWnd uMsg wParam lParam -- )
+    mouse-captured get [ release-capture ] when
+    pick message>button drop dup nc-buttons get member? [
+        nc-buttons get delete 4drop
+    ] [
+        drop prepare-mouse send-button-up
+    ] if ;
+
+: make-TRACKMOUSEEVENT ( hWnd -- alien )
+    "TRACKMOUSEEVENT" <c-object> [ set-TRACKMOUSEEVENT-hwndTrack ] keep
+    "TRACKMOUSEEVENT" heap-size over set-TRACKMOUSEEVENT-cbSize ;
+
+: handle-wm-mousemove ( hWnd uMsg wParam lParam -- )
+    2nip
+    over make-TRACKMOUSEEVENT
+    TME_LEAVE over set-TRACKMOUSEEVENT-dwFlags
+    0 over set-TRACKMOUSEEVENT-dwHoverTime
+    TrackMouseEvent drop
+    >lo-hi swap window move-hand fire-motion ;
+
+:: handle-wm-mousewheel ( hWnd uMsg wParam lParam -- )
+    wParam mouse-wheel hand-loc get hWnd window send-wheel ;
+
+: handle-wm-cancelmode ( hWnd uMsg wParam lParam -- )
+    #! message sent if windows needs application to stop dragging
+    4drop release-capture ;
+
+: handle-wm-mouseleave ( hWnd uMsg wParam lParam -- )
+    #! message sent if mouse leaves main application 
+    4drop forget-rollover ;
+
+SYMBOL: wm-handlers
+
+H{ } clone wm-handlers set-global
+
+: add-wm-handler ( quot wm -- )
+    dup array?
+    [ [ execute add-wm-handler ] with each ]
+    [ wm-handlers get-global set-at ] if ;
+
+[ handle-wm-close 0                  ] WM_CLOSE add-wm-handler
+[ 4dup handle-wm-paint DefWindowProc ] WM_PAINT add-wm-handler
+
+[ handle-wm-size 0 ] WM_SIZE add-wm-handler
+[ handle-wm-move 0 ] WM_MOVE add-wm-handler
+
+[ 4dup handle-wm-keydown DefWindowProc ] { WM_KEYDOWN WM_SYSKEYDOWN } add-wm-handler
+[ 4dup handle-wm-char DefWindowProc    ] { WM_CHAR WM_SYSCHAR }       add-wm-handler
+[ 4dup handle-wm-keyup DefWindowProc   ] { WM_KEYUP WM_SYSKEYUP }     add-wm-handler
+
+[ handle-wm-syscommand   ] WM_SYSCOMMAND add-wm-handler
+[ handle-wm-set-focus 0  ] WM_SETFOCUS add-wm-handler
+[ handle-wm-kill-focus 0 ] WM_KILLFOCUS add-wm-handler
+
+[ handle-wm-buttondown 0 ] WM_LBUTTONDOWN add-wm-handler
+[ handle-wm-buttondown 0 ] WM_MBUTTONDOWN add-wm-handler
+[ handle-wm-buttondown 0 ] WM_RBUTTONDOWN add-wm-handler
+[ handle-wm-buttonup 0   ] WM_LBUTTONUP   add-wm-handler
+[ handle-wm-buttonup 0   ] WM_MBUTTONUP   add-wm-handler
+[ handle-wm-buttonup 0   ] WM_RBUTTONUP   add-wm-handler
+
+[ 4dup handle-wm-ncbutton DefWindowProc ]
+{ WM_NCLBUTTONDOWN WM_NCMBUTTONDOWN WM_NCRBUTTONDOWN
+WM_NCLBUTTONUP WM_NCMBUTTONUP WM_NCRBUTTONUP }
+add-wm-handler
+
+[ nc-buttons get-global delete-all DefWindowProc ]
+{ WM_EXITSIZEMOVE WM_EXITMENULOOP } add-wm-handler
+
+[ handle-wm-mousemove 0  ] WM_MOUSEMOVE  add-wm-handler
+[ handle-wm-mousewheel 0 ] WM_MOUSEWHEEL add-wm-handler
+[ handle-wm-cancelmode 0 ] WM_CANCELMODE add-wm-handler
+[ handle-wm-mouseleave 0 ] WM_MOUSELEAVE add-wm-handler
+
+SYMBOL: trace-messages?
+
+! return 0 if you handle the message, else just let DefWindowProc return its val
+: ui-wndproc ( -- object )
+    "uint" { "void*" "uint" "long" "long" } "stdcall" [
+        pick
+        trace-messages? get-global [ dup windows-message-name name>> print flush ] when
+        wm-handlers get-global at* [ call ] [ drop DefWindowProc ] if
+     ] alien-callback ;
+
+: peek-message? ( msg -- ? ) f 0 0 PM_REMOVE PeekMessage zero? ;
+
+M: windows-ui-backend do-events
+    msg-obj get-global
+    dup peek-message? [ drop ui-wait ] [
+        [ TranslateMessage drop ]
+        [ DispatchMessage drop ] bi
+    ] if ;
+
+: register-wndclassex ( -- class )
+    "WNDCLASSEX" <c-object>
+    f GetModuleHandle
+    class-name-ptr get-global
+    pick GetClassInfoEx zero? [
+        "WNDCLASSEX" heap-size over set-WNDCLASSEX-cbSize
+        { CS_HREDRAW CS_VREDRAW CS_OWNDC } flags over set-WNDCLASSEX-style
+        ui-wndproc over set-WNDCLASSEX-lpfnWndProc
+        0 over set-WNDCLASSEX-cbClsExtra
+        0 over set-WNDCLASSEX-cbWndExtra
+        f GetModuleHandle over set-WNDCLASSEX-hInstance
+        f GetModuleHandle "fraptor" utf16n string>alien LoadIcon
+        over set-WNDCLASSEX-hIcon
+        f IDC_ARROW LoadCursor over set-WNDCLASSEX-hCursor
+
+        class-name-ptr get-global over set-WNDCLASSEX-lpszClassName
+        RegisterClassEx dup win32-error=0/f
+    ] when ;
+
+: adjust-RECT ( RECT -- )
+    style 0 ex-style AdjustWindowRectEx win32-error=0/f ;
+
+: make-RECT ( world -- RECT )
+    [ window-loc>> dup ] [ dim>> ] bi v+
+    "RECT" <c-object>
+    over first over set-RECT-right
+    swap second over set-RECT-bottom
+    over first over set-RECT-left
+    swap second over set-RECT-top ;
+
+: default-position-RECT ( RECT -- )
+    dup get-RECT-dimensions [ 2drop ] 2dip
+    CW_USEDEFAULT + pick set-RECT-bottom
+    CW_USEDEFAULT + over set-RECT-right
+    CW_USEDEFAULT over set-RECT-left
+    CW_USEDEFAULT swap set-RECT-top ;
+
+: make-adjusted-RECT ( rect -- RECT )
+    make-RECT
+    dup get-RECT-top-left [ zero? ] both? swap
+    dup adjust-RECT
+    swap [ dup default-position-RECT ] when ;
+
+: create-window ( rect -- hwnd )
+    make-adjusted-RECT
+    [ class-name-ptr get-global f ] dip
+    [
+        [ ex-style ] 2dip
+        { WS_CLIPSIBLINGS WS_CLIPCHILDREN style } flags
+    ] dip get-RECT-dimensions
+    f f f GetModuleHandle f CreateWindowEx dup win32-error=0/f ;
+
+: show-window ( hWnd -- )
+    dup SW_SHOW ShowWindow drop ! always succeeds
+    dup SetForegroundWindow drop
+    SetFocus drop ;
+
+: init-win32-ui ( -- )
+    V{ } clone nc-buttons set-global
+    "MSG" malloc-object msg-obj set-global
+    "Factor-window" utf16n malloc-string class-name-ptr set-global
+    register-wndclassex drop
+    GetDoubleClickTime milliseconds double-click-timeout set-global ;
+
+: cleanup-win32-ui ( -- )
+    class-name-ptr get-global [ dup f UnregisterClass drop free ] when*
+    msg-obj get-global [ free ] when*
+    f class-name-ptr set-global
+    f msg-obj set-global ;
+
+: setup-pixel-format ( hdc flags -- )
+    32 make-pfd [ ChoosePixelFormat dup win32-error=0/f ] 2keep
+    swapd SetPixelFormat win32-error=0/f ;
+
+: get-dc ( hWnd -- hDC ) GetDC dup win32-error=0/f ;
+
+: get-rc ( hDC -- hRC )
+    dup wglCreateContext dup win32-error=0/f
+    [ wglMakeCurrent win32-error=0/f ] keep ;
+
+: setup-gl ( hwnd -- hDC hRC )
+    get-dc dup windowed-pfd-dwFlags setup-pixel-format dup get-rc ;
+
+M: windows-ui-backend (open-window) ( world -- )
+    [ create-window [ setup-gl ] keep ] keep
+    [ f <win> ] keep
+    [ swap hWnd>> register-window ] 2keep
+    dupd (>>handle)
+    hWnd>> show-window ;
+
+M: win-base select-gl-context ( handle -- )
+    [ hDC>> ] keep hRC>> wglMakeCurrent win32-error=0/f
+    GdiFlush drop ;
+
+M: win-base flush-gl-context ( handle -- )
+    hDC>> SwapBuffers win32-error=0/f ;
+
+: (bitmap-info) ( dim -- BITMAPINFO )
+    "BITMAPINFO" <c-object> [
+        BITMAPINFO-bmiHeader {
+            [ nip "BITMAPINFOHEADER" heap-size swap set-BITMAPINFOHEADER-biSize ]
+            [ [ first ] dip set-BITMAPINFOHEADER-biWidth ]
+            [ [ second ] dip set-BITMAPINFOHEADER-biHeight ]
+            [ nip 1 swap set-BITMAPINFOHEADER-biPlanes ]
+            [ nip 32 swap set-BITMAPINFOHEADER-biBitCount ]
+            [ nip BI_RGB swap set-BITMAPINFOHEADER-biCompression ]
+            [ [ first2 * 4 * ] dip set-BITMAPINFOHEADER-biSizeImage ]
+            [ nip 72 swap set-BITMAPINFOHEADER-biXPelsPerMeter ]
+            [ nip 72 swap set-BITMAPINFOHEADER-biYPelsPerMeter ]
+            [ nip 0 swap set-BITMAPINFOHEADER-biClrUsed ]
+            [ nip 0 swap set-BITMAPINFOHEADER-biClrImportant ]
+        } 2cleave
+    ] keep ;
+
+: make-offscreen-dc-and-bitmap ( dim -- hDC hBitmap bits )
+    f CreateCompatibleDC
+    dup rot (bitmap-info) DIB_RGB_COLORS f <void*>
+    [ f 0 CreateDIBSection ] keep *void*
+    [ 2dup SelectObject drop ] dip ;
+
+: setup-offscreen-gl ( dim -- hDC hRC hBitmap bits )
+    make-offscreen-dc-and-bitmap [
+        [ dup offscreen-pfd-dwFlags setup-pixel-format ]
+        [ get-rc ] bi
+    ] 2dip ;
+
+M: windows-ui-backend (open-offscreen-buffer) ( world -- )
+    dup dim>> setup-offscreen-gl <win-offscreen>
+    >>handle drop ;
+
+M: windows-ui-backend (close-offscreen-buffer) ( handle -- )
+    [ hDC>> DeleteDC drop ]
+    [ hBitmap>> DeleteObject drop ] bi ;
+
+! Windows 32-bit bitmaps don't actually use the alpha byte of
+! each pixel; it's left as zero
+
+: (make-opaque) ( byte-array -- byte-array' )
+    [ length 4 / ]
+    [ '[ 255 swap 4 * 3 + _ set-nth ] each ]
+    [ ] tri ;
+
+: (opaque-pixels) ( world -- pixels )
+    [ handle>> bits>> ] [ dim>> first2 * 4 * ] bi
+    memory>byte-array (make-opaque) ;
+
+M: windows-ui-backend offscreen-pixels ( world -- alien w h )
+    [ (opaque-pixels) ] [ dim>> first2 ] bi ;
+
+M: windows-ui-backend raise-window* ( world -- )
+    handle>> [ hWnd>> SetFocus drop ] when* ;
+
+M: windows-ui-backend set-title ( string world -- )
+    handle>>
+    dup title>> [ free ] when*
+    swap utf16n malloc-string
+    [ >>title ]
+    [ [ hWnd>> WM_SETTEXT 0 ] dip alien-address SendMessage drop ] bi ;
+
+M: windows-ui-backend (with-ui)
+    [
+        [
+            init-clipboard
+            init-win32-ui
+            start-ui
+            event-loop
+        ] [ cleanup-win32-ui ] [ ] cleanup
+    ] ui-running ;
+
+M: windows-ui-backend beep ( -- )
+    0 MessageBeep drop ;
+
+windows-ui-backend ui-backend set-global
+
+[ "ui.tools" ] main-vocab-hook set-global
diff --git a/basis/ui/backend/x11/authors.txt b/basis/ui/backend/x11/authors.txt
new file mode 100755 (executable)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/basis/ui/backend/x11/tags.txt b/basis/ui/backend/x11/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
diff --git a/basis/ui/backend/x11/x11.factor b/basis/ui/backend/x11/x11.factor
new file mode 100755 (executable)
index 0000000..422efbd
--- /dev/null
@@ -0,0 +1,296 @@
+! Copyright (C) 2005, 2009 Eduardo Cavazos and Slava Pestov
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors alien alien.c-types arrays ui ui.private ui.gadgets
+ui.gadgets.private ui.gestures ui.backend ui.clipboards
+ui.gadgets.worlds ui.render ui.event-loop assocs kernel math
+namespaces opengl sequences strings x11.xlib x11.events x11.xim
+x11.glx x11.clipboard x11.constants x11.windows io.encodings.string
+io.encodings.ascii io.encodings.utf8 combinators command-line
+math.vectors classes.tuple opengl.gl threads math.rectangles
+environment ascii ;
+IN: ui.backend.x11
+
+SINGLETON: x11-ui-backend
+
+: XA_NET_WM_NAME ( -- atom ) "_NET_WM_NAME" x-atom ;
+
+TUPLE: x11-handle-base glx ;
+TUPLE: x11-handle < x11-handle-base window xic ;
+TUPLE: x11-pixmap-handle < x11-handle-base pixmap glx-pixmap ;
+
+C: <x11-handle> x11-handle
+C: <x11-pixmap-handle> x11-pixmap-handle
+
+M: world expose-event nip relayout ;
+
+M: world configure-event
+    over configured-loc >>window-loc
+    swap configured-dim >>dim
+    ! In case dimensions didn't change
+    relayout-1 ;
+
+CONSTANT: modifiers
+    {
+        { S+ HEX: 1 }
+        { C+ HEX: 4 }
+        { A+ HEX: 8 }
+    }
+
+CONSTANT: key-codes
+    H{
+        { HEX: FF08 "BACKSPACE" }
+        { HEX: FF09 "TAB"       }
+        { HEX: FF0D "RET"       }
+        { HEX: FF8D "ENTER"     }
+        { HEX: FF1B "ESC"       }
+        { HEX: FFFF "DELETE"    }
+        { HEX: FF50 "HOME"      }
+        { HEX: FF51 "LEFT"      }
+        { HEX: FF52 "UP"        }
+        { HEX: FF53 "RIGHT"     }
+        { HEX: FF54 "DOWN"      }
+        { HEX: FF55 "PAGE_UP"   }
+        { HEX: FF56 "PAGE_DOWN" }
+        { HEX: FF57 "END"       }
+        { HEX: FF58 "BEGIN"     }
+        { HEX: FFBE "F1"        }
+        { HEX: FFBF "F2"        }
+        { HEX: FFC0 "F3"        }
+        { HEX: FFC1 "F4"        }
+        { HEX: FFC2 "F5"        }
+        { HEX: FFC3 "F6"        }
+        { HEX: FFC4 "F7"        }
+        { HEX: FFC5 "F8"        }
+        { HEX: FFC6 "F9"        }
+    }
+
+: key-code ( keysym -- keycode action? )
+    dup key-codes at [ t ] [ 1string f ] ?if ;
+
+: event-modifiers ( event -- seq )
+    XKeyEvent-state modifiers modifier ;
+
+: valid-input? ( string gesture -- ? )
+    over empty? [ 2drop f ] [
+        mods>> { f { S+ } } member? [
+            [ [ 127 = not ] [ CHAR: \s >= ] bi and ] all?
+        ] [
+            [ [ 127 = not ] [ CHAR: \s >= ] [ alpha? not ] tri and and ] all?
+        ] if
+    ] if ;
+
+: key-down-event>gesture ( event world -- string gesture )
+    dupd
+    handle>> xic>> lookup-string
+    [ swap event-modifiers ] dip key-code <key-down> ;
+
+M: world key-down-event
+    [ key-down-event>gesture ] keep
+    [ propagate-key-gesture drop ]
+    [ 2over valid-input? [ nip user-input ] [ 3drop ] if ]
+    3bi ;
+
+: key-up-event>gesture ( event -- gesture )
+    [ event-modifiers ] [ 0 XLookupKeysym key-code ] bi <key-up> ;
+
+M: world key-up-event
+    [ key-up-event>gesture ] dip propagate-key-gesture ;
+
+: mouse-event>gesture ( event -- modifiers button loc )
+    [ event-modifiers ]
+    [ XButtonEvent-button ]
+    [ mouse-event-loc ]
+    tri ;
+
+M: world button-down-event
+    [ mouse-event>gesture [ <button-down> ] dip ] dip
+    send-button-down ;
+
+M: world button-up-event
+    [ mouse-event>gesture [ <button-up> ] dip ] dip
+    send-button-up ;
+
+: mouse-event>scroll-direction ( event -- pair )
+    XButtonEvent-button {
+        { 4 { 0 -1 } }
+        { 5 { 0 1 } }
+        { 6 { -1 0 } }
+        { 7 { 1 0 } }
+    } at ;
+
+M: world wheel-event
+    [ [ mouse-event>scroll-direction ] [ mouse-event-loc ] bi ] dip
+    send-wheel ;
+
+M: world enter-event motion-event ;
+
+M: world leave-event 2drop forget-rollover ;
+
+M: world motion-event
+    [ [ XMotionEvent-x ] [ XMotionEvent-y ] bi 2array ] dip
+    move-hand fire-motion ;
+
+M: world focus-in-event
+    nip
+    [ handle>> xic>> XSetICFocus ] [ focus-world ] bi ;
+
+M: world focus-out-event
+    nip
+    [ handle>> xic>> XUnsetICFocus ] [ unfocus-world ] bi ;
+
+M: world selection-notify-event
+    [ handle>> window>> selection-from-event ] keep
+    user-input ;
+
+: supported-type? ( atom -- ? )
+    { "UTF8_STRING" "STRING" "TEXT" }
+    [ x-atom = ] with any? ;
+
+: clipboard-for-atom ( atom -- clipboard )
+    {
+        { XA_PRIMARY [ selection get ] }
+        { XA_CLIPBOARD [ clipboard get ] }
+        [ drop <clipboard> ]
+    } case ;
+
+: encode-clipboard ( string type -- bytes )
+    XSelectionRequestEvent-target
+    XA_UTF8_STRING = utf8 ascii ? encode ;
+
+: set-selection-prop ( evt -- )
+    dpy get swap
+    [ XSelectionRequestEvent-requestor ] keep
+    [ XSelectionRequestEvent-property ] keep
+    [ XSelectionRequestEvent-target ] keep
+    [ 8 PropModeReplace ] dip
+    [
+        XSelectionRequestEvent-selection
+        clipboard-for-atom contents>>
+    ] keep encode-clipboard dup length XChangeProperty drop ;
+
+M: world selection-request-event
+    drop dup XSelectionRequestEvent-target {
+        { [ dup supported-type? ] [ drop dup set-selection-prop send-notify-success ] }
+        { [ dup "TARGETS" x-atom = ] [ drop dup set-targets-prop send-notify-success ] }
+        { [ dup "TIMESTAMP" x-atom = ] [ drop dup set-timestamp-prop send-notify-success ] }
+        [ drop send-notify-failure ]
+    } cond ;
+
+M: x11-ui-backend (close-window) ( handle -- )
+    [ xic>> XDestroyIC ]
+    [ glx>> destroy-glx ]
+    [ window>> [ unregister-window ] [ destroy-window ] bi ]
+    tri ;
+
+M: world client-event
+    swap close-box? [ ungraft ] [ drop ] if ;
+
+: gadget-window ( world -- )
+    dup
+    [ window-loc>> ] [ dim>> ] bi glx-window swap
+    dup "Factor" create-xic
+    <x11-handle>
+    [ window>> register-window ] [ >>handle drop ] 2bi ;
+
+: wait-event ( -- event )
+    QueuedAfterFlush events-queued 0 > [
+        next-event dup
+        None XFilterEvent 0 = [ drop wait-event ] unless
+    ] [ ui-wait wait-event ] if ;
+
+M: x11-ui-backend do-events
+    wait-event dup XAnyEvent-window window dup
+    [ handle-event ] [ 2drop ] if ;
+
+: x-clipboard@ ( gadget clipboard -- prop win )
+    atom>> swap
+    find-world handle>> window>> ;
+
+M: x-clipboard copy-clipboard
+    [ x-clipboard@ own-selection ] keep
+    (>>contents) ;
+
+M: x-clipboard paste-clipboard
+    [ find-world handle>> window>> ] dip atom>> convert-selection ;
+
+: init-clipboard ( -- )
+    XA_PRIMARY <x-clipboard> selection set-global
+    XA_CLIPBOARD <x-clipboard> clipboard set-global ;
+
+: set-title-old ( dpy window string -- )
+    dup [ 127 <= ] all? [ XStoreName drop ] [ 3drop ] if ;
+
+: set-title-new ( dpy window string -- )
+    [ XA_NET_WM_NAME XA_UTF8_STRING 8 PropModeReplace ] dip
+    utf8 encode dup length XChangeProperty drop ;
+
+M: x11-ui-backend set-title ( string world -- )
+    handle>> window>> swap
+    [ dpy get ] 2dip [ set-title-old ] [ set-title-new ] 3bi ;
+
+M: x11-ui-backend set-fullscreen* ( ? world -- )
+    handle>> window>> "XClientMessageEvent" <c-object>
+    [ set-XClientMessageEvent-window ] keep
+    swap _NET_WM_STATE_ADD _NET_WM_STATE_REMOVE ?
+    over set-XClientMessageEvent-data0
+    ClientMessage over set-XClientMessageEvent-type
+    dpy get over set-XClientMessageEvent-display
+    "_NET_WM_STATE" x-atom over set-XClientMessageEvent-message_type
+    32 over set-XClientMessageEvent-format
+    "_NET_WM_STATE_FULLSCREEN" x-atom over set-XClientMessageEvent-data1
+    [ dpy get root get 0 SubstructureNotifyMask ] dip XSendEvent drop ;
+
+M: x11-ui-backend (open-window) ( world -- )
+    dup gadget-window
+    handle>> window>> dup set-closable map-window ;
+
+M: x11-ui-backend raise-window* ( world -- )
+    handle>> [
+        dpy get swap window>> XRaiseWindow drop
+    ] when* ;
+
+M: x11-handle select-gl-context ( handle -- )
+    dpy get swap
+    [ window>> ] [ glx>> ] bi glXMakeCurrent
+    [ "Failed to set current GLX context" throw ] unless ;
+
+M: x11-handle flush-gl-context ( handle -- )
+    dpy get swap window>> glXSwapBuffers ;
+
+M: x11-pixmap-handle select-gl-context ( handle -- )
+    dpy get swap
+    [ glx-pixmap>> ] [ glx>> ] bi glXMakeCurrent
+    [ "Failed to set current GLX context" throw ] unless ;
+
+M: x11-pixmap-handle flush-gl-context ( handle -- )
+    drop ;
+
+M: x11-ui-backend (open-offscreen-buffer) ( world -- )
+    dup dim>> glx-pixmap <x11-pixmap-handle> >>handle drop ;
+M: x11-ui-backend (close-offscreen-buffer) ( handle -- )
+    dpy get swap
+    [ glx-pixmap>> glXDestroyGLXPixmap ]
+    [ pixmap>> XFreePixmap drop ]
+    [ glx>> glXDestroyContext ] 2tri ;
+
+M: x11-ui-backend offscreen-pixels ( world -- alien w h )
+    [ [ dim>> ] [ handle>> pixmap>> ] bi pixmap-bits ] [ dim>> first2 ] bi ;
+
+M: x11-ui-backend (with-ui) ( quot -- )
+    [
+        f [
+            [
+                init-clipboard
+                start-ui
+                event-loop
+            ] with-xim
+        ] with-x
+    ] ui-running ;
+
+M: x11-ui-backend beep ( -- )
+    dpy get 100 XBell drop ;
+
+x11-ui-backend ui-backend set-global
+
+[ "DISPLAY" os-env "ui.tools" "listener" ? ]
+main-vocab-hook set-global
diff --git a/basis/ui/baseline-alignment/authors.txt b/basis/ui/baseline-alignment/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/baseline-alignment/baseline-alignment-tests.factor b/basis/ui/baseline-alignment/baseline-alignment-tests.factor
new file mode 100644 (file)
index 0000000..6ad47c9
--- /dev/null
@@ -0,0 +1,17 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test math kernel sets generic
+ui.baseline-alignment ui.baseline-alignment.private ;
+IN: ui.baseline-alignment.tests
+
+! Test baseline calculations
+[ 10 0 ] [ 0 10 0 10 combine-metrics ] unit-test
+[ 10 5 ] [ 0 10 5 10 combine-metrics ] unit-test
+[ 15 15 ] [ 30 0 0 0 combine-metrics ] unit-test
+[ 5 30 ] [ 10 0 30 0 combine-metrics ] unit-test
+[ 10 10 ] [ 5 10 10 10 combine-metrics ] unit-test
+[ 15 5 ] [ 20 10 0 10 combine-metrics ] unit-test
+[ 15 40 ] [ 20 10 40 10 combine-metrics ] unit-test
+[ 12 3 ] [ 0 12 3 9 combine-metrics ] unit-test
+
+[ t ] [ \ baseline \ cap-height [ order ] bi@ set= ] unit-test 
\ No newline at end of file
diff --git a/basis/ui/baseline-alignment/baseline-alignment.factor b/basis/ui/baseline-alignment/baseline-alignment.factor
new file mode 100644 (file)
index 0000000..e02c618
--- /dev/null
@@ -0,0 +1,80 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: arrays kernel locals math math.order math.vectors
+sequences ui.gadgets accessors combinators ;
+IN: ui.baseline-alignment
+
+SYMBOL: +baseline+
+
+GENERIC: baseline ( gadget -- y )
+
+M: gadget baseline drop f ;
+
+GENERIC: cap-height ( gadget -- y )
+
+M: gadget cap-height drop f ;
+
+<PRIVATE
+
+! Text has ascent/descent/cap-height slots, graphics does not.
+TUPLE: gadget-metrics height ascent descent cap-height ;
+
+: <gadget-metrics> ( gadget dim -- metrics )
+    second swap [ baseline ] [ cap-height ] bi
+    [ dup [ 2dup - ] [ f ] if ] dip
+    gadget-metrics boa ; inline
+
+: max-ascent ( seq -- n )
+    0 [ ascent>> [ max ] when* ] reduce ; inline
+
+: max-cap-height ( seq -- n )
+    0 [ cap-height>> [ max ] when* ] reduce ; inline
+
+: max-descent ( seq -- n )
+    0 [ descent>> [ max ] when* ] reduce ; inline
+
+: max-text-height ( seq -- y )
+    0 [ [ height>> ] [ ascent>> ] bi [ max ] [ drop ] if ] reduce ;
+
+: max-graphics-height ( seq -- y )
+    0 [ [ height>> ] [ ascent>> ] bi [ drop ] [ max ] if ] reduce ;
+
+: (align-baselines) ( y max leading -- y' ) [ swap - ] dip + ;
+
+:: combine-metrics ( graphics-height ascent descent cap-height -- ascent' descent' )
+    cap-height 2 / :> mid-line 
+    graphics-height 2 /
+    [ ascent mid-line - max mid-line + >integer ]
+    [ descent mid-line + max mid-line - >integer ] bi ;
+
+PRIVATE>
+
+:: align-baselines ( gadgets -- ys )
+    gadgets [ dup pref-dim <gadget-metrics> ] map
+    dup max-ascent :> max-ascent
+    dup max-cap-height :> max-cap-height
+    dup max-graphics-height :> max-graphics-height
+    
+    max-cap-height max-graphics-height + 2 /i :> critical-line
+    critical-line max-ascent [-] :> text-leading
+    max-ascent critical-line [-] :> graphics-leading
+
+    [
+        dup ascent>>
+        [ ascent>> max-ascent text-leading ]
+        [ height>> max-graphics-height graphics-leading ] if
+        (align-baselines)
+    ] map ;
+
+: measure-metrics ( children sizes -- ascent descent )
+    [ <gadget-metrics> ] 2map
+    {
+        [ max-graphics-height ]
+        [ max-ascent ]
+        [ max-descent ]
+        [ max-cap-height ]
+    } cleave
+    combine-metrics ;
+
+: measure-height ( children sizes -- height )
+    measure-metrics + ;
\ No newline at end of file
diff --git a/basis/ui/cocoa/authors.txt b/basis/ui/cocoa/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/ui/cocoa/cocoa.factor b/basis/ui/cocoa/cocoa.factor
deleted file mode 100755 (executable)
index 2fc8856..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors math arrays assocs cocoa cocoa.application
-command-line kernel memory namespaces cocoa.messages
-cocoa.runtime cocoa.subclassing cocoa.pasteboard cocoa.types
-cocoa.windows cocoa.classes cocoa.nibs sequences system ui
-ui.backend ui.clipboards ui.gadgets ui.gadgets.worlds
-ui.cocoa.views core-foundation core-foundation.run-loop threads
-math.geometry.rect fry libc generalizations alien.c-types
-cocoa.views combinators io.thread ;
-IN: ui.cocoa
-
-TUPLE: handle ;
-TUPLE: window-handle < handle view window ;
-TUPLE: offscreen-handle < handle context buffer ;
-
-C: <window-handle> window-handle
-C: <offscreen-handle> offscreen-handle
-
-SINGLETON: cocoa-ui-backend
-
-TUPLE: pasteboard handle ;
-
-C: <pasteboard> pasteboard
-
-M: pasteboard clipboard-contents
-    handle>> pasteboard-string ;
-
-M: pasteboard set-clipboard-contents
-    handle>> set-pasteboard-string ;
-
-: init-clipboard ( -- )
-    NSPasteboard -> generalPasteboard <pasteboard>
-    clipboard set-global
-    <clipboard> selection set-global ;
-
-: world>NSRect ( world -- NSRect )
-    [ window-loc>> ] [ dim>> ] bi [ first2 ] bi@ <NSRect> ;
-
-: gadget-window ( world -- )
-    dup <FactorView>
-    2dup swap world>NSRect <ViewWindow>
-    [ [ -> release ] [ install-window-delegate ] bi* ]
-    [ <window-handle> ] 2bi
-    >>handle drop ;
-
-M: cocoa-ui-backend set-title ( string world -- )
-    handle>> window>> swap <NSString> -> setTitle: ;
-
-: enter-fullscreen ( world -- )
-    handle>> view>>
-    NSScreen -> mainScreen
-    f -> enterFullScreenMode:withOptions:
-    drop ;
-
-: exit-fullscreen ( world -- )
-    handle>> view>> f -> exitFullScreenModeWithOptions: ;
-
-M: cocoa-ui-backend set-fullscreen* ( ? world -- )
-    swap [ enter-fullscreen ] [ exit-fullscreen ] if ;
-
-M: cocoa-ui-backend fullscreen* ( world -- ? )
-    handle>> view>> -> isInFullScreenMode zero? not ;
-
-: auto-position ( world -- )
-    dup window-loc>> { 0 0 } = [
-        handle>> window>> -> center
-    ] [
-        drop
-    ] if ;
-
-M: cocoa-ui-backend (open-window) ( world -- )
-    dup gadget-window
-    dup auto-position
-    handle>> window>> f -> makeKeyAndOrderFront: ;
-
-M: cocoa-ui-backend (close-window) ( handle -- )
-    window>> -> release ;
-
-M: cocoa-ui-backend close-window ( gadget -- )
-    find-world [
-        handle>> [
-            window>> f -> performClose:
-        ] when*
-    ] when* ;
-
-M: cocoa-ui-backend raise-window* ( world -- )
-    handle>> [
-        window>> dup f -> orderFront: -> makeKeyWindow
-        NSApp 1 -> activateIgnoringOtherApps:
-    ] when* ;
-
-: pixel-size ( pixel-format -- size )
-    0 <int> [ NSOpenGLPFAColorSize 0 -> getValues:forAttribute:forVirtualScreen: ]
-    keep *int -3 shift ;
-
-: offscreen-buffer ( world pixel-format -- alien w h pitch )
-    [ dim>> first2 ] [ pixel-size ] bi*
-    { [ * * malloc ] [ 2drop ] [ drop nip ] [ nip * ] } 3cleave ;
-
-: gadget-offscreen-context ( world -- context buffer )
-    NSOpenGLPFAOffScreen 1array <PixelFormat>
-    [ nip NSOpenGLContext -> alloc swap f -> initWithFormat:shareContext: dup ]
-    [ offscreen-buffer ] 2bi
-    4 npick [ -> setOffScreen:width:height:rowbytes: ] dip ;
-
-M: cocoa-ui-backend (open-offscreen-buffer) ( world -- )
-    dup gadget-offscreen-context <offscreen-handle> >>handle drop ;
-
-M: cocoa-ui-backend (close-offscreen-buffer) ( handle -- )
-    [ context>> -> release ]
-    [ buffer>> free ] bi ;
-
-GENERIC: (gl-context) ( handle -- context )
-M: window-handle (gl-context) view>> -> openGLContext ;
-M: offscreen-handle (gl-context) context>> ;
-
-M: handle select-gl-context ( handle -- )
-    (gl-context) -> makeCurrentContext ;
-
-M: handle flush-gl-context ( handle -- )
-    (gl-context) -> flushBuffer ;
-
-M: cocoa-ui-backend offscreen-pixels ( world -- alien w h )
-    [ handle>> buffer>> ] [ dim>> first2 neg ] bi ;
-
-M: cocoa-ui-backend beep ( -- )
-    NSBeep ;
-
-CLASS: {
-    { +superclass+ "NSObject" }
-    { +name+ "FactorApplicationDelegate" }
-}
-
-{  "applicationDidUpdate:" "void" { "id" "SEL" "id" }
-    [ 3drop reset-run-loop ]
-} ;
-
-: install-app-delegate ( -- )
-    NSApp FactorApplicationDelegate install-delegate ;
-
-SYMBOL: cocoa-init-hook
-
-cocoa-init-hook [
-    [ "MiniFactor.nib" load-nib install-app-delegate ]
-] initialize
-
-M: cocoa-ui-backend ui
-    "UI" assert.app [
-        [
-            init-clipboard
-            cocoa-init-hook get call
-            start-ui
-            f io-thread-running? set-global
-            init-thread-timer
-            reset-run-loop
-            NSApp -> run
-        ] ui-running
-    ] with-cocoa ;
-
-cocoa-ui-backend ui-backend set-global
-
-[ running.app? "ui" "listener" ? ] main-vocab-hook set-global
diff --git a/basis/ui/cocoa/summary.txt b/basis/ui/cocoa/summary.txt
deleted file mode 100644 (file)
index dc5a8b5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Cocoa UI backend
diff --git a/basis/ui/cocoa/tags.txt b/basis/ui/cocoa/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/basis/ui/cocoa/tools/authors.txt b/basis/ui/cocoa/tools/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/ui/cocoa/tools/summary.txt b/basis/ui/cocoa/tools/summary.txt
deleted file mode 100644 (file)
index 8441c02..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Cocoa integration for UI developer tools
diff --git a/basis/ui/cocoa/tools/tags.txt b/basis/ui/cocoa/tools/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/basis/ui/cocoa/tools/tools.factor b/basis/ui/cocoa/tools/tools.factor
deleted file mode 100644 (file)
index a0755e9..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax cocoa cocoa.nibs cocoa.application
-cocoa.classes cocoa.dialogs cocoa.pasteboard cocoa.subclassing
-core-foundation core-foundation.strings help.topics kernel
-memory namespaces parser system ui ui.tools.browser
-ui.tools.listener ui.tools.workspace ui.cocoa eval locals ;
-IN: ui.cocoa.tools
-
-: finder-run-files ( alien -- )
-    CF>string-array listener-run-files
-    NSApp NSApplicationDelegateReplySuccess
-    -> replyToOpenOrPrint: ;
-
-: menu-run-files ( -- )
-    open-panel [ listener-run-files ] when* ;
-
-: menu-save-image ( -- )
-    image save-panel [ save-image ] when* ;
-
-! Handle Open events from the Finder
-CLASS: {
-    { +superclass+ "FactorApplicationDelegate" }
-    { +name+ "FactorWorkspaceApplicationDelegate" }
-}
-
-{ "application:openFiles:" "void" { "id" "SEL" "id" "id" }
-    [ [ 3drop ] dip finder-run-files ]
-}
-
-{ "newFactorWorkspace:" "id" { "id" "SEL" "id" }
-    [ 3drop workspace-window f ]
-}
-
-{ "runFactorFile:" "id" { "id" "SEL" "id" }
-    [ 3drop menu-run-files f ]
-}
-
-{ "saveFactorImage:" "id" { "id" "SEL" "id" }
-    [ 3drop save f ]
-}
-
-{ "saveFactorImageAs:" "id" { "id" "SEL" "id" }
-    [ 3drop menu-save-image f ]
-}
-
-{ "showFactorHelp:" "id" { "id" "SEL" "id" }
-    [ 3drop "handbook" com-follow f ]
-} ;
-
-: install-app-delegate ( -- )
-    NSApp FactorWorkspaceApplicationDelegate install-delegate ;
-
-! Service support; evaluate Factor code from other apps
-:: do-service ( pboard error quot -- )
-    pboard error ?pasteboard-string
-    dup [ quot call ] when
-    [ pboard set-pasteboard-string ] when* ;
-
-CLASS: {
-    { +superclass+ "NSObject" }
-    { +name+ "FactorServiceProvider" }
-} {
-    "evalInListener:userData:error:"
-    "void"
-    { "id" "SEL" "id" "id" "void*" }
-    [ nip [ eval-listener f ] do-service 2drop ]
-} {
-    "evalToString:userData:error:"
-    "void"
-    { "id" "SEL" "id" "id" "void*" }
-    [ nip [ eval>string ] do-service 2drop ]
-} ;
-
-: register-services ( -- )
-    NSApp
-    FactorServiceProvider -> alloc -> init
-    -> setServicesProvider: ;
-
-FUNCTION: void NSUpdateDynamicServices ;
-
-[
-    install-app-delegate
-    "Factor.nib" load-nib
-    register-services
-] cocoa-init-hook set-global
diff --git a/basis/ui/cocoa/views/authors.txt b/basis/ui/cocoa/views/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/ui/cocoa/views/summary.txt b/basis/ui/cocoa/views/summary.txt
deleted file mode 100644 (file)
index afbfa2a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Cocoa NSView implementation displaying Factor gadgets
diff --git a/basis/ui/cocoa/views/tags.txt b/basis/ui/cocoa/views/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/basis/ui/cocoa/views/views-tests.factor b/basis/ui/cocoa/views/views-tests.factor
deleted file mode 100644 (file)
index fc64534..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-IN: ui.cocoa.views.tests
-USING: ui.cocoa.views tools.test kernel math.geometry.rect
-namespaces ;
-
-[ t ] [
-    T{ rect
-        { loc { 0 0 } }
-        { dim { 1000 1000 } }
-    } "world" set
-
-    T{ rect
-        { loc { 1.5 2.25 } }
-        { dim { 13.0 14.0 } }
-    } dup "world" get rect>NSRect "world" get NSRect>rect =
-] unit-test
diff --git a/basis/ui/cocoa/views/views.factor b/basis/ui/cocoa/views/views.factor
deleted file mode 100644 (file)
index 9e32f2f..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-! Copyright (C) 2006, 2008 Slava Pestov
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien alien.c-types arrays assocs cocoa kernel
-math cocoa.messages cocoa.subclassing cocoa.classes cocoa.views
-cocoa.application cocoa.pasteboard cocoa.types cocoa.windows
-sequences ui ui.gadgets ui.gadgets.worlds ui.gestures
-core-foundation.strings threads combinators math.geometry.rect ;
-IN: ui.cocoa.views
-
-: send-mouse-moved ( view event -- )
-    [ mouse-location ] [ drop window ] 2bi move-hand fire-motion ;
-
-: button ( event -- n )
-    #! Cocoa -> Factor UI button mapping
-    -> buttonNumber H{ { 0 1 } { 2 2 } { 1 3 } } at ;
-
-CONSTANT: modifiers
-    {
-        { S+ HEX: 20000 }
-        { C+ HEX: 40000 }
-        { A+ HEX: 100000 }
-        { M+ HEX: 80000 }
-    }
-
-CONSTANT: key-codes
-    H{
-        { 71 "CLEAR" }
-        { 36 "RET" }
-        { 76 "ENTER" }
-        { 53 "ESC" }
-        { 48 "TAB" }
-        { 51 "BACKSPACE" }
-        { 115 "HOME" }
-        { 117 "DELETE" }
-        { 119 "END" }
-        { 122 "F1" }
-        { 120 "F2" }
-        { 99 "F3" }
-        { 118 "F4" }
-        { 96 "F5" }
-        { 97 "F6" }
-        { 98 "F7" }
-        { 100 "F8" }
-        { 123 "LEFT" }
-        { 124 "RIGHT" }
-        { 125 "DOWN" }
-        { 126 "UP" }
-        { 116 "PAGE_UP" }
-        { 121 "PAGE_DOWN" }
-    }
-
-: key-code ( event -- string ? )
-    dup -> keyCode key-codes at
-    [ t ] [ -> charactersIgnoringModifiers CF>string f ] ?if ;
-
-: event-modifiers ( event -- modifiers )
-    -> modifierFlags modifiers modifier ;
-
-: key-event>gesture ( event -- modifiers keycode action? )
-    dup event-modifiers swap key-code ;
-
-: send-key-event ( view gesture -- )
-    swap window propagate-key-gesture ;
-
-: interpret-key-event ( view event -- )
-    NSArray swap -> arrayWithObject: -> interpretKeyEvents: ;
-
-: send-key-down-event ( view event -- )
-    [ key-event>gesture <key-down> send-key-event ]
-    [ interpret-key-event ]
-    2bi ;
-
-: send-key-up-event ( view event -- )
-    key-event>gesture <key-up> send-key-event ;
-
-: mouse-event>gesture ( event -- modifiers button )
-    dup event-modifiers swap button ;
-
-: send-button-down$ ( view event -- )
-    [ nip mouse-event>gesture <button-down> ]
-    [ mouse-location ]
-    [ drop window ]
-    2tri send-button-down ;
-
-: send-button-up$ ( view event -- )
-    [ nip mouse-event>gesture <button-up> ]
-    [ mouse-location ]
-    [ drop window ]
-    2tri send-button-up ;
-
-: send-wheel$ ( view event -- )
-    [ nip [ -> deltaX ] [ -> deltaY ] bi [ sgn neg ] bi@ 2array ]
-    [ mouse-location ]
-    [ drop window ]
-    2tri send-wheel ;
-
-: send-action$ ( view event gesture -- junk )
-    [ drop window ] dip send-action f ;
-
-: add-resize-observer ( observer object -- )
-    [
-        "updateFactorGadgetSize:"
-        "NSViewFrameDidChangeNotification" <NSString>
-    ] dip add-observer ;
-
-: string-or-nil? ( NSString -- ? )
-    [ CF>string NSStringPboardType = ] [ t ] if* ;
-
-: valid-service? ( gadget send-type return-type -- ? )
-    over string-or-nil? over string-or-nil? and
-    [ drop [ gadget-selection? ] [ drop t ] if ] [ 3drop f ] if ;
-
-: NSRect>rect ( NSRect world -- rect )
-    [ [ [ NSRect-x ] [ NSRect-y ] bi ] [ dim>> second ] bi* swap - 2array ]
-    [ drop [ NSRect-w ] [ NSRect-h ] bi 2array ]
-    2bi <rect> ;
-
-: rect>NSRect ( rect world -- NSRect )
-    [ [ rect-loc first2 ] [ dim>> second ] bi* swap - ]
-    [ drop rect-dim first2 ]
-    2bi <NSRect> ;
-
-CLASS: {
-    { +superclass+ "NSOpenGLView" }
-    { +name+ "FactorView" }
-    { +protocols+ { "NSTextInput" } }
-}
-
-! Rendering
-{ "drawRect:" "void" { "id" "SEL" "NSRect" }
-    [ 2drop window relayout-1 ]
-}
-
-! Events
-{ "acceptsFirstMouse:" "char" { "id" "SEL" "id" }
-    [ 3drop 1 ]
-}
-
-{ "mouseEntered:" "void" { "id" "SEL" "id" }
-    [ nip send-mouse-moved ]
-}
-
-{ "mouseExited:" "void" { "id" "SEL" "id" }
-    [ 3drop forget-rollover ]
-}
-
-{ "mouseMoved:" "void" { "id" "SEL" "id" }
-    [ nip send-mouse-moved ]
-}
-
-{ "mouseDragged:" "void" { "id" "SEL" "id" }
-    [ nip send-mouse-moved ]
-}
-
-{ "rightMouseDragged:" "void" { "id" "SEL" "id" }
-    [ nip send-mouse-moved ]
-}
-
-{ "otherMouseDragged:" "void" { "id" "SEL" "id" }
-    [ nip send-mouse-moved ]
-}
-
-{ "mouseDown:" "void" { "id" "SEL" "id" }
-    [ nip send-button-down$ ]
-}
-
-{ "mouseUp:" "void" { "id" "SEL" "id" }
-    [ nip send-button-up$ ]
-}
-
-{ "rightMouseDown:" "void" { "id" "SEL" "id" }
-    [ nip send-button-down$ ]
-}
-
-{ "rightMouseUp:" "void" { "id" "SEL" "id" }
-    [ nip send-button-up$ ]
-}
-
-{ "otherMouseDown:" "void" { "id" "SEL" "id" }
-    [ nip send-button-down$ ]
-}
-
-{ "otherMouseUp:" "void" { "id" "SEL" "id" }
-    [ nip send-button-up$ ]
-}
-
-{ "scrollWheel:" "void" { "id" "SEL" "id" }
-    [ nip send-wheel$ ]
-}
-
-{ "keyDown:" "void" { "id" "SEL" "id" }
-    [ nip send-key-down-event ]
-}
-
-{ "keyUp:" "void" { "id" "SEL" "id" }
-    [ nip send-key-up-event ]
-}
-
-{ "cut:" "id" { "id" "SEL" "id" }
-    [ nip T{ cut-action } send-action$ ]
-}
-
-{ "copy:" "id" { "id" "SEL" "id" }
-    [ nip T{ copy-action } send-action$ ]
-}
-
-{ "paste:" "id" { "id" "SEL" "id" }
-    [ nip T{ paste-action } send-action$ ]
-}
-
-{ "delete:" "id" { "id" "SEL" "id" }
-    [ nip T{ delete-action } send-action$ ]
-}
-
-{ "selectAll:" "id" { "id" "SEL" "id" }
-    [ nip T{ select-all-action } send-action$ ]
-}
-
-! Multi-touch gestures: this is undocumented.
-! http://cocoadex.com/2008/02/nsevent-modifications-swipe-ro.html
-{ "magnifyWithEvent:" "void" { "id" "SEL" "id" }
-    [
-        nip
-        dup -> deltaZ sgn {
-            {  1 [ T{ zoom-in-action } send-action$ ] }
-            { -1 [ T{ zoom-out-action } send-action$ ] }
-            {  0 [ 2drop ] }
-        } case
-    ]
-}
-
-{ "swipeWithEvent:" "void" { "id" "SEL" "id" }
-    [
-        nip
-        dup -> deltaX sgn {
-            {  1 [ T{ left-action } send-action$ ] }
-            { -1 [ T{ right-action } send-action$ ] }
-            {  0
-                [
-                    dup -> deltaY sgn {
-                        {  1 [ T{ up-action } send-action$ ] }
-                        { -1 [ T{ down-action } send-action$ ] }
-                        {  0 [ 2drop ] }
-                    } case
-                ]
-            }
-        } case
-    ]
-}
-
-! "rotateWithEvent:" "void" { "id" "SEL" "id" }}
-
-{ "acceptsFirstResponder" "char" { "id" "SEL" }
-    [ 2drop 1 ]
-}
-
-! Services
-{ "validRequestorForSendType:returnType:" "id" { "id" "SEL" "id" "id" }
-    [
-        ! We return either self or nil
-        [ over window-focus ] 2dip
-        valid-service? [ drop ] [ 2drop f ] if
-    ]
-}
-
-{ "writeSelectionToPasteboard:types:" "char" { "id" "SEL" "id" "id" }
-    [
-        CF>string-array NSStringPboardType swap member? [
-            [ drop window-focus gadget-selection ] dip over
-            [ set-pasteboard-string 1 ] [ 2drop 0 ] if
-        ] [ 3drop 0 ] if
-    ]
-}
-
-{ "readSelectionFromPasteboard:" "char" { "id" "SEL" "id" }
-    [
-        pasteboard-string dup [
-            [ drop window ] dip swap user-input 1
-        ] [ 3drop 0 ] if
-    ]
-}
-
-! Text input
-{ "insertText:" "void" { "id" "SEL" "id" }
-    [ nip CF>string swap window user-input ]
-}
-
-{ "hasMarkedText" "char" { "id" "SEL" }
-    [ 2drop 0 ]
-}
-
-{ "markedRange" "NSRange" { "id" "SEL" }
-    [ 2drop 0 0 <NSRange> ]
-}
-
-{ "selectedRange" "NSRange" { "id" "SEL" }
-    [ 2drop 0 0 <NSRange> ]
-}
-
-{ "setMarkedText:selectedRange:" "void" { "id" "SEL" "id" "NSRange" }
-    [ 2drop 2drop ]
-}
-
-{ "unmarkText" "void" { "id" "SEL" }
-    [ 2drop ]
-}
-
-{ "validAttributesForMarkedText" "id" { "id" "SEL" }
-    [ 2drop NSArray -> array ]
-}
-
-{ "attributedSubstringFromRange:" "id" { "id" "SEL" "NSRange" }
-    [ 3drop f ]
-}
-
-{ "characterIndexForPoint:" "NSUInteger" { "id" "SEL" "NSPoint" }
-    [ 3drop 0 ]
-}
-
-{ "firstRectForCharacterRange:" "NSRect" { "id" "SEL" "NSRange" }
-    [ 3drop 0 0 0 0 <NSRect> ]
-}
-
-{ "conversationIdentifier" "NSInteger" { "id" "SEL" }
-    [ drop alien-address ]
-}
-
-! Initialization
-{ "updateFactorGadgetSize:" "void" { "id" "SEL" "id" }
-    [ 2drop dup view-dim swap window (>>dim) yield ]
-}
-
-{ "doCommandBySelector:" "void" { "id" "SEL" "SEL" }
-    [ 3drop ]
-}
-
-{ "initWithFrame:pixelFormat:" "id" { "id" "SEL" "NSRect" "id" }
-    [
-        [ drop ] 2dip
-        SUPER-> initWithFrame:pixelFormat:
-        dup dup add-resize-observer
-    ]
-}
-
-{ "dealloc" "void" { "id" "SEL" }
-    [
-        drop
-        [ unregister-window ]
-        [ remove-observer ]
-        [ SUPER-> dealloc ]
-        tri
-    ]
-} ;
-
-: sync-refresh-to-screen ( GLView -- )
-    -> openGLContext -> CGLContextObj NSOpenGLCPSwapInterval 1 <int>
-    CGLSetParameter drop ;
-
-: <FactorView> ( world -- view )
-    FactorView over rect-dim <GLView>
-    [ sync-refresh-to-screen ] keep
-    [ register-window ] keep ;
-
-CLASS: {
-    { +superclass+ "NSObject" }
-    { +name+ "FactorWindowDelegate" }
-}
-
-{ "windowDidMove:" "void" { "id" "SEL" "id" }
-    [
-        2nip -> object
-        dup window-content-rect NSRect-x-y 2array
-        swap -> contentView window (>>window-loc)
-    ]
-}
-
-{ "windowDidBecomeKey:" "void" { "id" "SEL" "id" }
-    [
-        2nip -> object -> contentView window focus-world
-    ]
-}
-
-{ "windowDidResignKey:" "void" { "id" "SEL" "id" }
-    [
-        forget-rollover
-        2nip -> object -> contentView window unfocus-world
-    ]
-}
-
-{ "windowShouldClose:" "char" { "id" "SEL" "id" }
-    [
-        3drop 1
-    ]
-}
-
-{ "windowWillClose:" "void" { "id" "SEL" "id" }
-    [
-        2nip -> object -> contentView window ungraft
-    ]
-} ;
-
-: install-window-delegate ( window -- )
-    FactorWindowDelegate install-delegate ;
index 78b82a345c211ab150d32f4128e7977ff774a27b..81a4096aab82ee4c08a2eaa4c72e7ff22bc4353b 100644 (file)
@@ -110,7 +110,7 @@ HELP: command-string
 { $values { "gesture" "a gesture" } { "command" "a command" } { "string" string } }
 { $description "Outputs a string containing the command name followed by the gesture." }
 { $examples
-    { $example
+    { $unchecked-example
         "USING: io ui.commands ui.gestures ;"
         "IN: scratchpad"
         ": com-my-command ;"
index 8001ff97618223e3ed291fb4bc867989717be352..7dfd8e3edf6787f40ea75576c7a58561d828ce00 100644 (file)
@@ -1,18 +1,16 @@
 IN: ui.commands.tests
 USING: ui.commands ui.gestures tools.test help.markup io
-io.streams.string ;
+io.streams.string system kernel ;
 
-[ "A+a" ] [ T{ key-down f { A+ } "a" } gesture>string ] unit-test
-[ "b" ] [ T{ key-down f f "b" } gesture>string ] unit-test
 [ "Press Button 2" ] [ T{ button-down f f 2 } gesture>string ] unit-test
 
-: com-test-1 ;
+: com-test-1 ( -- ) ;
 
 \ com-test-1 H{ } define-command
 
 [ [ 3 com-test-1 ] ] [ 3 \ com-test-1 command-quot ] unit-test
 
-: com-test-2 ;
+: com-test-2 ( -- ) ;
 
 \ com-test-2 H{ { +nullary+ t } } define-command
 
@@ -24,8 +22,26 @@ testing "testing" "hey" {
     { T{ key-down f { C+ } "x" } com-test-1 }
 } define-command-map
 
-[ "C+x" ] [
-    [
-        { $command testing "testing" com-test-1 } print-element
-    ] with-string-writer
-] unit-test
+os macosx? [
+    [ "⌘A" ] [ T{ key-down f { A+ } "a" } gesture>string ] unit-test
+    [ "B" ] [ T{ key-down f f "b" } gesture>string ] unit-test
+
+    [ "⌃X" ] [
+        [
+            { $command testing "testing" com-test-1 } print-element
+        ] with-string-writer
+    ] unit-test
+] [
+    [ "A+a" ] [ T{ key-down f { A+ } "a" } gesture>string ] unit-test
+    [ "b" ] [ T{ key-down f f "b" } gesture>string ] unit-test
+
+    [ "C+x" ] [
+        [
+            { $command testing "testing" com-test-1 } print-element
+        ] with-string-writer
+    ] unit-test
+] if
+
+: com-foo. ( -- ) ;
+
+[ "Foo" ] [ \ com-foo. command-name ] unit-test
\ No newline at end of file
index 5f8c3381b7bd2634844e6f30f4409924f45f30b0..d6c7c7905be1aa9b9f3191561ca455a233c767a1 100644 (file)
@@ -2,7 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays definitions kernel sequences strings
 math assocs words generic namespaces make assocs quotations
-splitting ui.gestures unicode.case unicode.categories tr fry ;
+splitting ui.gestures unicode.case unicode.categories tr fry
+call ;
 IN: ui.commands
 
 SYMBOL: +nullary+
@@ -56,7 +57,7 @@ TR: convert-command-name "-" " " ;
 
 M: word command-name ( word -- str )
     name>> 
-    "com-" ?head drop
+    "com-" ?head drop "." ?tail drop
     dup first Letter? [ rest ] unless
     (command-name) ;
 
@@ -70,11 +71,11 @@ M: word command-description ( word -- str )
     [ props>> ] [ default-flags swap assoc-union ] bi* update ;
 
 : command-quot ( target command -- quot )
-    dup 1quotation swap +nullary+ word-prop
+    [ 1quotation ] [ +nullary+ word-prop ] bi
     [ nip ] [ curry ] if ;
 
 M: word invoke-command ( target command -- )
-    command-quot call ;
+    command-quot call( -- ) ;
 
 M: word command-word ;
 
@@ -84,4 +85,4 @@ M: f invoke-command ( target command -- ) 2drop ;
     [
         command-name %
         gesture>string [ " (" % % ")" % ] when*
-    ] "" make ;
+    ] "" make ;
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index 26983e3..f054d2b
@@ -1,7 +1,7 @@
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: calendar combinators deques kernel namespaces sequences
-threads ui ui.backend ui.gadgets ;
+threads ui ui.private ui.backend ui.gadgets ui.gadgets.private ;
 IN: ui.event-loop
 
 : event-loop? ( -- ? )
diff --git a/basis/ui/freetype/authors.txt b/basis/ui/freetype/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/ui/freetype/freetype-docs.factor b/basis/ui/freetype/freetype-docs.factor
deleted file mode 100644 (file)
index ef01c67..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-USING: help.syntax help.markup strings kernel alien opengl
-quotations ui.render io.styles freetype ;
-IN: ui.freetype
-
-HELP: freetype
-{ $values { "alien" alien } }
-{ $description "Outputs a native handle used by the FreeType library, initializing FreeType first if necessary." } ;
-
-HELP: open-fonts
-{ $var-description "Global variable. Hashtable mapping font descriptors to " { $link font } " instances." } ;
-
-{ font open-fonts open-font char-width string-width text-dim draw-string draw-text } related-words
-
-HELP: init-freetype
-{ $description "Initializes the FreeType library." }
-{ $notes "Do not call this word if you are using the UI." } ;
-
-HELP: font
-
-{ $class-description
-
-"A font which has been loaded by FreeType. Font instances have the following slots:"
-
-{
-  $list
-  {
-    { $snippet "ascent"  } ", "
-    { $snippet "descent" } ", "
-    { $snippet "height"  } " - metrics."
-  }
-
-  {
-    { $snippet "handle" }
-    " - alien pointer to an "
-    { $snippet "FT_Face" } "."
-  }
-
-  {
-    { $snippet "widths" }
-    " - sequence of character widths. Use "
-    { $snippet "width" }
-    " and "
-    { $snippet "width" }
-    " to compute string widths instead of reading this sequence directly."
-  }
-}
-
-} ;
-
-HELP: close-freetype
-{ $description "Closes the FreeType library." }
-{ $notes "Do not call this word if you are using the UI." } ;
-
-HELP: open-face
-{ $values { "font" string } { "style" "one of " { $link plain } ", " { $link bold } ", " { $link italic } " or " { $link bold-italic } } { "face" "alien pointer to an " { $snippet "FT_Face" } } }
-{ $description "Loads a TrueType font with the requested logical font name and style." }
-{ $notes "This is a low-level word. Call " { $link open-font } " instead." } ;
-
-HELP: render-glyph
-{ $values  { "font" font } { "char" "a non-negative integer" } { "bitmap" alien } }
-{ $description "Renders a character and outputs a pointer to the bitmap." } ;
-
-HELP: <char-sprite>
-{ $values { "open-font" font } { "char" "a non-negative integer" } { "sprite" sprite } }
-{ $description "Renders a character to an OpenGL texture and records a display list which draws a quad with this texture. This word allocates native resources which must be freed by " { $link free-sprites } "." } ;
-
-HELP: (draw-string)
-{ $values { "open-font" font } { "sprites" "a vector of " { $link sprite } " instances" } { "string" string } { "loc" "a pair of integers" } }
-{ $description "Draws a line of text." }
-{ $notes "This is a low-level word, UI code should use " { $link draw-string } " or " { $link draw-text } " instead." }
-{ $side-effects "sprites" } ;
-
-HELP: run-char-widths
-{ $values { "open-font" font } { "string" string } { "widths" "a sequence of integers" } }
-{ $description "Outputs a sequence of x co-ordinates of the midpoint of each character in the string." }
-{ $notes "This word is used to convert x offsets to document locations, for example when the user moves the caret by clicking the mouse." } ;
diff --git a/basis/ui/freetype/freetype.factor b/basis/ui/freetype/freetype.factor
deleted file mode 100644 (file)
index 0f36f3d..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.accessors alien.c-types arrays io kernel libc
-math math.vectors namespaces opengl opengl.gl assocs
-sequences io.files io.styles continuations freetype
-ui.gadgets.worlds ui.render ui.backend byte-arrays accessors
-locals specialized-arrays.direct.uchar ;
-IN: ui.freetype
-
-TUPLE: freetype-renderer ;
-
-SYMBOL: open-fonts
-
-: freetype-error ( n -- )
-    zero? [ "FreeType error" throw ] unless ;
-
-DEFER: freetype
-
-: init-freetype ( -- )
-    global [
-        f <void*> dup FT_Init_FreeType freetype-error
-        *void* \ freetype set
-        H{ } clone open-fonts set
-    ] bind ;
-
-: freetype ( -- alien )
-    \ freetype get-global expired? [ init-freetype ] when
-    \ freetype get-global ;
-
-TUPLE: font < identity-tuple
-ascent descent height handle widths ;
-
-M: font hashcode* drop font hashcode* ;
-
-: close-font ( font -- ) handle>> FT_Done_Face ;
-
-: close-freetype ( -- )
-    global [
-        open-fonts [ [ drop close-font ] assoc-each f ] change
-        freetype [ FT_Done_FreeType f ] change
-    ] bind ;
-
-M: freetype-renderer free-fonts ( world -- )
-    [ handle>> select-gl-context ]
-    [ fonts>> [ nip second free-sprites ] assoc-each ] bi ;
-
-: ttf-name ( font style -- name )
-    2array H{
-        { { "monospace" plain        } "VeraMono" }
-        { { "monospace" bold         } "VeraMoBd" }
-        { { "monospace" bold-italic  } "VeraMoBI" }
-        { { "monospace" italic       } "VeraMoIt" }
-        { { "sans-serif" plain       } "Vera"     }
-        { { "sans-serif" bold        } "VeraBd"   }
-        { { "sans-serif" bold-italic } "VeraBI"   }
-        { { "sans-serif" italic      } "VeraIt"   }
-        { { "serif" plain            } "VeraSe"   }
-        { { "serif" bold             } "VeraSeBd" }
-        { { "serif" bold-italic      } "VeraBI"   }
-        { { "serif" italic           } "VeraIt"   }
-    } at ;
-
-: ttf-path ( name -- string )
-    "resource:fonts/" ".ttf" surround ;
-
-: (open-face) ( path length -- face )
-    #! We use FT_New_Memory_Face, not FT_New_Face, since
-    #! FT_New_Face only takes an ASCII path name and causes
-    #! problems on localized versions of Windows
-    [ freetype ] 2dip 0 f <void*> [
-        FT_New_Memory_Face freetype-error
-    ] keep *void* ;
-
-: open-face ( font style -- face )
-    ttf-name ttf-path malloc-file-contents (open-face) ;
-
-SYMBOL: dpi
-
-72 dpi set-global
-
-: ft-floor ( m -- n ) -6 shift ; inline
-
-: ft-ceil ( m -- n ) 63 + -64 bitand -6 shift ; inline
-
-: font-units>pixels ( n font -- n )
-    face-size face-size-y-scale FT_MulFix ;
-
-: init-ascent ( font face -- font )
-    dup face-y-max swap font-units>pixels >>ascent ; inline
-
-: init-descent ( font face -- font )
-    dup face-y-min swap font-units>pixels >>descent ; inline
-
-: init-font ( font -- font )
-    dup handle>> init-ascent
-    dup handle>> init-descent
-    dup [ ascent>> ] [ descent>> ] bi - ft-ceil >>height ; inline
-
-: set-char-size ( open-font size -- open-font )
-    [ dup handle>> 0 ] dip
-    6 shift dpi get-global dup FT_Set_Char_Size freetype-error ;
-
-: <font> ( font -- open-font )
-    font new
-        H{ } clone >>widths
-        over first2 open-face >>handle
-        swap third set-char-size
-        init-font ;
-
-M: freetype-renderer open-font ( font -- open-font )
-    freetype drop open-fonts get [ <font> ] cache ;
-
-: load-glyph ( font char -- glyph )
-    [ handle>> dup ] dip 0 FT_Load_Char
-    freetype-error face-glyph ;
-
-: char-width ( open-font char -- w )
-    over widths>> [
-        dupd load-glyph glyph-hori-advance ft-ceil
-    ] cache nip ;
-
-M: freetype-renderer string-width ( open-font string -- w )
-    [ 0 ] 2dip [ char-width + ] with each ;
-
-M: freetype-renderer string-height ( open-font string -- h )
-    drop height>> ;
-
-: glyph-size ( glyph -- dim )
-    dup glyph-hori-advance ft-ceil
-    swap glyph-height ft-ceil 2array ;
-
-: render-glyph ( font char -- bitmap )
-    load-glyph dup
-    FT_RENDER_MODE_NORMAL FT_Render_Glyph freetype-error ;
-
-:: copy-pixel ( i j bitmap texture -- i j )
-    255 j texture set-nth
-    i bitmap nth j 1 + texture set-nth
-    i 1 + j 2 + ; inline
-
-:: (copy-row) ( i j bitmap texture end -- )
-    i end < [
-        i j bitmap texture copy-pixel
-            bitmap texture end (copy-row)
-    ] when ; inline recursive
-
-:: copy-row ( i j bitmap texture width width2 -- i j )
-    i j bitmap texture i width + (copy-row)
-    i width +
-    j width2 + ; inline
-
-:: copy-bitmap ( glyph texture -- )
-    [let* | bitmap [ glyph glyph-bitmap-buffer ]
-            rows [ glyph glyph-bitmap-rows ]
-            width [ glyph glyph-bitmap-width ]
-            width2 [ width next-power-of-2 2 * ] |
-        bitmap [
-            [let | bitmap' [ bitmap rows width * <direct-uchar-array> ] |
-                0 0
-                rows [ bitmap' texture width width2 copy-row ] times
-                2drop
-            ]
-        ] when
-    ] ;
-
-: bitmap>texture ( glyph sprite -- id )
-    tuck sprite-size2 * 2 * <byte-array>
-    [ copy-bitmap ] keep gray-texture ;
-
-: glyph-texture-loc ( glyph font -- loc )
-    [ drop glyph-hori-bearing-x ft-floor ]
-    [ ascent>> swap glyph-hori-bearing-y - ft-floor ]
-    2bi 2array ;
-
-: glyph-texture-size ( glyph -- dim )
-    [ glyph-bitmap-width next-power-of-2 ]
-    [ glyph-bitmap-rows next-power-of-2 ]
-    bi 2array ;
-
-: <char-sprite> ( open-font char -- sprite )
-    over [ render-glyph dup ] dip glyph-texture-loc
-    over glyph-size pick glyph-texture-size <sprite>
-    [ bitmap>texture ] keep [ init-sprite ] keep ;
-
-:: char-sprite ( open-font sprites char -- sprite )
-    char sprites [ open-font swap <char-sprite> ] cache ;
-
-: draw-char ( open-font sprites char loc -- )
-    GL_MODELVIEW [
-        0 0 glTranslated
-        char-sprite dlist>> glCallList
-    ] do-matrix ;
-
-: char-widths ( open-font string -- widths )
-    [ char-width ] with { } map-as ;
-
-: scan-sums ( seq -- seq' )
-    0 [ + ] accumulate nip ;
-
-:: (draw-string) ( open-font sprites string loc -- )
-    GL_TEXTURE_2D [
-        loc [
-            string open-font string char-widths scan-sums [
-                [ open-font sprites ] 2dip draw-char
-            ] 2each
-        ] with-translation
-    ] do-enabled ;
-
-: font-sprites ( font world -- open-font sprites )
-    fonts>> [ open-font H{ } clone 2array ] cache first2 ;
-
-M: freetype-renderer draw-string ( font string loc -- )
-    [ world get font-sprites ] 2dip (draw-string) ;
-
-: run-char-widths ( open-font string -- widths )
-    char-widths [ scan-sums ] [ 2 v/n ] bi v+ ;
-
-M: freetype-renderer x>offset ( x open-font string -- n )
-    [ run-char-widths [ <= ] with find drop ] keep swap
-    [ ] [ length ] ?if ;
-
-T{ freetype-renderer } font-renderer set-global
diff --git a/basis/ui/freetype/summary.txt b/basis/ui/freetype/summary.txt
deleted file mode 100644 (file)
index f7bfcac..0000000
+++ /dev/null
@@ -1 +0,0 @@
-UI text rendering implementation based on FreeType
index f6f5d7dd4d3fc3bd4294f871c5d0286f3af0026e..38018fa720c95db79ca53ac103eb7fd7cc6ed667 100644 (file)
@@ -8,11 +8,17 @@ $nl
 
 HELP: <book>
 { $values { "pages" "a sequence of gadgets" } { "model" model } { "book" book } }
-{ $description "Creates a " { $link book } " control, which contains the gadgets in " { $snippet "pages" } ". A book shows one child at a time, determined by the value of the model, which must be an integer " } ;
+{ $description "Creates a " { $link book } " control, which contains the gadgets in " { $snippet "pages" } "." } ;
+
+HELP: <empty-book>
+{ $values { "model" model } { "book" book } }
+{ $description "Creates a " { $link book } " control with no children." }
+{ $notes "Children must be added to the book before it is grafted, otherwise an error will be thrown." } ;
 
 ARTICLE: "ui-book-layout" "Book layouts"
-"Books can contain any number of children, and display one child at a time."
+"Books can contain any number of children, and display one child at a time. The currently visible child is determined by the value of the model, which must be an integer."
 { $subsection book }
-{ $subsection <book> } ;
+{ $subsection <book> }
+{ $subsection <empty-book> } ;
 
 ABOUT: "ui-book-layout"
index 4ef90d87b98f518c4f3d642151e96862f8fbc87d..28cae56de9c88a7203c9338bb074bbc32dfd6fa9 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2006, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors kernel sequences models ui.gadgets
-math.geometry.rect fry ;
+math.rectangles fry ;
 IN: ui.gadgets.books
 
 TUPLE: book < gadget ;
@@ -16,12 +16,15 @@ M: book model-changed ( model book -- )
     dup current-page show-gadget
     relayout ;
 
-: new-book ( pages model class -- book )
-    new-gadget
-        swap >>model
-        swap add-gadgets ; inline
+: new-book ( model class -- book )
+    new
+        swap >>model ; inline
 
-: <book> ( pages model -- book ) book new-book ;
+: <book> ( pages model -- book )
+    book new-book swap add-gadgets ;
+
+: <empty-book> ( model -- book )
+    book new-book ;
 
 M: book pref-dim* ( book -- dim ) children>> pref-dims max-dim ;
 
index c0274e3b458d16703faae3a2ae92f4c04757a97f..1c0172041db874b60d907bd01052a43ffb298887 100644 (file)
@@ -5,11 +5,11 @@ HELP: border
 { $class-description "A border gadget contains a single child and centers it, with a fixed-width border. Borders are created by calling " { $link <border> } "." } ;
 
 HELP: <border>
-{ $values { "child" gadget } { "gap" integer } { "border" "a new " { $link border } } }
+{ $values { "child" gadget } { "gap" "a pair of integers" } { "border" "a new " { $link border } } }
 { $description "Creates a new border around the child with the specified horizontal and vertical gap." } ;
 
 ARTICLE: "ui.gadgets.borders" "Border gadgets"
-"Border gadgets add empty space around a child gadget."
+"The " { $vocab-link "ui.gadgets.borders" } " vocabulary implements border gadgets, which add empty space around a child gadget."
 { $subsection border }
 { $subsection <border> } ;
 
index 0151996c02dbeaebb0e110d91a290abcf15ed889..e9d7a5362928890ed2273abea559ed83ffc872bc 100644 (file)
@@ -1,16 +1,16 @@
 IN: ui.gadgets.borders.tests
-USING: tools.test accessors namespaces kernel
-ui.gadgets ui.gadgets.borders math.geometry.rect ;
+USING: tools.test accessors namespaces kernel ui.gadgets
+ui.gadgets.borders ui.gadgets.borders.private math.rectangles ;
 
-[ { 110 210 } ] [ <gadget> { 100 200 } >>dim 5 <border> pref-dim ] unit-test
+[ { 110 210 } ] [ <gadget> { 100 200 } >>dim { 5 5 } <border> pref-dim ] unit-test
 
 [ ] [ <gadget> { 100 200 } >>dim "g" set ] unit-test
 
-[ ] [ "g" get 0 <border> { 100 200 } >>dim "b" set ] unit-test
+[ ] [ "g" get { 0 0 } <border> { 100 200 } >>dim "b" set ] unit-test
 
 [ T{ rect f { 0 0 } { 100 200 } } ] [ "b" get border-child-rect ] unit-test
 
-[ ] [ "g" get 5 <border> { 210 210 } >>dim "b" set ] unit-test
+[ ] [ "g" get { 5 5 } <border> { 210 210 } >>dim "b" set ] unit-test
 
 [ T{ rect f { 55 5 } { 100 200 } } ] [ "b" get border-child-rect ] unit-test
 
index 1f66cca1787eac05ea102ebf34b46ea1218fd421..90de5a92877d323282b053dff9b5280947db2e1d 100644 (file)
@@ -1,27 +1,32 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays ui.gadgets kernel math
-namespaces vectors sequences math.vectors math.geometry.rect ;
+USING: accessors arrays ui.gadgets ui.baseline-alignment kernel math fry
+namespaces vectors sequences math.vectors math.rectangles ;
 IN: ui.gadgets.borders
 
 TUPLE: border < gadget
 { size initial: { 0 0 } }
 { fill initial: { 0 0 } }
-{ align initial: { 1/2 1/2 } } ;
+{ align initial: { 1/2 1/2 } }
+{ min-dim initial: { 0 0 } } ;
 
 : new-border ( child class -- border )
-    new-gadget swap add-gadget ; inline
+    new swap add-gadget ; inline
 
 : <border> ( child gap -- border )
     swap border new-border
-        swap dup 2array >>size ;
+        swap >>size ;
 
 : <filled-border> ( child gap -- border )
     <border> { 1 1 } >>fill ;
 
+: border-pref-dim ( border child-dim -- pref-dim )
+    '[ size>> 2 v*n _ v+ ] [ min-dim>> ] bi vmax ;
+
 M: border pref-dim*
-    [ size>> 2 v*n ] keep
-    gadget-child pref-dim v+ ;
+    dup gadget-child pref-dim border-pref-dim ;
+
+<PRIVATE
 
 : border-major-dim ( border -- dim )
     [ dim>> ] [ size>> 2 v*n ] bi v- ;
@@ -30,7 +35,7 @@ M: border pref-dim*
     gadget-child pref-dim ;
 
 : scale ( a b s -- c )
-    tuck { 1 1 } swap v- [ v* ] 2bi@ v+ ;
+    [ v* ] [ { 1 1 } swap v- v* ] bi-curry bi* v+ ;
 
 : border-dim ( border -- dim )
     [ border-major-dim ] [ border-minor-dim ] [ fill>> ] tri scale ;
@@ -42,11 +47,18 @@ M: border pref-dim*
 : border-child-rect ( border -- rect )
     dup border-dim [ border-loc ] keep <rect> ;
 
+: border-metric ( border quot -- n )
+    [ drop size>> second ] [ [ gadget-child ] dip call ] 2bi
+    dup [ + ] [ nip ] if ; inline
+
+PRIVATE>
+
+M: border baseline [ baseline ] border-metric ;
+
+M: border cap-height [ cap-height ] border-metric ;
+
 M: border layout*
-    dup border-child-rect swap gadget-child
-    over loc>> >>loc
-    swap dim>> >>dim
-    drop ;
+    [ border-child-rect ] [ gadget-child ] bi set-rect-bounds ;
 
 M: border focusable-child*
     gadget-child ;
index 086ef2ca81939dbf8434e6a7064e8d1c262fb471..6042a398865827bfa205731702bd89d044fbb12d 100644 (file)
@@ -1,13 +1,13 @@
 USING: help.markup help.syntax ui.gadgets ui.gadgets.labels
-ui.render kernel models classes ;
+ui.pens kernel models classes ;
 IN: ui.gadgets.buttons
 
 HELP: button
 { $class-description "A button is a " { $link gadget } " which responds to mouse clicks by invoking a quotation."
 $nl
-"A button's appearance can vary depending on the state of the mouse button if the " { $snippet "interior" } " or " { $snippet "boundary" } " slots are set to instances of " { $link button-paint } "."
+"A button's appearance can vary depending on the state of the mouse button if the " { $snippet "interior" } " or " { $snippet "boundary" } " slots are set to instances of " { $link button-pen } "."
 $nl
-"A button can be selected, which is distinct from being pressed. This state is held in the " { $snippet "selected?" } " slot, and is used by the " { $link <toggle-buttons> } " word to construct a row of buttons for choosing among several alternatives." } ;
+"A button can be selected, which is distinct from being pressed. This state is held in the " { $snippet "selected?" } " slot, and is used by " { $link checkbox } " instances to render themselves when they're checked." } ;
 
 HELP: <button>
 { $values { "label" gadget } { "quot" { $quotation "( button -- )" } } { "button" "a new " { $link button } } }
@@ -17,58 +17,46 @@ HELP: <roll-button>
 { $values { "label" "a label specifier" } { "quot" { $quotation "( button -- )" } } { "button" button } }
 { $description "Creates a new " { $link button } " which is displayed with a solid border when it is under the mouse, informing the user that the gadget is clickable." } ;
 
-HELP: <bevel-button>
+HELP: <border-button>
 { $values { "label" "a label specifier" } { "quot" { $quotation "( button -- )" } } { "button" button } }
-{ $description "Creates a new " { $link button } " with a shaded border which is always visible. The button appearance changes in response to mouse gestures using a " { $link button-paint } "." } ;
+{ $description "Creates a new " { $link button } " with a border which is always visible. The button appearance changes in response to mouse gestures using a " { $link button-pen } "." } ;
 
 HELP: <repeat-button>
 { $values { "label" object } { "quot" { $quotation "( button -- )" } } { "button" repeat-button } }
-{ $description "Creates a new " { $link button } " derived from a " { $link <bevel-button> } " which calls the quotation every 100 milliseconds as long as the mouse button is held down." } ;
+{ $description "Creates a new " { $link button } " derived from a " { $link <border-button> } " which calls the quotation every 100 milliseconds as long as the mouse button is held down." } ;
 
-HELP: button-paint
+HELP: button-pen
 { $class-description "A class implementing the " { $link draw-boundary } " and " { $link draw-interior } " gneeric words by delegating to an object in one of four slots which depend on the state of the button being drawn:"
     { $list
         { { $snippet "plain"    } " - the button is inactive" }
         { { $snippet "rollover" } " - the button is under the mouse" }
         { { $snippet "pressed"  } " - the button is under the mouse and a mouse button is held down" }
-        { { $snippet "selected" } " - the button is selected (see " { $link <toggle-buttons> }  }
+        { { $snippet "selected" } " - the button is selected (see " { $link checkbox }  }
+        { { $snippet "selected" } " - the button is selected and a mouse button is being held down (see " { $link checkbox }  }
     }
-"The " { $link <roll-button> } " and " { $link <bevel-button> } " words create " { $link button } " instances with specific " { $link button-paint } "." } ;
-
-HELP: <toggle-button>
-{ $values { "model" model } { "value" object } { "label" "a label specifier" } { "gadget" gadget } }
-{ $description
-    "Creates a " { $link <bevel-button> } " which sets the model's value to " { $snippet "value" } " when pressed. After being pressed, the button becomes selected until the value of the model changes again."
-}
-{ $notes "Typically a row of radio controls should be built together using " { $link <toggle-buttons> } "." } ;
-
-HELP: <toggle-buttons>
-{ $values { "model" model } { "assoc" "an association list mapping labels to objects" } { "gadget" gadget } }
-{ $description "Creates a row of labelled " { $link <toggle-button> } " gadgets which change the value of the model." } ;
+"The " { $link <roll-button> } " and " { $link <border-button> } " words create " { $link button } " instances with specific " { $link button-pen } "." } ;
 
 HELP: <command-button>
 { $values { "target" object } { "gesture" "a gesture" } { "command" "a command" } { "button" "a new " { $link button } } }
-{ $description "Creates a " { $link <bevel-button> } " which invokes the command on " { $snippet "target" } " when clicked." } ;
+{ $description "Creates a " { $link <border-button> } " which invokes the command on " { $snippet "target" } " when clicked." } ;
 
 HELP: <toolbar>
 { $values { "target" object } { "toolbar" gadget } }
 { $description "Creates a row of " { $link <command-button> } " gadgets invoking commands on " { $snippet "target" } ". The commands are taken from the " { $snippet "\"toolbar\"" } " command group of each class in " { $snippet "classes" } "." } ;
 
 ARTICLE: "ui.gadgets.buttons" "Button gadgets"
-"Buttons respond to mouse clicks by invoking a quotation."
+"The " { $vocab-link "ui.gadgets.buttons" } " vocabulary implements buttons. Buttons respond to mouse clicks by invoking a quotation."
 { $subsection button }
 "There are many ways to create a new button:"
 { $subsection <button> }
 { $subsection <roll-button> }
-{ $subsection <bevel-button> }
+{ $subsection <border-button> }
 { $subsection <repeat-button> }
 "Gadgets for invoking commands:"
 { $subsection <command-button> }
 { $subsection <toolbar> }
-"A radio box is a row of buttons for choosing amongst several distinct possibilities:"
-{ $subsection <toggle-buttons> }
 "Button appearance can be customized:"
-{ $subsection button-paint }
+{ $subsection button-pen }
 "Button constructors take " { $emphasis "label specifiers" } " as input. A label specifier is either a string, an array of strings, a gadget or " { $link f } "."
 { $see-also <command-button> "ui-commands" } ;
 
index bdd9ebaf13c630e6476ea3d6dcdec5d9b40788c3..6d1706ee748fdc4552bf4455ba5f15a182ef1404 100644 (file)
@@ -17,7 +17,7 @@ TUPLE: foo-gadget ;
 T{ foo-gadget } <toolbar> "t" set
 
 [ 2 ] [ "t" get children>> length ] unit-test
-[ "Foo A" ] [ "t" get gadget-child gadget-child label-string ] unit-test
+[ "Foo A" ] [ "t" get gadget-child gadget-child string>> ] unit-test
 
 [ ] [
     2 <model> {
@@ -30,8 +30,6 @@ T{ foo-gadget } <toolbar> "t" set
 
 \ <radio-buttons> must-infer
 
-\ <toggle-buttons> must-infer
-
 \ <checkbox> must-infer
 
 [ 0 ] [
index 3deb280c83992bcc515b1d9a69f8d98ce4ff5a0e..ebac290f4bdfc4fc4152d29bbdc912d9bfe1ded7 100644 (file)
@@ -1,16 +1,21 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays kernel math models namespaces sequences
-strings quotations assocs combinators classes colors
+strings quotations assocs combinators classes colors colors.constants
 classes.tuple opengl opengl.gl math.vectors ui.commands ui.gadgets
-ui.gadgets.borders ui.gadgets.labels ui.gadgets.theme
-ui.gadgets.tracks ui.gadgets.packs ui.gadgets.worlds ui.gestures
-ui.render math.geometry.rect locals alien.c-types
-specialized-arrays.float fry combinators.smart ;
+ui.gadgets.borders ui.gadgets.labels ui.gadgets.tracks
+ui.gadgets.packs ui.gadgets.worlds ui.gestures ui.pens ui.pens.solid
+ui.pens.image ui.pens.tile math.rectangles locals fry
+combinators.smart call ;
 IN: ui.gadgets.buttons
 
 TUPLE: button < border pressed? selected? quot ;
 
+<PRIVATE
+
+: find-button ( gadget -- button )
+    [ button? ] find-parent ;
+
 : buttons-down? ( -- ? )
     hand-buttons get-global empty? not ;
 
@@ -20,23 +25,25 @@ TUPLE: button < border pressed? selected? quot ;
 : mouse-clicked? ( gadget -- ? )
     hand-clicked get-global child? ;
 
+PRIVATE>
+
 : button-update ( button -- )
-    dup mouse-clicked?
-    over button-rollover? and
+    dup
+    [ mouse-clicked? ] [ button-rollover? ] bi and
     buttons-down? and
     >>pressed?
     relayout-1 ;
 
-: if-clicked ( button quot -- )
-    [ dup button-update dup button-rollover? ] dip [ drop ] if ;
-
-: button-clicked ( button -- ) dup quot>> if-clicked ;
+: button-clicked ( button -- )
+    dup button-update
+    dup button-rollover?
+    [ dup quot>> call( button -- ) ] [ drop ] if ;
 
 button H{
     { T{ button-up } [ button-clicked ] }
     { T{ button-down } [ button-update ] }
-    { T{ mouse-leave } [ button-update ] }
-    { T{ mouse-enter } [ button-update ] }
+    { mouse-leave [ button-update ] }
+    { mouse-enter [ button-update ] }
 } set-gestures
 
 : new-button ( label quot class -- button )
@@ -45,120 +52,137 @@ button H{
 : <button> ( label quot -- button )
     button new-button ;
 
-TUPLE: button-paint plain rollover pressed selected ;
-
-C: <button-paint> button-paint
+TUPLE: button-pen
+plain rollover
+pressed selected pressed-selected ;
 
-: find-button ( gadget -- button )
-    [ button? ] find-parent ;
+C: <button-pen> button-pen
 
-: button-paint ( button paint -- button paint )
+: button-pen ( button pen -- button pen )
     over find-button {
+        { [ dup [ pressed?>> ] [ selected?>> ] bi and ] [ drop pressed-selected>> ] }
         { [ dup pressed?>> ] [ drop pressed>> ] }
         { [ dup selected?>> ] [ drop selected>> ] }
         { [ dup button-rollover? ] [ drop rollover>> ] }
         [ drop plain>> ]
     } cond ;
 
-M: button-paint draw-interior
-    button-paint dup [ draw-interior ] [ 2drop ] if ;
+M: button-pen draw-interior
+    button-pen dup [ draw-interior ] [ 2drop ] if ;
 
-M: button-paint draw-boundary
-    button-paint dup [ draw-boundary ] [ 2drop ] if ;
+M: button-pen draw-boundary
+    button-pen dup [ draw-boundary ] [ 2drop ] if ;
+
+M: button-pen pen-pref-dim
+    [
+        {
+            [ plain>> pen-pref-dim ]
+            [ rollover>> pen-pref-dim ]
+            [ pressed>> pen-pref-dim ]
+            [ selected>> pen-pref-dim ]
+        } 2cleave
+    ] [ vmax ] reduce-outputs ;
+
+M: button-pen pen-background
+    button-pen pen-background ;
+
+M: button-pen pen-foreground
+    button-pen pen-foreground ;
+
+<PRIVATE
 
 : align-left ( button -- button )
     { 0 1/2 } >>align ; inline
 
 : roll-button-theme ( button -- button )
-    f black <solid> dup f <button-paint> >>boundary
-    f f pressed-gradient f <button-paint> >>interior
+    f COLOR: black <solid> dup f f <button-pen> >>boundary
+    f f COLOR: dark-gray <solid> f f <button-pen> >>interior
     align-left ; inline
 
+PRIVATE>
+
 : <roll-button> ( label quot -- button )
     <button> roll-button-theme ;
 
-: <bevel-button-paint> ( -- paint )
-    plain-gradient
-    rollover-gradient
-    pressed-gradient
-    selected-gradient
-    <button-paint> ;
+<PRIVATE
 
-: bevel-button-theme ( gadget -- gadget )
-    <bevel-button-paint> >>interior
-    { 5 5 } >>size
-    faint-boundary ; inline
+: <border-button-state-pen> ( prefix background foreground -- pen )
+    [
+        "-left" "-middle" "-right"
+        [ append theme-image ] tri-curry@ tri
+    ] 2dip <tile-pen> ;
+
+CONSTANT: button-background
+    T{ rgba
+         f
+         0.8901960784313725
+         0.8862745098039215
+         0.8588235294117647
+         1.0
+    }
+
+CONSTANT: button-clicked-background
+    T{ rgba
+         f
+         0.2156862745098039
+         0.2431372549019608
+         0.2823529411764706
+         1.0
+    }
+    
+: <border-button-pen> ( -- pen )
+    "button" button-background COLOR: black <border-button-state-pen> dup
+    "button-clicked" button-clicked-background COLOR: white <border-button-state-pen> dup dup
+    <button-pen> ;
+
+: border-button-theme ( gadget -- gadget )
+    horizontal >>orientation
+    <border-button-pen> >>interior
+    dup dup interior>> pen-pref-dim >>min-dim
+    { 10 0 } >>size ; inline
+
+PRIVATE>
 
-: <bevel-button> ( label quot -- button )
-    <button> bevel-button-theme ;
+: <border-button> ( label quot -- button )
+    <button> border-button-theme ;
 
 TUPLE: repeat-button < button ;
 
 repeat-button H{
+    { T{ button-down } [ button-clicked ] }
     { T{ drag } [ button-clicked ] }
+    { T{ button-up } [ button-update ] }
 } set-gestures
 
 : <repeat-button> ( label quot -- button )
     #! Button that calls the quotation every 100ms as long as
     #! the mouse is held down.
-    repeat-button new-button bevel-button-theme ;
-
-TUPLE: checkmark-paint < caching-pen color last-vertices ;
-
-: <checkmark-paint> ( color -- paint )
-    checkmark-paint new swap >>color ;
+    repeat-button new-button border-button-theme ;
 
 <PRIVATE
 
-: checkmark-points ( dim -- points )
-    [
-        {
-            [ { 0 0 } v* { 0.5 0.5 } v+ ]
-            [ { 1 1 } v* { 0.5 0.5 } v+ ]
-            [ { 1 0 } v* { -0.3 0.5 } v+ ]
-            [ { 0 1 } v* { -0.3 0.5 } v+ ]
-        } cleave
-    ] output>array ;
-
-: checkmark-vertices ( dim -- vertices )
-    checkmark-points concat >float-array ;
-
-PRIVATE>
-
-M: checkmark-paint recompute-pen
-    swap dim>> checkmark-vertices >>last-vertices drop ;
-
-M: checkmark-paint draw-interior
-    [ compute-pen ]
-    [ color>> gl-color ]
-    [ last-vertices>> gl-vertex-pointer ] tri
-    GL_LINES 0 4 glDrawArrays ;
-
-: checkmark-theme ( gadget -- gadget )
-    f
-    f
-    black <solid>
-    black <checkmark-paint>
-    <button-paint> >>interior
-    black <solid> >>boundary ;
+: <checkmark-pen> ( -- pen )
+    "checkbox" theme-image <image-pen>
+    "checkbox" theme-image <image-pen>
+    "checkbox-clicked" theme-image <image-pen>
+    "checkbox-set" theme-image <image-pen>
+    "checkbox-set-clicked" theme-image <image-pen>
+    <button-pen> ;
 
 : <checkmark> ( -- gadget )
     <gadget>
-    checkmark-theme
-    { 14 14 } >>dim ;
+    <checkmark-pen> >>interior
+    dup dup interior>> pen-pref-dim >>dim ;
 
 : toggle-model ( model -- )
     [ not ] change-model ;
 
-: checkbox-theme ( gadget -- gadget )
-    f >>interior
-    { 5 5 } >>gap
-    1/2 >>align ; inline
+PRIVATE>
 
 TUPLE: checkbox < button ;
 
 : <checkbox> ( model label -- checkbox )
-    <checkmark> label-on-right checkbox-theme
+    <checkmark> label-on-right
     [ model>> toggle-model ]
     checkbox new-button
         swap >>model
@@ -167,47 +191,20 @@ TUPLE: checkbox < button ;
 M: checkbox model-changed
     swap value>> >>selected? relayout-1 ;
 
-TUPLE: radio-paint < caching-pen color interior-vertices boundary-vertices ;
-
-: <radio-paint> ( color -- paint ) radio-paint new swap >>color ;
-
 <PRIVATE
 
-CONSTANT: circle-steps 8
-
-PRIVATE>
-
-M: radio-paint recompute-pen
-    swap dim>>
-    [ { 4 4 } swap { 9 9 } v- circle-steps fill-circle-vertices >>interior-vertices ]
-    [ { 1 1 } swap { 3 3 } v- circle-steps circle-vertices >>boundary-vertices ] bi
-    drop ;
-
-<PRIVATE
-
-: (radio-paint) ( gadget paint -- )
-    [ compute-pen ] [ color>> gl-color ] bi ;
-
-PRIVATE>
-
-M: radio-paint draw-interior
-    [ (radio-paint) ] [ interior-vertices>> gl-vertex-pointer ] bi
-    GL_POLYGON 0 circle-steps glDrawArrays ;
-
-M: radio-paint draw-boundary
-    [ (radio-paint) ] [ boundary-vertices>> gl-vertex-pointer ] bi
-    GL_LINE_STRIP 0 circle-steps 1+ glDrawArrays ;
-
-:: radio-knob-theme ( gadget -- gadget )
-    [let | radio-paint [ black <radio-paint> ] |
-        gadget
-        f f radio-paint radio-paint <button-paint> >>interior
-        radio-paint >>boundary
-        { 16 16 } >>dim
-    ] ;
+: <radio-pen> ( -- pen )
+    "radio" theme-image <image-pen>
+    "radio" theme-image <image-pen>
+    "radio-clicked" theme-image <image-pen>
+    "radio-set" theme-image <image-pen>
+    "radio-set-clicked" theme-image <image-pen>
+    <button-pen> ;
 
 : <radio-knob> ( -- gadget )
-    <gadget> radio-knob-theme ;
+    <gadget>
+    <radio-pen> >>interior
+    dup dup interior>> pen-pref-dim >>dim ;
 
 TUPLE: radio-control < button value ;
 
@@ -219,43 +216,36 @@ TUPLE: radio-control < button value ;
         align-left ; inline
 
 M: radio-control model-changed
-    swap value>>
-    over value>> = >>selected?
-    relayout-1 ;
+    2dup [ value>> ] bi@ = >>selected? relayout-1 drop ;
 
-: <radio-controls> ( assoc model parent quot: ( value model label -- ) -- parent )
-    '[ _ swap _ call add-gadget ] assoc-each ; inline
+:: <radio-controls> ( parent model assoc quot: ( value model label -- gadget ) -- parent )
+    assoc model [ parent swap quot call add-gadget ] assoc-each ; inline
 
-: radio-button-theme ( gadget -- gadget )
-    { 5 5 } >>gap
-    1/2 >>align ; inline
+PRIVATE>
 
 : <radio-button> ( value model label -- gadget )
-    <radio-knob> label-on-right radio-button-theme <radio-control> ;
+    <radio-knob> label-on-right <radio-control> ;
 
 : <radio-buttons> ( model assoc -- gadget )
     <filled-pile>
-        spin [ <radio-button> ] <radio-controls>
+        [ <radio-button> ] <radio-controls>
         { 5 5 } >>gap ;
 
-: <toggle-button> ( value model label -- gadget )
-    <radio-control> bevel-button-theme ;
-
-: <toggle-buttons> ( model assoc -- gadget )
-    <shelf>
-        spin [ <toggle-button> ] <radio-controls> ;
-
 : command-button-quot ( target command -- quot )
-    '[ _ _ invoke-command drop ] ;
+    '[ _ _ invoke-command ] ;
 
 : <command-button> ( target gesture command -- button )
-    [ command-string swap ] keep command-button-quot <bevel-button> ;
+    [ command-string swap ] keep command-button-quot
+    '[ drop @ ] <border-button> ;
 
 : <toolbar> ( target -- toolbar )
     <shelf>
+        1 >>fill
+        { 5 5 } >>gap
         swap
-        "toolbar" over class command-map commands>> swap
-        '[ [ _ ] 2dip <command-button> add-gadget ] assoc-each ;
+        [ [ "toolbar" ] dip class command-map commands>> ]
+        [ '[ [ _ ] 2dip <command-button> add-gadget ] ]
+        bi assoc-each ;
 
 : add-toolbar ( track -- track )
-    dup <toolbar> f track-add ;
+    dup <toolbar> { 3 3 } <border> align-left f track-add ;
index 0028b9b165cd9676016e951fa577bdf9c13e183d..1c36f4f9fd57b425708c09f57a8ecc206a073919 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2007 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: ui.backend ui.gadgets ui.gadgets.theme
+USING: ui.backend ui.gadgets
 ui.gadgets.worlds ui.render opengl opengl.gl kernel namespaces
 classes.tuple colors accessors ;
 IN: ui.gadgets.canvas
@@ -8,7 +8,7 @@ IN: ui.gadgets.canvas
 TUPLE: canvas < gadget dlist ;
 
 : new-canvas ( class -- canvas )
-    new-gadget black solid-interior ; inline
+    new black <solid> >>interior ; inline
 
 : delete-canvas-dlist ( canvas -- )
     [ find-gl-context ]
diff --git a/basis/ui/gadgets/debug/authors.txt b/basis/ui/gadgets/debug/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/gadgets/debug/debug-tests.factor b/basis/ui/gadgets/debug/debug-tests.factor
new file mode 100644 (file)
index 0000000..064f7ab
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.gadgets.debug ;
+IN: ui.gadgets.debug.tests
diff --git a/basis/ui/gadgets/debug/debug.factor b/basis/ui/gadgets/debug/debug.factor
new file mode 100644 (file)
index 0000000..076c772
--- /dev/null
@@ -0,0 +1,51 @@
+! Copyright (C) 2008, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays colors.constants combinators kernel
+opengl sequences ui ui.baseline-alignment ui.gadgets
+ui.gadgets.buttons ui.gadgets.labels ui.pens ui.render ui.text ;
+IN: ui.gadgets.debug
+
+TUPLE: baseline-gadget < gadget baseline cap-height ;
+
+M: baseline-gadget baseline baseline>> ;
+
+M: baseline-gadget cap-height cap-height>> ;
+
+: <baseline-gadget> ( baseline cap-height dim -- gadget )
+    baseline-gadget new
+        swap >>dim
+        swap >>cap-height
+        swap >>baseline ;
+
+! An intentionally broken gadget -- used to test UI error handling,
+! make sure that one bad gadget doesn't bring the whole system down
+
+: <bad-button> ( -- button )
+    "Click me if you dare"
+    [ "Haha" throw ]
+    <border-button> ;
+
+TUPLE: bad-gadget < gadget ;
+
+M: bad-gadget draw-gadget* "Lulz" throw ;
+
+M: bad-gadget pref-dim* drop { 100 100 } ;
+
+: <bad-gadget> ( -- gadget ) bad-gadget new ;
+
+: bad-gadget-test ( -- )
+    <bad-button> "Test 1" open-window
+    <bad-gadget> "Test 2" open-window ;
+
+SINGLETON: metrics-paint
+
+M: metrics-paint draw-boundary
+    drop
+    COLOR: red gl-color
+    [ dim>> ] [ >label< line-metrics ] bi
+    [ [ first ] [ ascent>> ] bi* [ nip 0 swap 2array ] [ 2array ] 2bi gl-line ]
+    [ drop gl-rect ]
+    2bi ;
+
+: <metrics-gadget> ( text font -- gadget )
+    [ <label> ] dip >>font metrics-paint >>boundary ;
\ No newline at end of file
index d749b8905c02ede603fb5eb5f6c5d0ddd47e6614..244e36d640753103be747f9491dfe1443708a288 100644 (file)
@@ -1,5 +1,6 @@
 USING: documents help.markup help.syntax ui.gadgets
-ui.gadgets.scrollers models strings ui.commands ;
+ui.gadgets.scrollers models strings ui.commands
+ui.text colors fonts ;
 IN: ui.gadgets.editors
 
 HELP: editor
@@ -7,12 +8,12 @@ HELP: editor
 $nl
 "Editors have the following slots:"
 { $list
-    { { $snippet "font" } " - a font specifier." }
-    { { $snippet "color" } " - text color specifier." }
-    { { $snippet "caret-color" } " - caret color specifier." }
-    { { $snippet "selection-color" } " - selection background color specifier." }
-    { { $snippet "caret" } " - a model storing a line/column pair." }
-    { { $snippet "mark" } " - a model storing a line/column pair. If there is no selection, the mark is equal to the caret, otherwise the mark is located at the opposite end of the selection from the caret." }
+    { { $snippet "font" } " - a " { $link font } "." }
+    { { $snippet "color" } " - a " { $link color } "." }
+    { { $snippet "caret-color" } " - a " { $link color } "." }
+    { { $snippet "selection-color" } " - a " { $link color } "." }
+    { { $snippet "caret" } " - a " { $link model } " storing a line/column pair." }
+    { { $snippet "mark" } " - a " { $link model } " storing a line/column pair. If there is no selection, the mark is equal to the caret, otherwise the mark is located at the opposite end of the selection from the caret." }
     { { $snippet "focused?" } " - a boolean." }
 } } ;
 
@@ -20,13 +21,13 @@ HELP: <editor>
 { $values { "editor" "a new " { $link editor } } }
 { $description "Creates a new " { $link editor } " with an empty document." } ;
 
-{ editor-caret* editor-mark* } related-words
+{ editor-caret editor-mark } related-words
 
-HELP: editor-caret*
+HELP: editor-caret
 { $values { "editor" editor } { "loc" "a pair of integers" } }
 { $description "Outputs the current caret location as a line/column number pair." } ;
 
-HELP: editor-mark*
+HELP: editor-mark
 { $values { "editor" editor } { "loc" "a pair of integers" } }
 { $description "Outputs the current mark location as a line/column number pair." } ;
 
@@ -66,8 +67,8 @@ HELP: set-editor-string
 
 ARTICLE: "gadgets-editors-selection" "The caret and mark"
 "If there is no selection, the caret and the mark are at the same location; otherwise the mark delimits the end-point of the selection opposite the caret."
-{ $subsection editor-caret* }
-{ $subsection editor-mark* }
+{ $subsection editor-caret }
+{ $subsection editor-mark }
 { $subsection change-caret }
 { $subsection change-caret&mark }
 { $subsection mark>caret }
@@ -80,18 +81,32 @@ ARTICLE: "gadgets-editors-selection" "The caret and mark"
 { $subsection scroll>caret }
 "Use " { $link user-input* } " to change selected text." ;
 
-ARTICLE: "gadgets-editors" "Editor gadgets"
-"An editor edits a multi-line passage of text."
-{ $command-map editor "general" }
+ARTICLE: "gadgets-editors-contents" "Getting and setting editor contents"
+{ $subsection editor-string }
+{ $subsection set-editor-string }
+{ $subsection clear-editor } ;
+
+ARTICLE: "gadgets-editors-commands" "Editor gadget commands"
+{ $command-map editor "editing" }
 { $command-map editor "caret-motion" }
 { $command-map editor "selection" }
-{ $heading "Editor words" }
+{ $command-map editor "clipboard" }
+{ $command-map multiline-editor "multiline" } ;
+
+ARTICLE: "ui.gadgets.editors" "Editor gadgets"
+"The " { $vocab-link "ui.gadgets.editors" } " vocabulary implements editor gadgets. An editor edits a passage of text. Editors display a " { $link document } ". Editors are built from and inherit all features of " { $link "ui.gadgets.line-support" } "."
+{ $subsection "gadgets-editors-commands" }
+"Editors:"
 { $subsection editor }
 { $subsection <editor> }
-{ $subsection editor-string }
-{ $subsection set-editor-string }
+{ $subsection "gadgets-editors-contents" }
 { $subsection "gadgets-editors-selection" }
-{ $subsection "documents" }
-{ $subsection "document-locs-elts" } ;
-
-ABOUT: "gadgets-editors"
+"Multiline editors:"
+{ $subsection <multiline-editor> }
+"Fields:"
+{ $subsection <model-field> }
+{ $subsection <action-field> }
+"Editors edit " { $emphasis "documents" } ":"
+{ $subsection "documents" } ;
+
+ABOUT: "ui.gadgets.editors"
index 274d62ea46564a44a1eb647c146ee4ad3cf580a6..f8dc5b91c9f12802da50936c798f0bdad90f9f8e 100644 (file)
@@ -1,14 +1,15 @@
 USING: accessors ui.gadgets.editors tools.test kernel io
 io.streams.plain definitions namespaces ui.gadgets
 ui.gadgets.grids prettyprint documents ui.gestures tools.test.ui
-models ;
+models documents.elements ui.gadgets.scrollers ui.gadgets.line-support
+sequences ;
 IN: ui.gadgets.editors.tests
 
 [ "foo bar" ] [
     <editor> "editor" set
     "editor" get [
         "foo bar" "editor" get set-editor-string
-        "editor" get T{ one-line-elt } select-elt
+        "editor" get one-line-elt select-elt
         "editor" get gadget-selection
     ] with-grafted-gadget
 ] unit-test
@@ -17,7 +18,7 @@ IN: ui.gadgets.editors.tests
     <editor> "editor" set
     "editor" get [
         "foo bar\nbaz quux" "editor" get set-editor-string
-        "editor" get T{ one-line-elt } select-elt
+        "editor" get one-line-elt select-elt
         "editor" get gadget-selection
     ] with-grafted-gadget
 ] unit-test
@@ -43,8 +44,25 @@ IN: ui.gadgets.editors.tests
 
 \ <editor> must-infer
 
-"hello" <model> <field> "field" set
+"hello" <model> <model-field> "field" set
 
 "field" get [
     [ "hello" ] [ "field" get field-model>> value>> ] unit-test
 ] with-grafted-gadget
+
+[ "Hello world." ] [ "Hello    \n    world." join-lines ] unit-test
+[ "  Hello world.  " ] [ "  Hello    \n    world.  " join-lines ] unit-test
+[ "  Hello world. Goodbye." ] [ "  Hello    \n    world.  \n  Goodbye." join-lines ] unit-test
+
+[ ] [ <editor> com-join-lines ] unit-test
+[ ] [ <editor> "A" over set-editor-string com-join-lines ] unit-test
+[ "A B" ] [ <editor> "A\nB" over set-editor-string [ com-join-lines ] [ editor-string ] bi ] unit-test
+
+[ 2 ] [ <editor> 20 >>min-rows 20 >>min-cols pref-viewport-dim length ] unit-test
+
+[ 20 ] [
+    <editor> 20 >>min-rows 20 >>min-cols
+    dup pref-viewport-dim >>dim
+    visible-lines
+] unit-test
+
index dc2cedfef85501bc9a5fe0fb1cefd25a98b8a0ed..9adb33a164dcb5d3e9f926f22149ff572b33408a 100755 (executable)
@@ -1,17 +1,18 @@
-! Copyright (C) 2006, 2008 Slava Pestov
+! Copyright (C) 2006, 2009 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays documents kernel math models
-namespaces locals fry make opengl opengl.gl sequences strings
-io.styles math.vectors sorting colors combinators assocs
-math.order fry calendar alarms ui.clipboards ui.commands
-ui.gadgets ui.gadgets.borders ui.gadgets.buttons
-ui.gadgets.labels ui.gadgets.scrollers ui.gadgets.theme
-ui.gadgets.menus ui.gadgets.wrappers ui.render ui.gestures
-math.geometry.rect ;
+USING: accessors arrays documents documents.elements kernel math
+math.ranges models models.arrow namespaces locals fry make opengl
+opengl.gl sequences strings math.vectors math.functions sorting colors
+colors.constants combinators assocs math.order fry calendar alarms
+continuations ui.clipboards ui.commands ui.gadgets ui.gadgets.borders
+ui.gadgets.buttons ui.gadgets.labels ui.gadgets.scrollers
+ui.gadgets.menus ui.gadgets.wrappers ui.render ui.pens.solid
+ui.gadgets.line-support ui.text ui.gestures ui.baseline-alignment
+math.rectangles splitting unicode.categories fonts grouping ;
 IN: ui.gadgets.editors
 
-TUPLE: editor < gadget
-font color caret-color selection-color
+TUPLE: editor < line-gadget
+caret-color
 caret mark
 focused? blink blink-alarm ;
 
@@ -22,13 +23,11 @@ focused? blink blink-alarm ;
     <loc> >>mark ; inline
 
 : editor-theme ( editor -- editor )
-    black >>color
-    red >>caret-color
-    selection-color >>selection-color
+    COLOR: red >>caret-color
     monospace-font >>font ; inline
 
 : new-editor ( class -- editor )
-    new-gadget
+    new-line-gadget
         <document> >>model
         init-editor-locs
         editor-theme ; inline
@@ -81,34 +80,26 @@ M: editor ungraft*
     dup caret>> deactivate-editor-model
     dup mark>> deactivate-editor-model ;
 
-: editor-caret* ( editor -- loc ) caret>> value>> ;
+: editor-caret ( editor -- loc ) caret>> value>> ;
 
-: editor-mark* ( editor -- loc ) mark>> value>> ;
+: editor-mark ( editor -- loc ) mark>> value>> ;
 
 : set-caret ( loc editor -- )
     [ model>> validate-loc ] keep
     caret>> set-model ;
 
 : change-caret ( editor quot -- )
-    [ [ [ editor-caret* ] [ model>> ] bi ] dip call ] [ drop ] 2bi
+    [ [ [ editor-caret ] [ model>> ] bi ] dip call ] [ drop ] 2bi
     set-caret ; inline
 
 : mark>caret ( editor -- )
-    [ editor-caret* ] [ mark>> ] bi set-model ;
+    [ editor-caret ] [ mark>> ] bi set-model ;
 
 : change-caret&mark ( editor quot -- )
     [ change-caret ] [ drop mark>caret ] 2bi ; inline
 
 : editor-line ( n editor -- str ) control-value nth ;
 
-: editor-font* ( editor -- font ) font>> open-font ;
-
-: line-height ( editor -- n )
-    editor-font* "" string-height ;
-
-: y>line ( y editor -- line# )
-    line-height /i ;
-
 :: point>loc ( point editor -- loc )
     point second editor y>line {
         { [ dup 0 < ] [ drop { 0 0 } ] }
@@ -116,7 +107,7 @@ M: editor ungraft*
         [| n |
             n
             point first
-            editor editor-font*
+            editor font>>
             n editor editor-line
             x>offset 2array
         ]
@@ -129,26 +120,19 @@ M: editor ungraft*
     [ clicked-loc ] dip set-model ;
 
 : focus-editor ( editor -- )
-    dup start-blinking
-    t >>focused?
-    relayout-1 ;
+    [ start-blinking ] [ t >>focused? relayout-1 ] bi ;
 
 : unfocus-editor ( editor -- )
-    dup stop-blinking
-    f >>focused?
-    relayout-1 ;
-
-: offset>x ( col# line# editor -- x )
-    [ editor-line ] keep editor-font* spin head-slice string-width ;
+    [ stop-blinking ] [ f >>focused? relayout-1 ] bi ;
 
-: loc>x ( loc editor -- x ) [ first2 swap ] dip offset>x ;
+: loc>x ( loc editor -- x )
+    [ first2 swap ] dip [ editor-line ] [ font>> ] bi swap offset>x round ;
 
-: line>y ( lines# editor -- y )
-    line-height * ;
+: loc>point ( loc editor -- loc )
+    [ loc>x ] [ [ first ] dip line>y ceiling ] 2bi 2array ;
 
 : caret-loc ( editor -- loc )
-    [ editor-caret* ] keep
-    [ loc>x ] [ [ first ] dip line>y ] 2bi 2array ;
+    [ editor-caret ] keep loc>point ;
 
 : caret-dim ( editor -- dim )
     line-height 0 swap 2array ;
@@ -160,93 +144,69 @@ M: editor ungraft*
         ] keep scroll>rect
     ] [ drop ] if ;
 
-: draw-caret ( -- )
-    editor get [ focused?>> ] [ blink>> ] bi and [
-        editor get
+: draw-caret? ( editor -- ? )
+    [ focused?>> ] [ blink>> ] bi and ;
+
+: draw-caret ( editor -- )
+    dup draw-caret? [
         [ caret-color>> gl-color ]
         [
-            dup caret-loc origin get v+
-            swap caret-dim over v+
-            gl-line
+            [ caret-loc ] [ caret-dim ] bi
+            over v+ gl-line
         ] bi
-    ] when ;
-
-: line-translation ( n -- loc )
-    editor get line-height * 0.0 swap 2array ;
-
-: translate-lines ( n -- )
-    line-translation gl-translate ;
+    ] [ drop ] if ;
 
-: draw-line ( editor str -- )
-    [ font>> ] dip { 0 0 } draw-string ;
+: selection-start/end ( editor -- start end )
+    [ editor-mark ] [ editor-caret ] bi sort-pair ;
 
-: first-visible-line ( editor -- n )
-    [
-        [ clip get rect-loc second origin get second - ] dip
-        y>line
-    ] keep model>> validate-line ;
+SYMBOL: selected-lines
 
-: last-visible-line ( editor -- n )
-    [
-        [ clip get rect-extent nip second origin get second - ] dip
-        y>line
-    ] keep model>> validate-line 1+ ;
+TUPLE: selected-line start end first? last? ;
 
-: with-editor ( editor quot -- )
-    [
-        swap
-        dup first-visible-line \ first-visible-line set
-        dup last-visible-line \ last-visible-line set
-        dup model>> document set
-        editor set
-        call
-    ] with-scope ; inline
-
-: visible-lines ( editor -- seq )
-    [ \ first-visible-line get \ last-visible-line get ] dip
-    control-value <slice> ;
-
-: with-editor-translation ( n quot -- )
-    [ line-translation origin get v+ ] dip with-translation ;
-    inline
-
-: draw-lines ( -- )
-    \ first-visible-line get [
-        editor get dup color>> gl-color
-        dup visible-lines
-        [ draw-line 1 translate-lines ] with each
-    ] with-editor-translation ;
+: compute-selection ( editor -- assoc )
+    dup gadget-selection? [
+        [ selection-start/end [ [ first ] bi@ [a,b] ] 2keep ] keep model>>
+        '[ [ _ _ ] keep _ start/end-on-line 2array ] H{ } map>assoc
+    ] [ drop f ] if ;
+
+:: draw-selection ( line pair editor -- )
+    pair [ editor font>> line offset>x ] map :> pair
+    pair first 0 2array [
+        editor selection-color>> gl-color
+        pair second pair first - round 1 max
+        editor line-height 2array gl-fill-rect
+    ] with-translation ;
+
+: draw-unselected-line ( line editor -- )
+    font>> swap draw-text ;
+
+: draw-selected-line ( line pair editor -- )
+    over all-equal? [
+        [ nip draw-unselected-line ] [ draw-selection ] 3bi
+    ] [
+        [ draw-selection ]
+        [
+            [ [ first2 ] [ selection-color>> ] bi* <selection> ] keep
+            draw-unselected-line
+        ] 3bi
+    ] if ;
 
-: selection-start/end ( editor -- start end )
-    [ editor-mark* ] [ editor-caret* ] bi sort-pair ;
-
-: (draw-selection) ( x1 x2 -- )
-    over -
-    dup 0 = [ 2 + ] when
-    [ 0.0 2array ] [ editor get line-height 2array ] bi*
-    swap [ gl-fill-rect ] with-translation ;
-
-: draw-selected-line ( start end n -- )
-    [ start/end-on-line ] keep
-    tuck [ editor get offset>x ] 2bi@
-    (draw-selection) ;
-
-: draw-selection ( -- )
-    editor get selection-color>> gl-color
-    editor get selection-start/end
-    over first [
-        2dup '[
-            [ _ _ ] dip
-            draw-selected-line
-            1 translate-lines
-        ] each-line
-    ] with-editor-translation ;
+M: editor draw-line ( line index editor -- )
+    [ selected-lines get at ] dip over
+    [ draw-selected-line ] [ nip draw-unselected-line ] if ;
 
 M: editor draw-gadget*
-    [ draw-selection draw-lines draw-caret ] with-editor ;
+    dup compute-selection selected-lines [
+        [ draw-lines ] [ draw-caret ] bi
+    ] with-variable ;
 
 M: editor pref-dim*
-    dup editor-font* swap control-value text-dim ;
+    ! Add some space for the caret.
+    [ font>> ] [ control-value ] bi text-dim { 1 0 } v+ ;
+
+M: editor baseline font>> font-metrics ascent>> ;
+
+M: editor cap-height font>> font-metrics cap-height>> ;
 
 : contents-changed ( model editor -- )
     swap
@@ -291,12 +251,12 @@ M: editor gadget-text* editor-string % ;
 
 : mouse-elt ( -- element )
     hand-click# get {
-        { 1 T{ one-char-elt } }
-        { 2 T{ one-word-elt } }
-    } at T{ one-line-elt } or ;
+        { 1 one-char-elt }
+        { 2 one-word-elt }
+    } at one-line-elt or ;
 
 : drag-direction? ( loc editor -- ? )
-    editor-mark* before? ;
+    editor-mark before? ;
 
 : drag-selection-caret ( loc editor element -- loc )
     [
@@ -306,7 +266,7 @@ M: editor gadget-text* editor-string % ;
 : drag-selection-mark ( loc editor element -- loc )
     [
         [ drag-direction? not ] keep
-        [ editor-mark* ] [ model>> ] bi
+        [ editor-mark ] [ model>> ] bi
     ] dip prev/next-elt ? ;
 
 : drag-caret&mark ( editor -- caret mark )
@@ -320,13 +280,13 @@ M: editor gadget-text* editor-string % ;
     swap caret>> set-model ;
 
 : editor-cut ( editor clipboard -- )
-    dupd gadget-copy remove-selection ;
+    [ gadget-copy ] [ drop remove-selection ] 2bi ;
 
 : delete/backspace ( editor quot -- )
     over gadget-selection? [
         drop remove-selection
     ] [
-        [ [ [ editor-caret* ] [ model>> ] bi ] dip call ]
+        [ [ [ editor-caret ] [ model>> ] bi ] dip call ]
         [ drop model>> ]
         2bi remove-doc-range
     ] if ; inline
@@ -341,7 +301,7 @@ M: editor gadget-text* editor-string % ;
     '[ _ prev-elt ] change-caret ;
 
 : editor-prev ( editor elt -- )
-    dupd editor-select-prev mark>caret ;
+    [ editor-select-prev ] [ drop mark>caret ] 2bi ;
 
 : editor-select-next ( editor elt -- )
     '[ _ next-elt ] change-caret ;
@@ -350,42 +310,48 @@ M: editor gadget-text* editor-string % ;
     dupd editor-select-next mark>caret ;
 
 : editor-select ( from to editor -- )
-    tuck [ mark>> set-model ] [ caret>> set-model ] 2bi* ;
+    [ mark>> set-model ] [ caret>> set-model ] bi-curry bi* ;
 
 : select-elt ( editor elt -- )
-    [ [ [ editor-caret* ] [ model>> ] bi ] dip prev/next-elt ] [ drop ] 2bi
+    [ [ [ editor-caret ] [ model>> ] bi ] dip prev/next-elt ] [ drop ] 2bi
     editor-select ;
 
-: start-of-document ( editor -- ) T{ doc-elt } editor-prev ;
+: start-of-document ( editor -- ) doc-elt editor-prev ;
 
-: end-of-document ( editor -- ) T{ doc-elt } editor-next ;
+: end-of-document ( editor -- ) doc-elt editor-next ;
 
 : position-caret ( editor -- )
-    mouse-elt dup T{ one-char-elt } =
+    mouse-elt dup one-char-elt =
     [ drop dup extend-selection dup mark>> click-loc ]
     [ select-elt ] if ;
 
-: insert-newline ( editor -- ) "\n" swap user-input* drop ;
-
 : delete-next-character ( editor -- ) 
-    T{ char-elt } editor-delete ;
+    char-elt editor-delete ;
 
 : delete-previous-character ( editor -- ) 
-    T{ char-elt } editor-backspace ;
+    char-elt editor-backspace ;
 
 : delete-previous-word ( editor -- ) 
-    T{ word-elt } editor-delete ;
+    word-elt editor-delete ;
 
 : delete-next-word ( editor -- ) 
-    T{ word-elt } editor-backspace ;
+    word-elt editor-backspace ;
 
 : delete-to-start-of-line ( editor -- ) 
-    T{ one-line-elt } editor-delete ;
+    one-line-elt editor-delete ;
 
 : delete-to-end-of-line ( editor -- ) 
-    T{ one-line-elt } editor-backspace ;
+    one-line-elt editor-backspace ;
+
+: com-undo ( editor -- )
+    model>> undo ;
 
-editor "general" f {
+: com-redo ( editor -- )
+    model>> redo ;
+
+editor "editing" f {
+    { undo-action com-undo }
+    { redo-action com-redo }
     { T{ key-down f f "DELETE" } delete-next-character }
     { T{ key-down f { S+ } "DELETE" } delete-next-character }
     { T{ key-down f f "BACKSPACE" } delete-previous-character }
@@ -396,18 +362,18 @@ editor "general" f {
     { T{ key-down f { A+ } "BACKSPACE" } delete-to-end-of-line }
 } define-command-map
 
-: paste ( editor -- ) clipboard get paste-clipboard ;
+: com-paste ( editor -- ) clipboard get paste-clipboard ;
 
 : paste-selection ( editor -- ) selection get paste-clipboard ;
 
-: cut ( editor -- ) clipboard get editor-cut ;
+: com-cut ( editor -- ) clipboard get editor-cut ;
 
 editor "clipboard" f {
-    { T{ paste-action } paste }
-    { T{ button-up f f 2 } paste-selection }
-    { T{ copy-action } com-copy }
+    { cut-action com-cut }
+    { copy-action com-copy }
+    { paste-action com-paste }
     { T{ button-up } com-copy-selection }
-    { T{ cut-action } cut }
+    { T{ button-up f f 2 } paste-selection }
 } define-command-map
 
 : previous-character ( editor -- )
@@ -415,7 +381,7 @@ editor "clipboard" f {
         dup selection-start/end drop
         over set-caret mark>caret
     ] [
-        T{ char-elt } editor-prev
+        char-elt editor-prev
     ] if ;
 
 : next-character ( editor -- )
@@ -423,27 +389,21 @@ editor "clipboard" f {
         dup selection-start/end nip
         over set-caret mark>caret
     ] [
-        T{ char-elt } editor-next
+        char-elt editor-next
     ] if ;
 
-: previous-line ( editor -- ) T{ line-elt } editor-prev ;
-
-: next-line ( editor -- ) T{ line-elt } editor-next ;
+: previous-word ( editor -- ) word-elt editor-prev ;
 
-: previous-word ( editor -- ) T{ word-elt } editor-prev ;
+: next-word ( editor -- ) word-elt editor-next ;
 
-: next-word ( editor -- ) T{ word-elt } editor-next ;
+: start-of-line ( editor -- ) one-line-elt editor-prev ;
 
-: start-of-line ( editor -- ) T{ one-line-elt } editor-prev ;
-
-: end-of-line ( editor -- ) T{ one-line-elt } editor-next ;
+: end-of-line ( editor -- ) one-line-elt editor-next ;
 
 editor "caret-motion" f {
     { T{ button-down } position-caret }
     { T{ key-down f f "LEFT" } previous-character }
     { T{ key-down f f "RIGHT" } next-character }
-    { T{ key-down f f "UP" } previous-line }
-    { T{ key-down f f "DOWN" } next-line }
     { T{ key-down f { C+ } "LEFT" } previous-word }
     { T{ key-down f { C+ } "RIGHT" } next-word }
     { T{ key-down f f "HOME" } start-of-line }
@@ -452,59 +412,55 @@ editor "caret-motion" f {
     { T{ key-down f { C+ } "END" } end-of-document }
 } define-command-map
 
-: select-all ( editor -- ) T{ doc-elt } select-elt ;
+: clear-editor ( editor -- )
+    #! The with-datastack is a kludge to make it infer. Stupid.
+    model>> 1array [ clear-doc ] with-datastack drop ;
+
+: select-all ( editor -- ) doc-elt select-elt ;
 
-: select-line ( editor -- ) T{ one-line-elt } select-elt ;
+: select-line ( editor -- ) one-line-elt select-elt ;
 
-: select-word ( editor -- ) T{ one-word-elt } select-elt ;
+: select-word ( editor -- ) one-word-elt select-elt ;
 
-: selected-word ( editor -- string )
+: selected-token ( editor -- string )
     dup gadget-selection?
     [ dup select-word ] unless
     gadget-selection ;
 
 : select-previous-character ( editor -- ) 
-    T{ char-elt } editor-select-prev ;
+    char-elt editor-select-prev ;
 
 : select-next-character ( editor -- ) 
-    T{ char-elt } editor-select-next ;
-
-: select-previous-line ( editor -- ) 
-    T{ line-elt } editor-select-prev ;
-
-: select-next-line ( editor -- ) 
-    T{ line-elt } editor-select-next ;
+    char-elt editor-select-next ;
 
 : select-previous-word ( editor -- ) 
-    T{ word-elt } editor-select-prev ;
+    word-elt editor-select-prev ;
 
 : select-next-word ( editor -- ) 
-    T{ word-elt } editor-select-next ;
+    word-elt editor-select-next ;
 
 : select-start-of-line ( editor -- ) 
-    T{ one-line-elt } editor-select-prev ;
+    one-line-elt editor-select-prev ;
 
 : select-end-of-line ( editor -- ) 
-    T{ one-line-elt } editor-select-next ;
+    one-line-elt editor-select-next ;
 
 : select-start-of-document ( editor -- ) 
-    T{ doc-elt } editor-select-prev ;
+    doc-elt editor-select-prev ;
 
 : select-end-of-document ( editor -- ) 
-    T{ doc-elt } editor-select-next ;
+    doc-elt editor-select-next ;
 
 editor "selection" f {
     { T{ button-down f { S+ } 1 } extend-selection }
     { T{ drag } drag-selection }
-    { T{ gain-focus } focus-editor }
-    { T{ lose-focus } unfocus-editor }
-    { T{ delete-action } remove-selection }
-    { T{ select-all-action } select-all }
+    { gain-focus focus-editor }
+    { lose-focus unfocus-editor }
+    { delete-action remove-selection }
+    { select-all-action select-all }
     { T{ key-down f { C+ } "l" } select-line }
     { T{ key-down f { S+ } "LEFT" } select-previous-character }
     { T{ key-down f { S+ } "RIGHT" } select-next-character }
-    { T{ key-down f { S+ } "UP" } select-previous-line }
-    { T{ key-down f { S+ } "DOWN" } select-next-line }
     { T{ key-down f { S+ C+ } "LEFT" } select-previous-word }
     { T{ key-down f { S+ C+ } "RIGHT" } select-next-word }
     { T{ key-down f { S+ } "HOME" } select-start-of-line }
@@ -514,7 +470,14 @@ editor "selection" f {
 } define-command-map
 
 : editor-menu ( editor -- )
-    { cut com-copy paste } show-commands-menu ;
+    {
+        com-undo
+        com-redo
+        ----
+        com-cut
+        com-copy
+        com-paste
+    } show-commands-menu ;
 
 editor "misc" f {
     { T{ button-down f f 3 } editor-menu }
@@ -526,10 +489,72 @@ TUPLE: multiline-editor < editor ;
 : <multiline-editor> ( -- editor )
     multiline-editor new-editor ;
 
-multiline-editor "general" f {
+: previous-line ( editor -- ) line-elt editor-prev ;
+
+: next-line ( editor -- ) line-elt editor-next ;
+
+<PRIVATE
+
+: page-elt ( editor -- editor element ) dup visible-lines 1- <page-elt> ;
+
+PRIVATE>
+
+: previous-page ( editor -- ) page-elt editor-prev ;
+
+: next-page ( editor -- ) page-elt editor-next ;
+
+: select-previous-line ( editor -- ) line-elt editor-select-prev ;
+
+: select-next-line ( editor -- ) line-elt editor-select-next ;
+
+: select-previous-page ( editor -- ) page-elt editor-select-prev ;
+
+: select-next-page ( editor -- ) page-elt editor-select-next ;
+
+: insert-newline ( editor -- )
+    "\n" swap user-input* drop ;
+
+: change-selection ( editor quot -- )
+    '[ gadget-selection @ ] keep user-input* drop ; inline
+
+: join-lines ( string -- string' )
+    "\n" split
+    [ rest-slice [ [ blank? ] trim-head-slice ] change-each ]
+    [ but-last-slice [ [ blank? ] trim-tail-slice ] change-each ]
+    [ " " join ]
+    tri ;
+
+: this-line-and-next ( document line -- start end )
+    [ nip 0 swap 2array ]
+    [ [ nip 1+ ] [ 1+ swap doc-line length ] 2bi 2array ]
+    2bi ;
+
+: last-line? ( document line -- ? )
+    [ last-line# ] dip = ;
+
+: com-join-lines ( editor -- )
+    dup gadget-selection?
+    [ [ join-lines ] change-selection ] [
+        [ model>> ] [ editor-caret first ] bi
+        2dup last-line? [ 2drop ] [
+            [ this-line-and-next ] [ drop ] 2bi
+            [ join-lines ] change-doc-range
+        ] if
+    ] if ;
+
+multiline-editor "multiline" f {
+    { T{ key-down f f "UP" } previous-line }
+    { T{ key-down f f "DOWN" } next-line }
+    { T{ key-down f { S+ } "UP" } select-previous-line }
+    { T{ key-down f { S+ } "DOWN" } select-next-line }
+    { T{ key-down f f "PAGE_UP" } previous-page }
+    { T{ key-down f f "PAGE_DOWN" } next-page }
+    { T{ key-down f { S+ } "PAGE_UP" } select-previous-page }
+    { T{ key-down f { S+ } "PAGE_DOWN" } select-next-page }
     { T{ key-down f f "RET" } insert-newline }
     { T{ key-down f { S+ } "RET" } insert-newline }
     { T{ key-down f f "ENTER" } insert-newline }
+    { T{ key-down f { C+ } "j" } com-join-lines }
 } define-command-map
 
 TUPLE: source-editor < multiline-editor ;
@@ -537,29 +562,65 @@ TUPLE: source-editor < multiline-editor ;
 : <source-editor> ( -- editor )
     source-editor new-editor ;
 
-! Fields wrap an editor and edit an external model
-TUPLE: field < wrapper field-model editor ;
+! A useful model
+: <element-model> ( editor element -- model )
+    [ [ caret>> ] [ model>> ] bi ] dip
+    '[ _ _ elt-string ] <arrow> ;
+
+! Fields wrap an editor
+TUPLE: field < border editor min-cols max-cols ;
 
 : field-theme ( gadget -- gadget )
-    gray <solid> >>boundary ; inline
+    { 2 2 } >>size
+    { 1 0 } >>fill
+    COLOR: gray <solid> >>boundary ; inline
 
 : <field-border> ( gadget -- border )
-    2 <border>
+    { 2 2 } <border>
         { 1 0 } >>fill
         field-theme ;
 
-: <field> ( model -- gadget )
-    <editor> dup <field-border> field new-wrapper
-        swap >>editor
-        swap >>field-model ;
+: new-field ( class -- gadget )
+    [ <editor> ] dip new-border
+        dup gadget-child >>editor
+        field-theme ; inline
+
+! For line-gadget-width
+M: field font>> editor>> font>> ;
 
-M: field graft*
+M: field pref-dim*
+    dup
+    [ editor>> pref-dim ] keep
+    [ line-gadget-width ] [ drop second ] 2bi 2array
+    border-pref-dim ;
+
+TUPLE: model-field < field field-model ;
+
+: <model-field> ( model -- gadget )
+    model-field new-field swap >>field-model ;
+
+M: model-field graft*
     [ [ field-model>> value>> ] [ editor>> ] bi set-editor-string ]
     [ dup editor>> model>> add-connection ]
     bi ;
 
-M: field ungraft*
+M: model-field ungraft*
     dup editor>> model>> remove-connection ;
 
-M: field model-changed
+M: model-field model-changed
     nip [ editor>> editor-string ] [ field-model>> ] bi set-model ;
+
+TUPLE: action-field < field quot ;
+
+: <action-field> ( quot -- gadget )
+    action-field new-field swap >>quot ;
+
+: invoke-action-field ( field -- )
+    [ editor>> editor-string ]
+    [ editor>> clear-editor ]
+    [ quot>> ]
+    tri call ;
+
+action-field H{
+    { T{ key-down f f "RET" } [ invoke-action-field ] }
+} set-gestures
index 9b7bafd91411a775b9026ba4a05d8de71efbfa5e..006d842673d4e4e3b763de7530ae7ab5e3d1e30e 100644 (file)
@@ -3,43 +3,23 @@ quotations classes.tuple ui.gadgets.grids ;
 IN: ui.gadgets.frames
 
 ARTICLE: "ui-frame-layout" "Frame layouts"
-"Frames resemble " { $link "ui-grid-layout" } " except the size of grid is fixed at 3x3, and the center gadget fills up any available space. Because frames inherit from grids, grid layout words can be used to add and remove children."
+"Frames extend " { $link "ui-grid-layout" } " with the ability to give all remaining space to a distinguished filled cell."
+$nl
+"The filled cell's column/row pair is stored in the frame gadget's " { $slot "filled-cell" } " slot. If the actual dimensions of a frame exceed it preferred dimensions, then the fill slot is resized appropriately, together with its row and column."
+$nl
+"Because frames inherit from grids, grid layout words can be used to add and remove children."
 { $subsection frame }
 "Creating empty frames:"
-{ $subsection <frame> }
-"A set of mnemonic words for the positions on a frame's 3x3 grid; these words push values which may be passed to " { $link grid-add } ":"
-{ $subsection @center }
-{ $subsection @left }
-{ $subsection @right }
-{ $subsection @top }
-{ $subsection @bottom }
-{ $subsection @top-left }
-{ $subsection @top-right }
-{ $subsection @bottom-left }
-{ $subsection @bottom-right } ;
-
-: $ui-frame-constant ( element -- )
-    drop
-    { $description "Symbolic constant for a common input to " { $link grid-add } "." } print-element ;
-
-{ @center @left @right @top @bottom @top-left @top-right @bottom-left @bottom-right }
-[
-    [
-        {
-            { $values { "i" integer } { "j" integer } }
-            { $ui-frame-constant }
-        }
-    ] dip set-word-help
-] each
+{ $subsection <frame> } ;
 
 HELP: frame
-{ $class-description "A frame is a gadget which lays out its children in a 3x3 grid. If the frame is enlarged past its preferred size, the center gadget fills up available room."
+{ $class-description "A frame is a gadget which lays out its children in a grid, and assigns all remaining space to a distinguished filled cell. The " { $slot "filled-cell" } " slot stores a pair with shape " { $snippet "{ col row }" } "."
 $nl
 "Frames are constructed by calling " { $link <frame> } " and since they inherit from " { $link grid } ", children can be managed with " { $link grid-add } " and " { $link grid-remove } "." } ;
 
 HELP: <frame>
-{ $values { "frame" frame } }
-{ $description "Creates a new " { $link frame } " for laying out gadgets in a 3x3 grid." } ;
+{ $values { "cols" integer } { "rows" integer } { "frame" frame } }
+{ $description "Creates a new " { $link frame } " for laying out gadgets in a grid." } ;
 
 { grid frame } related-words
 
index 27d511e10ac0829c4cf8b5f6444a639f2c6891fe..95e3c6b09ae601bd49af4d73d5c134be9acfaedb 100644 (file)
@@ -2,12 +2,22 @@ USING: accessors kernel namespaces tools.test ui.gadgets
 ui.gadgets.frames ui.gadgets.grids ui.gadgets.labels ;
 IN: ui.gadgets.frames.tests
 
-[ ] [ <frame> layout ] unit-test
+[ ] [ 3 3 <frame> { 1 1 } >>filled-cell layout ] unit-test
+
+[ { 1000 1000 } ] [
+    1 1 <frame>
+    { 0 0 } >>filled-cell
+    <gadget> dup "c" set { 0 0 } grid-add
+    { 1000 1000 } >>dim
+    layout
+    "c" get dim>>
+] unit-test
 
 [ t ] [
-    <frame>
-        "Hello world" <label> @top grid-add
-        "Hello world" <label> @center grid-add
+    1 2 <frame>
+        { 0 0 } >>filled-cell
+        "Hello world" <label> { 0 0 } grid-add
+        "Hello world" <label> { 0 1 } grid-add
         dup pref-dim "dim1" set
         { 1000 1000 } >>dim
         dup layout*
@@ -15,3 +25,16 @@ IN: ui.gadgets.frames.tests
         drop
     "dim1" get "dim2" get =
 ] unit-test
+
+[ { 5 20 } { 20 20 } ] [
+    2 3 <frame>
+    { 0 1 } >>filled-cell
+    { 5 5 } >>gap
+    <gadget> { 10 10 } >>dim { 0 0 } grid-add
+    <gadget> { 10 10 } >>dim dup "c" set { 0 1 } grid-add
+    <gadget> { 10 20 } >>dim { 0 2 } grid-add
+    <gadget> { 30 10 } >>dim { 1 1 } grid-add
+    { 65 70 } >>dim
+    layout
+    "c" get [ loc>> ] [ dim>> ] bi
+] unit-test
\ No newline at end of file
index a4d6b46129bd2b10844cc2910af31169bf619dad..34f46865187081aebe5bcfcbb54538174574da7f 100644 (file)
@@ -1,43 +1,49 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays generic kernel math namespaces sequences
 words splitting grouping math.vectors ui.gadgets.grids
-ui.gadgets math.geometry.rect ;
+ui.gadgets.grids.private ui.gadgets math.order math.rectangles
+fry ;
 IN: ui.gadgets.frames
 
+TUPLE: frame < grid filled-cell ;
+
+<PRIVATE
+
 TUPLE: glue < gadget ;
 
 M: glue pref-dim* drop { 0 0 } ;
 
-: <glue> ( -- glue ) glue new-gadget ;
+: <glue> ( -- glue ) glue new ;
 
-: <frame-grid> ( -- grid ) 9 [ <glue> ] replicate 3 group ;
+: <frame-grid> ( cols rows -- grid )
+    swap '[ _ [ <glue> ] replicate ] replicate ;
 
-: @center ( -- i j ) 1 1 ; inline
-: @left ( -- i j ) 0 1 ; inline
-: @right ( -- i j ) 2 1 ; inline
-: @top ( -- i j ) 1 0 ; inline
-: @bottom ( -- i j ) 1 2 ; inline
+: (fill- ( frame grid-layout quot1 quot2 -- pref-dim gap filled-cell dims )
+    [ '[ [ dim>> ] [ gap>> ] [ filled-cell>> ] tri _ tri@ ] dip ] dip call ; inline
 
-: @top-left ( -- i j ) 0 0 ; inline
-: @top-right ( -- i j ) 2 0 ; inline
-: @bottom-left ( -- i j ) 0 2 ; inline
-: @bottom-right ( -- i j ) 2 2 ; inline
+: available-space ( pref-dim gap dims -- avail )
+    length 1+ * [-] ; inline
 
-TUPLE: frame < grid ;
+: -center) ( pref-dim gap filled-cell dims -- )
+    [ nip available-space ] 2keep [ remove-nth sum [-] ] 2keep set-nth ; inline
 
-: new-frame ( class -- frame )
-    <frame-grid> swap new-grid ; inline
+: (fill-center) ( frame grid-layout quot1 quot2 -- ) (fill- -center) ; inline
 
-: <frame> ( -- frame )
-    frame new-frame ;
+: fill-center ( frame grid-layout -- )
+    [ [ first ] [ column-widths>> ] (fill-center) ]
+    [ [ second ] [ row-heights>> ] (fill-center) ] 2bi ;
 
-: (fill-center) ( dim vec -- )
-    [ [ first ] [ third ] bi v+ [v-] ] keep set-second ;
+: <frame-layout> ( frame -- grid-layout )
+    dup <grid-layout> [ fill-center ] keep ;
 
-: fill-center ( dim horiz vert -- )
-    [ over ] dip [ (fill-center) ] 2bi@ ;
+PRIVATE>
 
 M: frame layout*
-    dup compute-grid
-    [ [ dim>> ] 2dip fill-center ] [ grid-layout ] 3bi ;
+    [ grid>> ] [ <frame-layout> ] bi grid-layout ;
+
+: new-frame ( cols rows class -- frame )
+    [ <frame-grid> ] dip new-grid ; inline
+
+: <frame> ( cols rows -- frame )
+    frame new-frame ;
\ No newline at end of file
index 169f97f0b95e51cbaea4c47f8f9c0e6000824a89..557c6f812ce2f2f400f31a994e3815f9e84aa145 100644 (file)
@@ -1,5 +1,6 @@
 USING: help.markup help.syntax opengl kernel strings
-       classes.tuple classes quotations models math.geometry.rect ;
+classes.tuple classes quotations models math.rectangles
+ui.gadgets.private accessors ;
 IN: ui.gadgets
 
 HELP: gadget-child
@@ -29,9 +30,9 @@ HELP: user-input*
 { $contract "Handle free-form textual input while the gadget has keyboard focus." } ;
 
 HELP: children-on
-{ $values { "rect/point" "a " { $link rect } " or a pair of integers" } { "gadget" gadget } { "seq" "a sequence of gadgets" } }
-{ $contract "Outputs a sequence of gadgets which potentially intersect a rectangle or contain a point in the co-ordinate system of the gadget." }
-{ $notes "This does not have to be an accurate intersection test, and simply returning " { $snippet "children" } " is a valid implementation. However, an accurate intersection test reduces the amount of work done when drawing this gadget if it is partially clipped and not all children are visible." } ;
+{ $values { "rect" rect } { "gadget" gadget } { "seq" "a sequence of gadgets" } }
+{ $contract "Outputs a sequence of gadgets which potentially intersect a rectangle in the co-ordinate system of the gadget." }
+{ $notes "This does not have to be an accurate intersection test, and simply returning " { $link children>> } " is a valid implementation. However, an accurate intersection test reduces the amount of work done when drawing this gadget if it is partially clipped and not all children are visible." } ;
 
 HELP: pick-up
 { $values { "point" "a pair of integers" } { "gadget" gadget } { "child/f" { $maybe gadget } } }
index 01d695c28194fd88855959a6cd380f575b880dea..baeb320447ec129ddbca4986f26b4a685ca571ea 100644 (file)
@@ -1,7 +1,8 @@
-USING: accessors ui.gadgets ui.gadgets.packs ui.gadgets.worlds
-tools.test namespaces models kernel dlists deques math sets
-math.parser ui sequences hashtables assocs io arrays prettyprint
-io.streams.string math.geometry.rect ;
+USING: accessors ui.gadgets ui.gadgets.private ui.gadgets.packs
+ui.gadgets.worlds tools.test namespaces models kernel dlists deques
+math sets math.parser ui sequences hashtables assocs io arrays
+prettyprint io.streams.string math.rectangles ui.gadgets.private
+sets generic ;
 IN: ui.gadgets.tests
 
 [ { 300 300 } ]
@@ -37,14 +38,14 @@ IN: ui.gadgets.tests
 "g3" get "g2" get add-gadget drop
 
 [ { 30 30 } ] [ "g1" get screen-loc ] unit-test
-[ { 30 30 } ] [ "g1" get screen-rect rect-loc ] unit-test
-[ { 30 30 } ] [ "g1" get screen-rect rect-dim ] unit-test
+[ { 30 30 } ] [ "g1" get screen-rect loc>> ] unit-test
+[ { 30 30 } ] [ "g1" get screen-rect dim>> ] unit-test
 [ { 20 20 } ] [ "g2" get screen-loc ] unit-test
-[ { 20 20 } ] [ "g2" get screen-rect rect-loc ] unit-test
-[ { 50 180 } ] [ "g2" get screen-rect rect-dim ] unit-test
+[ { 20 20 } ] [ "g2" get screen-rect loc>> ] unit-test
+[ { 50 180 } ] [ "g2" get screen-rect dim>> ] unit-test
 [ { 0 0 } ] [ "g3" get screen-loc ] unit-test
-[ { 0 0 } ] [ "g3" get screen-rect rect-loc ] unit-test
-[ { 100 200 } ] [ "g3" get screen-rect rect-dim ] unit-test
+[ { 0 0 } ] [ "g3" get screen-rect loc>> ] unit-test
+[ { 100 200 } ] [ "g3" get screen-rect dim>> ] unit-test
 
 <gadget> "g1" set
 "g1" get { 300 300 } >>dim drop
@@ -57,9 +58,9 @@ IN: ui.gadgets.tests
 "g3" get { 100 100 } >>loc
          { 20 20 } >>dim drop
 
-[ t ] [ { 30 30 } "g2" get inside? ] unit-test
+[ t ] [ { 30 30 } "g2" get contains-point? ] unit-test
 
-[ t ] [ { 30 30 } "g1" get (pick-up) "g2" get eq? ] unit-test
+[ t ] [ { 30 30 } "g1" get pick-up "g2" get eq? ] unit-test
 
 [ t ] [ { 30 30 } "g1" get pick-up "g2" get eq? ] unit-test
 
@@ -75,7 +76,7 @@ IN: ui.gadgets.tests
 TUPLE: mock-gadget < gadget graft-called ungraft-called ;
 
 : <mock-gadget> ( -- gadget )
-    mock-gadget new-gadget 0 >>graft-called 0 >>ungraft-called ;
+    mock-gadget new 0 >>graft-called 0 >>ungraft-called ;
 
 M: mock-gadget graft*
     [ 1+ ] change-graft-called drop ;
@@ -161,3 +162,6 @@ M: mock-gadget ungraft*
 \ relayout must-infer
 \ relayout-1 must-infer
 \ pref-dim must-infer
+
+\ graft* must-infer
+\ ungraft* must-infer
\ No newline at end of file
index 2af0f6e6a2584694b9d1b537e24f9c2bc8c04815..e38f56c7f18cd2e13a45f17fbf9fb829ec784889 100644 (file)
@@ -1,18 +1,30 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays hashtables kernel models math namespaces
 make sequences quotations math.vectors combinators sorting
 binary-search vectors dlists deques models threads
-concurrency.flags math.order math.geometry.rect fry ;
+concurrency.flags math.order math.rectangles fry ;
 IN: ui.gadgets
 
-SYMBOL: ui-notify-flag
-
-: notify-ui-thread ( -- ) ui-notify-flag get-global raise-flag ;
-
-TUPLE: gadget < rect pref-dim parent children orientation focus
-visible? root? clipped? layout-state graft-state graft-node
-interior boundary model ;
+! Values for orientation slot
+CONSTANT: horizontal { 1 0 }
+CONSTANT: vertical { 0 1 }
+
+TUPLE: gadget < rect
+pref-dim
+parent
+children
+{ orientation initial: { 0 1 } }
+focus
+{ visible? initial: t }
+root?
+clipped?
+layout-state
+{ graft-state initial: { f f } }
+graft-node
+interior
+boundary
+model ;
 
 M: gadget equal? 2drop f ;
 
@@ -24,27 +36,8 @@ M: gadget model-changed 2drop ;
 
 : nth-gadget ( n gadget -- child ) children>> nth ;
 
-: init-gadget ( gadget -- gadget )
-    init-rect
-    { 0 1 } >>orientation
-    t >>visible?
-    { f f } >>graft-state ; inline
-
-: new-gadget ( class -- gadget ) new init-gadget ; inline
-
 : <gadget> ( -- gadget )
-    gadget new-gadget ;
-
-: activate-control ( gadget -- )
-    dup model>> dup [
-        2dup add-connection
-        swap model-changed
-    ] [
-        2drop
-    ] if ;
-
-: deactivate-control ( gadget -- )
-    dup model>> dup [ 2dup remove-connection ] when 2drop ;
+    gadget new ;
 
 : control-value ( control -- value )
     model>> value>> ;
@@ -56,37 +49,42 @@ M: gadget model-changed 2drop ;
     2dup eq? [
         2drop { 0 0 }
     ] [
-        over rect-loc [ [ parent>> ] dip relative-loc ] dip v+
+        [ [ parent>> ] dip relative-loc ] [ drop loc>> ] 2bi v+
     ] if ;
 
 GENERIC: user-input* ( str gadget -- ? )
 
 M: gadget user-input* 2drop t ;
 
-GENERIC: children-on ( rect/point gadget -- seq )
+GENERIC: children-on ( rect gadget -- seq )
 
 M: gadget children-on nip children>> ;
 
+<PRIVATE
+
 : ((fast-children-on)) ( gadget dim axis -- <=> )
     [ swap loc>> v- ] dip v. 0 <=> ;
 
 : (fast-children-on) ( dim axis children -- i )
     -rot '[ _ _ ((fast-children-on)) ] search drop ;
 
+PRIVATE>
+
 : fast-children-on ( rect axis children -- from to )
-    [ [ rect-loc ] 2dip (fast-children-on) 0 or ]
+    [ [ loc>> ] 2dip (fast-children-on) 0 or ]
     [ [ rect-bounds v+ ] 2dip (fast-children-on) ?1+ ]
     3bi ;
 
-: inside? ( bounds gadget -- ? )
-    dup visible?>> [ intersects? ] [ 2drop f ] if ;
+M: gadget contains-rect? ( bounds gadget -- ? )
+    dup visible?>> [ call-next-method ] [ 2drop f ] if ;
 
-: (pick-up) ( point gadget -- gadget )
-    dupd children-on [ inside? ] with find-last nip ;
+M: gadget contains-point? ( loc gadget -- ? )
+    dup visible?>> [ call-next-method ] [ 2drop f ] if ;
 
 : pick-up ( point gadget -- child/f )
-    2dup (pick-up) dup
-    [ nip [ rect-loc v- ] keep pick-up ] [ drop nip ] if ;
+    2dup [ dup point>rect ] dip children-on
+    [ contains-point? ] with find-last nip
+    [ [ loc>> v- ] keep pick-up ] [ nip ] ?if ;
 
 : max-dim ( dims -- dim ) { 0 0 } [ vmax ] reduce ;
 
@@ -110,20 +108,28 @@ GENERIC: gadget-text* ( gadget -- )
 GENERIC: gadget-text-separator ( gadget -- str )
 
 M: gadget gadget-text-separator
-    orientation>> { 0 1 } = "\n" "" ? ;
+    orientation>> vertical = "\n" "" ? ;
 
 : gadget-seq-text ( seq gadget -- )
     gadget-text-separator swap
     [ dup % ] [ gadget-text* ] interleave drop ;
 
 M: gadget gadget-text*
-    dup children>> swap gadget-seq-text ;
+    [ children>> ] keep gadget-seq-text ;
 
 M: array gadget-text*
     [ gadget-text* ] each ;
 
 : gadget-text ( gadget -- string ) [ gadget-text* ] "" make ;
 
+DEFER: relayout
+
+<PRIVATE
+
+SYMBOL: ui-notify-flag
+
+: notify-ui-thread ( -- ) ui-notify-flag get-global raise-flag ;
+
 : invalidate ( gadget -- )
     \ invalidate >>layout-state drop ;
 
@@ -137,14 +143,14 @@ M: array gadget-text*
     #! invalidation requests.
     layout-queue [ push-front notify-ui-thread ] [ drop ] if* ;
 
-DEFER: relayout
-
 : invalidate* ( gadget -- )
     \ invalidate* >>layout-state
     dup forget-pref-dim
     dup root?>>
     [ layout-later ] [ parent>> [ relayout ] when* ] if ;
 
+PRIVATE>
+
 : relayout ( gadget -- )
     dup layout-state>> \ invalidate* eq?
     [ drop ] [ invalidate* ] if ;
@@ -157,13 +163,17 @@ DEFER: relayout
                               
 : hide-gadget ( gadget -- ) f >>visible? drop ;
 
-DEFER: in-layout?
+<PRIVATE
+
+SYMBOL: in-layout?
 
 GENERIC: dim-changed ( gadget -- )
 
 M: gadget dim-changed
     in-layout? get [ invalidate ] [ invalidate* ] if ;
 
+PRIVATE>
+
 M: gadget (>>dim) ( dim gadget -- )
     2dup dim>> =
     [ 2drop ]
@@ -171,18 +181,15 @@ M: gadget (>>dim) ( dim gadget -- )
 
 GENERIC: pref-dim* ( gadget -- dim )
 
-: ?set-gadget-pref-dim ( dim gadget -- )
-    dup layout-state>>
-    [ 2drop ] [ (>>pref-dim) ] if ;
-
 : pref-dim ( gadget -- dim )
     dup pref-dim>> [ ] [
-        [ pref-dim* dup ] keep ?set-gadget-pref-dim
+        [ pref-dim* ] keep dup layout-state>>
+        [ drop ] [ dupd (>>pref-dim) ] if
     ] ?if ;
 
 : pref-dims ( gadgets -- seq ) [ pref-dim ] map ;
 
-M: gadget pref-dim* rect-dim ;
+M: gadget pref-dim* dim>> ;
 
 GENERIC: layout* ( gadget -- )
 
@@ -190,15 +197,23 @@ M: gadget layout* drop ;
 
 : prefer ( gadget -- ) dup pref-dim >>dim drop ;
 
-: validate ( gadget -- ) f >>layout-state drop ;
-
 : layout ( gadget -- )
     dup layout-state>> [
-        dup validate
+        f >>layout-state
         dup layout*
         dup [ layout ] each-child
     ] when drop ;
 
+GENERIC: graft* ( gadget -- )
+
+M: gadget graft* drop ;
+
+GENERIC: ungraft* ( gadget -- )
+
+M: gadget ungraft* drop ;
+
+<PRIVATE
+
 : graft-queue ( -- dlist ) \ graft-queue get ;
 
 : unqueue-graft ( gadget -- )
@@ -224,6 +239,9 @@ M: gadget layout* drop ;
         { { f f } [ queue-graft ] }
     } case ;
 
+: graft ( gadget -- )
+    dup graft-later [ graft ] each-child ;
+
 : ungraft-later ( gadget -- )
     dup graft-state>> {
         { { f f } [ drop ] }
@@ -232,72 +250,92 @@ M: gadget layout* drop ;
         { { t t } [ queue-ungraft ] }
     } case ;
 
-GENERIC: graft* ( gadget -- )
-
-M: gadget graft* drop ;
+: ungraft ( gadget -- )
+    dup [ ungraft ] each-child ungraft-later ;
 
-: graft ( gadget -- )
-    dup graft-later [ graft ] each-child ;
+: activate-control ( gadget -- )
+    dup model>> dup [
+        2dup add-connection
+        swap model-changed
+    ] [
+        2drop
+    ] if ;
 
-GENERIC: ungraft* ( gadget -- )
+: deactivate-control ( gadget -- )
+    dup model>> dup [ 2dup remove-connection ] when 2drop ;
 
-M: gadget ungraft* drop ;
+: notify ( gadget -- )
+    dup graft-state>>
+    [ first { f f } { t t } ? >>graft-state ] keep
+    {
+        { { f t } [ dup activate-control graft* ] }
+        { { t f } [ dup deactivate-control ungraft* ] }
+    } case ;
 
-: ungraft ( gadget -- )
-    dup [ ungraft ] each-child ungraft-later ;
+: notify-queued ( -- )
+    graft-queue [ notify ] slurp-deque ;
 
 : (unparent) ( gadget -- )
     dup ungraft
     dup forget-pref-dim
     f >>parent drop ;
 
+: (clear-gadget) ( gadget -- )
+    dup [ (unparent) ] each-child
+    f >>focus f >>children drop ;
+
 : unfocus-gadget ( child gadget -- )
     [ nip ] [ focus>> eq? ] 2bi [ f >>focus ] when drop ;
 
-SYMBOL: in-layout?
+PRIVATE>
 
 : not-in-layout ( -- )
     in-layout? get
     [ "Cannot add/remove gadgets in layout*" throw ] when ;
 
+GENERIC: remove-gadget ( gadget parent -- )
+
+M: gadget remove-gadget 2drop ;
+
 : unparent ( gadget -- )
     not-in-layout
     [
-        dup parent>> dup [
-            over (unparent)
-            [ unfocus-gadget ] 2keep
-            [ children>> delete ] keep
-            relayout
-        ] [
-            2drop
-        ] if
+        dup parent>> dup
+        [
+            [ remove-gadget ] [
+                over (unparent)
+                [ unfocus-gadget ]
+                [ children>> delete ]
+                [ nip relayout ]
+                2tri
+            ] 2bi
+        ] [ 2drop ] if
     ] when* ;
 
-: (clear-gadget) ( gadget -- )
-    dup [ (unparent) ] each-child
-    f >>focus f >>children drop ;
-
 : clear-gadget ( gadget -- )
     not-in-layout
-    dup (clear-gadget) relayout ;
+    [ (clear-gadget) ] [ relayout ] bi ;
+
+<PRIVATE
 
-: ((add-gadget)) ( parent child -- parent )
-    over children>> ?push >>children ;
+: (add-gadget) ( child parent -- )
+    {
+        [ drop unparent ]
+        [ >>parent drop ]
+        [ [ ?push ] change-children drop ]
+        [ graft-state>> second [ graft ] [ drop ] if ]
+    } 2cleave ;
 
-: (add-gadget) ( parent child -- parent )
-    dup unparent
-    over >>parent
-    tuck ((add-gadget))
-    tuck graft-state>> second [ graft ] [ drop  ] if ;
+PRIVATE>
 
 : add-gadget ( parent child -- parent )
     not-in-layout
-    (add-gadget)
+    over (add-gadget)
     dup relayout ;
 
 : add-gadgets ( parent children -- parent )
     not-in-layout
-    [ (add-gadget) ] each
+    [ over (add-gadget) ] each
     dup relayout ;
 
 : parents ( gadget -- seq )
@@ -310,7 +348,9 @@ SYMBOL: in-layout?
     [ parents ] dip find nip ; inline
 
 : screen-loc ( gadget -- loc )
-    parents { 0 0 } [ rect-loc v+ ] reduce ;
+    parents { 0 0 } [ loc>> v+ ] reduce ;
+
+<PRIVATE
 
 : (screen-rect) ( gadget -- loc ext )
     dup parent>> [
@@ -320,6 +360,8 @@ SYMBOL: in-layout?
         rect-extent
     ] if* ;
 
+PRIVATE>
+
 : screen-rect ( gadget -- rect )
     (screen-rect) <extent-rect> ;
 
@@ -347,5 +389,5 @@ M: f request-focus-on 2drop ;
 : request-focus ( gadget -- )
     [ focusable-child ] keep request-focus-on ;
 
-: focus-path ( world -- seq )
+: focus-path ( gadget -- seq )
     [ focus>> ] follow ;
diff --git a/basis/ui/gadgets/glass/glass-tests.factor b/basis/ui/gadgets/glass/glass-tests.factor
new file mode 100644 (file)
index 0000000..d4e4306
--- /dev/null
@@ -0,0 +1,17 @@
+IN: ui.gadgets.glass.tests
+USING: tools.test ui.gadgets.glass ui.gadgets.worlds ui.gadgets
+math.rectangles namespaces accessors models sequences ;
+
+<gadget> "" f <model> <world>
+{ 1000 1000 } >>dim
+"w" set
+
+[ ] [ <gadget> "g" set ] unit-test
+
+[ ] [ "w" get "g" get { 0 0 } { 100 100 } <rect> show-glass ] unit-test
+
+[ ] [ "g" get hide-glass ] unit-test
+
+[ f ] [ "g" get parent>> parent>> ] unit-test
+
+[ t ] [ "w" get layers>> empty? ] unit-test
\ No newline at end of file
diff --git a/basis/ui/gadgets/glass/glass.factor b/basis/ui/gadgets/glass/glass.factor
new file mode 100644 (file)
index 0000000..a8f438c
--- /dev/null
@@ -0,0 +1,81 @@
+! Copyright (C) 2005, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors kernel namespaces ui.gadgets ui.gadgets.worlds
+ui.gadgets.wrappers ui.gestures math.rectangles
+math.rectangles.positioning combinators vectors ;
+IN: ui.gadgets.glass
+
+GENERIC: hide-glass-hook ( gadget -- )
+
+M: gadget hide-glass-hook drop ;
+
+<PRIVATE
+
+TUPLE: glass < gadget visible-rect owner ;
+
+: <glass> ( owner child visible-rect -- glass )
+    glass new
+        swap >>visible-rect
+        swap add-gadget
+        swap >>owner ;
+    
+: visible-rect ( glass -- rect )
+    [ visible-rect>> ] [ owner>> ] bi screen-loc offset-rect ;
+
+M: glass layout*
+    [
+        [ visible-rect ]
+        [ gadget-child pref-dim ]
+        [ find-world dim>> ]
+        tri popup-rect
+    ] [ gadget-child ] bi set-rect-bounds ;
+
+M: glass ungraft* gadget-child hide-glass-hook ;
+
+: add-glass ( glass world -- )
+    [ swap add-gadget drop ] [ [ ?push ] change-layers drop ] 2bi ;
+
+PRIVATE>
+
+: hide-glass ( child -- )
+    [ glass? ] find-parent
+    [ dup find-world [ unparent ] dip request-focus ]
+    when* ;
+
+: show-glass ( owner child visible-rect -- )
+    <glass>
+    dup gadget-child hand-clicked set
+    dup owner>> find-world add-glass ;
+
+\ glass H{
+    { T{ button-down } [ hide-glass ] }
+    { T{ drag } [ update-clicked drop ] }
+} set-gestures
+
+SLOT: popup
+
+<PRIVATE
+
+TUPLE: popup < wrapper owner ;
+
+: <popup> ( owner gadget -- popup )
+    popup new-wrapper
+        swap >>owner ; inline
+
+M: popup hide-glass-hook
+    owner>> f >>popup request-focus ;
+
+PRIVATE>
+
+popup H{
+    { T{ key-down f f "ESC" } [ hide-glass ] }
+} set-gestures
+
+: pass-to-popup ( gesture interactor -- ? )
+    popup>> focusable-child resend-gesture ;
+
+: show-popup ( owner popup visible-rect -- )
+    [ <popup> ] dip
+    [ drop dup owner>> (>>popup) ]
+    [ [ [ owner>> ] keep ] dip show-glass ]
+    2bi ;
\ No newline at end of file
index 0838f1ded773c04052dcab04aec0ff09e2cf2a19..2101e3598e1177cf20c6b9fb737a0387c0f62f0b 100644 (file)
@@ -1,6 +1,17 @@
 USING: ui.gadgets help.markup help.syntax ui.gadgets.grids
-ui.render ;
+ui.pens colors ;
 IN: ui.gadgets.grid-lines
 
 HELP: grid-lines
-{ $class-description "A class implementing the " { $link draw-boundary } " generic word to draw lines between the cells of a " { $link grid } ". The color of the lines is a color specifier stored in the " { $snippet "color" } " slot." } ;
+{ $class-description "A class implementing the " { $link draw-boundary } " generic word to draw lines between the cells of a " { $link grid } ". The color of the lines is an instance of " { $link color } ", stored in the " { $snippet "color" } " slot." }
+{ $notes "See " { $link "colors" } "." } ;
+
+HELP: <grid-lines>
+{ $values { "color" color } { "grid-lines" grid-lines } }
+{ $description "Creates a new " { $link grid-lines } "." } ;
+
+ARTICLE: "ui.gadgets.grid-lines" "Grid lines"
+{ $subsection grid-lines }
+{ $subsection <grid-lines> } ;
+
+ABOUT: "ui.gadgets.grid-lines"
\ No newline at end of file
diff --git a/basis/ui/gadgets/grid-lines/grid-lines-tests.factor b/basis/ui/gadgets/grid-lines/grid-lines-tests.factor
new file mode 100644 (file)
index 0000000..4cbbffd
--- /dev/null
@@ -0,0 +1,68 @@
+IN: ui.gadgets.grid-lines.tests
+USING: tools.test ui.gadgets ui.gadgets.grid-lines ui.gadgets.grid-lines.private
+ui.gadgets.grids.private accessors arrays ui.gadgets.grids sorting kernel ;
+
+: 100x100 ( -- gadget ) <gadget> { 100 100 } >>dim ;
+
+[
+    {
+        { { 0 0 } { 0 101 } }
+        { { 0 0 } { 101 0 } }
+        { { 0 100 } { 101 100 } }
+        { { 100 0 } { 100 101 } }
+    }
+] [
+    100x100 1array
+    1array
+    <grid>
+    { 100 100 } >>dim
+    compute-grid-lines natural-sort
+] unit-test
+
+[
+    {
+        { { 5 5 } { 5 116 } }
+        { { 5 5 } { 116 5 } }
+        { { 5 115 } { 116 115 } }
+        { { 115 5 } { 115 116 } }
+    }
+] [
+    100x100 1array
+    1array
+    <grid>
+    { 10 10 } >>gap
+    dup prefer
+    compute-grid-lines natural-sort
+] unit-test
+
+[
+    {
+        { { 0 0 } { 0 201 } }
+        { { 0 0 } { 201 0 } }
+        { { 0 100 } { 201 100 } }
+        { { 0 200 } { 201 200 } }
+        { { 100 0 } { 100 201 } }
+        { { 200 0 } { 200 201 } }
+    }
+] [
+    100x100 100x100 2array
+    100x100 100x100 2array
+    2array
+    <grid>
+    { 200 200 } >>dim
+    compute-grid-lines natural-sort
+] unit-test
+
+[
+    {
+        { { 0 0 } { 0 3 } }
+        { { 2 0 } { 2 3 } }
+        { { 0 0 } { 3 0 } }
+        { { 0 2 } { 3 2 } }
+    }
+] [
+    <gadget> { 1 1 } >>dim
+    1array 1array <grid> { 1 1 } >>gap
+    dup prefer
+    compute-grid-lines
+] unit-test
\ No newline at end of file
index 03e2e64d958af30040890fce49c249b10dffc4c7..4ba97e3e3ad792f1683e5467234c271e5e1a9f59 100755 (executable)
@@ -1,34 +1,30 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel accessors math namespaces opengl opengl.gl
-sequences math.vectors ui.gadgets ui.gadgets.grids ui.render
-math.geometry.rect fry ;
+sequences math.vectors ui.pens ui.gadgets ui.gadgets.grids
+ui.gadgets.grids.private ui.render math.rectangles
+fry locals arrays assocs ;
 IN: ui.gadgets.grid-lines
 
 TUPLE: grid-lines color ;
 
 C: <grid-lines> grid-lines
 
-SYMBOL: grid-dim
+<PRIVATE
 
-: half-gap ( -- gap ) grid get gap>> [ 2/ ] map ; inline
+:: (compute-grid-lines) ( grid n ns orientation -- seq )
+    grid gap>> :> gap
+    ns n suffix gap orientation v. '[ _ - orientation n*v ] map
+    dup grid dim>> gap v- orientation reverse [ v* ] keep '[ _ _ v+ v+ ] map
+    [ [ gap [ 2/ ] map v+ ] map ] bi@ zip ;
 
-: grid-line-from/to ( orientation point -- from to )
-    half-gap v-
-    [ half-gap spin set-axis ] 2keep
-    grid-dim get spin set-axis ;
+: compute-grid-lines ( grid -- lines )
+    dup <grid-layout>
+    [ accumulate-cell-xs horizontal (compute-grid-lines) ]
+    [ accumulate-cell-ys vertical (compute-grid-lines) ]
+    2bi append ;
 
-: draw-grid-lines ( gaps orientation -- )
-    [ grid get swap grid-positions grid get rect-dim suffix ] dip
-    [ '[ _ v- ] map ] keep
-    '[ _ swap grid-line-from/to gl-line ] each ;
+PRIVATE>
 
 M: grid-lines draw-boundary
-    color>> gl-color [
-        dup grid set
-        dup rect-dim half-gap v- grid-dim set
-        compute-grid
-        [ { 1 0 } draw-grid-lines ]
-        [ { 0 1 } draw-grid-lines ]
-        bi*
-    ] with-scope ;
+    color>> gl-color compute-grid-lines [ first2 gl-line ] each ;
index 1c00bedea8e2627db470ac4d3b7e16552d464021..66db44f524482b1438ec808cfe07030151edba33 100644 (file)
@@ -9,7 +9,9 @@ ARTICLE: "ui-grid-layout" "Grid layouts"
 "Managing children:"
 { $subsection grid-add }
 { $subsection grid-remove }
-{ $subsection grid-child } ;
+{ $subsection grid-child }
+"Grid lines:"
+{ $subsection "ui.gadgets.grid-lines" } ;
 
 HELP: grid
 { $class-description "A grid gadget lays out its children so that all gadgets in a column have equal width and all gadgets in a row have equal height."
@@ -23,22 +25,24 @@ $nl
 "The " { $link add-gadget } ", " { $link unparent } " and " { $link clear-gadget } " words should not be used to manage child gadgets of grids." } ;
 
 HELP: <grid>
-{ $values { "children" "a sequence of sequences of gadgets" } { "grid" "a new " { $link grid } } }
+{ $values { "children" "a sequence of sequences of gadgets, column-major" } { "grid" "a new " { $link grid } } }
 { $description "Creates a new " { $link grid } " gadget with the given children." } ;
 
 HELP: grid-child
-{ $values { "grid" grid } { "i" "non-negative integer" } { "j" "non-negative integer" } { "gadget" gadget } }
-{ $description "Outputs the child gadget at the " { $snippet "i" } "," { $snippet "j" } "th position of the grid." }
+{ $values { "grid" grid } { "pair" "a pair with shape " { $snippet "{ col row }" } } { "gadget" gadget } }
+{ $description "Outputs the child gadget at the specified location." }
 { $errors "Throws an error if the indices are out of bounds." } ;
 
 HELP: grid-add
-{ $values { "grid" grid } { "child" gadget } { "i" "non-negative integer" } { "j" "non-negative integer" } }
+{ $values { "grid" grid } { "child" gadget } { "pair" "a pair with shape " { $snippet "{ col row }" } } }
 { $description "Adds a child gadget at the specified location." }
+{ $errors "Throws an error if the indices are out of bounds." }
 { $side-effects "grid" } ;
 
 HELP: grid-remove
-{ $values { "grid" grid } { "i" "non-negative integer" } { "j" "non-negative integer" } }
+{ $values { "grid" grid } { "pair" "a pair with shape " { $snippet "{ col row }" } } }
 { $description "Removes a child gadget from the specified location." }
+{ $errors "Throws an error if the indices are out of bounds." }
 { $side-effects "grid" } ;
 
 ABOUT: "ui-grid-layout"
index 9015b7ec1b9079fe2f6813fdd76504ad75bbef51..fb92cd2ac65aaa7ddc3db1596d09760cec082a91 100644 (file)
@@ -1,10 +1,14 @@
 USING: ui.gadgets ui.gadgets.grids tools.test kernel arrays
-namespaces math.geometry.rect accessors ;
+namespaces math.rectangles accessors ui.gadgets.grids.private
+ui.gadgets.debug sequences ;
 IN: ui.gadgets.grids.tests
 
+[ { { { 1 "a" } { 1 "b" } } { { 2 "a" } { 2 "b" } } } ]
+[ { 1 2 } { "a" "b" } cross-zip ] unit-test
+
 [ { 0 0 } ] [ { } <grid> pref-dim ] unit-test
 
-: 100x100 <gadget> { 100 100 } >>dim ;
+: 100x100 ( -- gadget ) <gadget> { 100 100 } >>dim ;
 
 [ { 100 100 } ] [
     100x100
@@ -41,7 +45,43 @@ IN: ui.gadgets.grids.tests
     { 10 10 } >>gap
     dup prefer
     dup layout
-    rect-dim
-    "a" get rect-dim
-    "b" get rect-dim
+    dim>>
+    "a" get dim>>
+    "b" get dim>>
+] unit-test
+
+[ ] [
+    100x100 dup "a" set
+    100x100 dup "b" set
+    100x100 dup "c" set
+    [ 1array ] tri@ 3array
+    <grid>
+    { 10 10 } >>gap "g" set
 ] unit-test
+
+[ ] [ "g" get prefer ] unit-test
+[ ] [ "g" get layout ] unit-test
+
+[ { 10 10 } ] [ "a" get loc>> ] unit-test
+[ { 100 100 } ] [ "a" get dim>> ] unit-test
+
+[ { 10 120 } ] [ "b" get loc>> ] unit-test
+[ { 100 100 } ] [ "b" get dim>> ] unit-test
+
+[ { 10 230 } ] [ "c" get loc>> ] unit-test
+[ { 100 100 } ] [ "c" get dim>> ] unit-test
+
+5 10 { 10 10 } <baseline-gadget>
+10 10 { 10 10 } <baseline-gadget> 2array
+1array <grid> f >>fill?
+"g" set
+
+[ ] [ "g" get prefer ] unit-test
+
+[ { 20 15 } ] [ "g" get dim>> ] unit-test
+
+[ V{ { 0 5 } { 10 0 } } ] [
+    "g" get
+    dup layout
+    children>> [ loc>> ] map
+] unit-test
\ No newline at end of file
index e40da44483bdbcc4be75b145c18640de52f146b1..4ab080464b748421521f9a5c1172602772d9bf84 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays kernel math namespaces make sequences words io
-io.styles math.vectors ui.gadgets columns accessors
-math.geometry.rect locals fry ;
+USING: arrays kernel math math.order namespaces make sequences words io
+math.vectors ui.gadgets ui.baseline-alignment columns accessors strings.tables
+math.rectangles fry ;
 IN: ui.gadgets.grids
 
 TUPLE: grid < gadget
@@ -11,79 +11,119 @@ grid
 { fill? initial: t } ;
 
 : new-grid ( children class -- grid )
-    new-gadget
-        swap >>grid
-        dup grid>> concat add-gadgets ; inline
+    new
+        swap [ >>grid ] [ concat add-gadgets ] bi ; inline
 
 : <grid> ( children -- grid )
     grid new-grid ;
 
-:: grid-child ( grid i j -- gadget ) i j grid grid>> nth nth ;
+<PRIVATE
 
-:: grid-add ( grid child i j -- grid )
-    grid i j grid-child unparent
-    grid child add-gadget
-    child i j grid grid>> nth set-nth ;
+: grid@ ( grid pair -- col# row )
+    swap [ first2 ] [ grid>> ] bi* nth ;
 
-: grid-remove ( grid i j -- grid ) [ <gadget> ] 2dip grid-add ;
+PRIVATE>
 
-: pref-dim-grid ( grid -- dims )
-    grid>> [ [ pref-dim ] map ] map ;
+: grid-child ( grid pair -- gadget ) grid@ nth ;
 
-: (compute-grid) ( grid -- seq ) [ max-dim ] map ;
+: grid-add ( grid child pair -- grid )
+    [ nip grid-child unparent ] [ drop add-gadget ] [ swapd grid@ set-nth ] 3tri ;
 
-: compute-grid ( grid -- horiz vert )
-    pref-dim-grid [ flip (compute-grid) ] [ (compute-grid) ] bi ;
+: grid-remove ( grid pair -- grid ) [ <gadget> ] dip grid-add ;
 
-: (pair-up) ( horiz vert -- dim )
-    [ first ] [ second ] bi* 2array ;
+<PRIVATE
 
-: pair-up ( horiz vert -- dims )
-    [ [ (pair-up) ] curry map ] with map ;
+: cross-zip ( seq1 seq2 -- seq1xseq2 )
+    [ [ 2array ] with map ] curry map ;
 
-: add-gaps ( gap seq -- newseq )
-    [ v+ ] with map ;
+TUPLE: cell pref-dim baseline cap-height ;
 
-: gap-sum ( gap seq -- newseq )
-    dupd add-gaps dim-sum v+ ;
+: <cell> ( gadget -- cell )
+    [ pref-dim ] [ baseline ] [ cap-height ] tri cell boa ;
 
-M: grid pref-dim*
-    dup gap>> swap compute-grid [ over ] dip
-    [ gap-sum ] 2bi@ (pair-up) ;
+M: cell baseline baseline>> ;
 
-: do-grid ( dims grid quot -- )
-    [ grid>> ] dip '[ _ 2each ] 2each ; inline
+M: cell cap-height cap-height>> ;
 
-: grid-positions ( grid dims -- locs )
-    [ gap>> dup ] dip add-gaps swap [ v+ ] accumulate nip ;
+TUPLE: grid-layout grid gap fill? row-heights column-widths ;
 
-: position-grid ( grid horiz vert -- )
-    pick [ [ over ] dip [ grid-positions ] 2bi@ pair-up ] dip
-    [ (>>loc) ] do-grid ;
+: iterate-cell-dims ( cells quot -- seq )
+    '[ [ pref-dim>> @ ] [ max ] map-reduce ] map ; inline
 
-: resize-grid ( grid horiz vert -- )
-    pick fill?>> [
-        pair-up swap [ (>>dim) ] do-grid
-    ] [
-        2drop grid>> [ [ prefer ] each ] each
+: row-heights ( grid-layout -- heights )
+    [ grid>> ] [ fill?>> ] bi
+    [ [ second ] iterate-cell-dims ]
+    [ [ dup [ pref-dim>> ] map measure-height ] map ]
+    if ;
+
+: column-widths ( grid-layout -- widths )
+    grid>> flip [ first ] iterate-cell-dims ;
+
+: <grid-layout> ( grid -- grid-layout )
+    \ grid-layout new
+        swap
+        [ grid>> [ [ <cell> ] map ] map >>grid ]
+        [ fill?>> >>fill? ]
+        [ gap>> >>gap ]
+        tri
+        dup row-heights >>row-heights
+        dup column-widths >>column-widths ;
+
+: accumulate-cell-dims ( seq gap -- n ns )
+    dup '[ + _ + ] accumulate ;
+
+: accumulate-cell-xs ( grid-layout -- x xs )
+    [ column-widths>> ] [ gap>> first ] bi
+    accumulate-cell-dims ;
+
+: accumulate-cell-ys ( grid-layout -- y ys )
+    [ row-heights>> ] [ gap>> second ] bi
+    accumulate-cell-dims ;
+
+: grid-pref-dim ( grid-layout -- dim )
+    [ accumulate-cell-xs drop ]
+    [ accumulate-cell-ys drop ]
+    bi 2array ;
+
+M: grid pref-dim* <grid-layout> grid-pref-dim ;
+
+: (compute-cell-locs) ( grid-layout -- locs )
+    [ accumulate-cell-xs nip ]
+    [ accumulate-cell-ys nip ]
+    bi cross-zip flip ;
+
+: adjust-for-baseline ( row-locs row-cells -- row-locs' )
+    align-baselines [ 0 swap 2array v+ ] 2map ;
+
+: cell-locs ( grid-layout -- locs )
+    dup fill?>>
+    [ (compute-cell-locs) ] [
+        [ (compute-cell-locs) ] [ grid>> ] bi
+        [ adjust-for-baseline ] 2map
     ] if ;
 
-: grid-layout ( grid horiz vert -- )
-    [ position-grid ] 3keep resize-grid ;
+: cell-dims ( grid-layout -- dims )
+    dup fill?>>
+    [ [ column-widths>> ] [ row-heights>> ] bi cross-zip flip ]
+    [ grid>> [ [ pref-dim>> ] map ] map ]
+    if ;
+
+: grid-layout ( children grid-layout -- )
+    [ cell-locs ] [ cell-dims ] bi
+    [ [ <rect> swap set-rect-bounds ] 3each ] 3each ;
 
-M: grid layout* dup compute-grid grid-layout ;
+M: grid layout* [ grid>> ] [ <grid-layout> ] bi grid-layout ;
 
 M: grid children-on ( rect gadget -- seq )
-    dup children>> empty?
-      [ 2drop f ]
-      [
+    dup children>> empty? [ 2drop f ] [
         { 0 1 } swap grid>>
         [ 0 <column> fast-children-on ] keep
         <slice> concat
-      ]
-    if ;
+    ] if ;
 
 M: grid gadget-text*
     grid>>
     [ [ gadget-text ] map ] map format-table
     [ CHAR: \n , ] [ % ] interleave ;
+
+PRIVATE>
\ No newline at end of file
diff --git a/basis/ui/gadgets/icons/authors.txt b/basis/ui/gadgets/icons/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/gadgets/icons/icons.factor b/basis/ui/gadgets/icons/icons.factor
new file mode 100644 (file)
index 0000000..ddadb6b
--- /dev/null
@@ -0,0 +1,12 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel accessors ui.images ui.pens
+ui.pens.image ui.gadgets ;
+IN: ui.gadgets.icons
+
+TUPLE: icon < gadget ;
+
+: <icon> ( image-name -- icon )
+    icon new swap <image-pen> t >>fill? >>interior ;
+
+M: icon pref-dim* dup interior>> pen-pref-dim ;
\ No newline at end of file
index 2b33d2bfe10fd38a7adec7a2d6ba811b310cb3c6..767b1a57b1e26fafe6aaaaa94140b7328a4364c1 100644 (file)
@@ -1,14 +1,15 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: io kernel math namespaces math.vectors ui.gadgets
-ui.gadgets.packs accessors math.geometry.rect ;
+ui.gadgets.private ui.gadgets.packs accessors
+math.rectangles combinators ;
 IN: ui.gadgets.incremental
 
 TUPLE: incremental < pack cursor ;
 
 : <incremental> ( -- incremental )
-    incremental new-gadget
-        { 0 1 } >>orientation
+    incremental new
+        vertical >>orientation
         { 0 0 } >>cursor ;
 
 M: incremental pref-dim*
@@ -18,7 +19,7 @@ M: incremental pref-dim*
 
 : next-cursor ( gadget incremental -- cursor )
     [
-        [ rect-dim ] [ cursor>> ] bi*
+        [ dim>> ] [ cursor>> ] bi*
         [ vmax ] [ v+ ] 2bi
     ] keep orientation>> set-axis ;
 
@@ -29,26 +30,28 @@ M: incremental pref-dim*
     [ cursor>> ] [ orientation>> ] bi v*
     >>loc drop ;
 
-: prefer-incremental ( gadget -- ) USE: slots.private
+: prefer-incremental ( gadget -- )
     dup forget-pref-dim dup pref-dim >>dim drop ;
 
 M: incremental dim-changed drop ;
 
 : add-incremental ( gadget incremental -- )
     not-in-layout
-    2dup swap (add-gadget) drop
+    2dup (add-gadget)
     t in-layout? [
-        over prefer-incremental
-        over layout-later
-        2dup incremental-loc
-        tuck update-cursor
-        dup prefer-incremental
-        parent>> [ invalidate* ] when*
+        {
+            [ drop prefer-incremental ]
+            [ drop layout-later ]
+            [ incremental-loc ]
+            [ update-cursor ]
+            [ nip prefer-incremental ]
+            [ nip parent>> [ invalidate* ] when* ]
+        } 2cleave
     ] with-variable ;
 
 : clear-incremental ( incremental -- )
     not-in-layout
-    dup (clear-gadget)
-    dup forget-pref-dim
-    { 0 0 } >>cursor
-    parent>> [ relayout ] when* ;
+    [ (clear-gadget) ]
+    [ forget-pref-dim ]
+    [ { 0 0 } >>cursor parent>> [ relayout ] when* ]
+    tri ;
diff --git a/basis/ui/gadgets/labeled/authors.txt b/basis/ui/gadgets/labeled/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/basis/ui/gadgets/labeled/labeled-docs.factor b/basis/ui/gadgets/labeled/labeled-docs.factor
new file mode 100644 (file)
index 0000000..831ae2a
--- /dev/null
@@ -0,0 +1,17 @@
+USING: ui.gadgets help.markup help.syntax strings models
+ui.gadgets.panes ;
+IN: ui.gadgets.labeled
+
+HELP: labeled-gadget
+{ $class-description "A labeled gadget can be created by calling " { $link <labeled-gadget> } "." } ;
+
+HELP: <labeled-gadget>
+{ $values { "gadget" gadget } { "title" string } { "newgadget" "a new " { $link <labeled-gadget> } } }
+{ $description "Creates a new " { $link labeled-gadget } " display " { $snippet "gadget" } " with " { $snippet "title" } " on top." } ;
+
+ARTICLE: "ui.gadgets.labeled" "Labeled gadgets"
+"The " { $vocab-link "ui.gadgets.labeled" } " vocabulary implements labeled borders around child gadgets."
+{ $subsection labeled-gadget }
+{ $subsection <labeled-gadget> } ;
+
+ABOUT: "ui.gadgets.labeled"
diff --git a/basis/ui/gadgets/labeled/labeled.factor b/basis/ui/gadgets/labeled/labeled.factor
new file mode 100644 (file)
index 0000000..319fd8c
--- /dev/null
@@ -0,0 +1,68 @@
+! Copyright (C) 2006, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors kernel sequences colors fonts ui.gadgets
+ui.gadgets.frames ui.gadgets.grids ui.gadgets.icons ui.gadgets.labels
+ui.gadgets.borders ui.pens.image ;
+IN: ui.gadgets.labeled
+
+TUPLE: labeled-gadget < frame content ;
+
+<PRIVATE
+
+CONSTANT: @center { 1 1 }
+CONSTANT: @left { 0 1 }
+CONSTANT: @right { 2 1 }
+CONSTANT: @top { 1 0 }
+CONSTANT: @bottom { 1 2 }
+
+CONSTANT: @top-left { 0 0 }
+CONSTANT: @top-right { 2 0 }
+CONSTANT: @bottom-left { 0 2 }
+CONSTANT: @bottom-right { 2 2 }
+
+: labeled-image ( name -- image )
+    "labeled-block-" prepend theme-image ;
+
+: labeled-icon ( name -- icon )
+    labeled-image <icon> ;
+
+CONSTANT: labeled-title-background
+    T{ rgba f
+        0.7843137254901961
+        0.7686274509803922
+        0.7176470588235294
+        1.0
+    }
+
+: <labeled-title> ( gadget -- label )
+    >label
+    [ labeled-title-background font-with-background ] change-font
+    { 0 2 } <border>
+    "title-middle" labeled-image
+    <image-pen> t >>fill? >>interior ;
+
+: /-FOO-\ ( title labeled -- labeled )
+    "title-left" labeled-icon @top-left grid-add
+    swap <labeled-title> @top grid-add
+    "title-right" labeled-icon @top-right grid-add ;
+
+: |-----| ( gadget labeled -- labeled )
+    "left-edge" labeled-icon @left grid-add
+    swap [ >>content ] [ @center grid-add ] bi
+    "right-edge" labeled-icon @right grid-add ;
+
+: \-----/ ( labeled -- labeled )
+    "bottom-left" labeled-icon @bottom-left grid-add
+    "bottom-middle" labeled-icon @bottom grid-add
+    "bottom-right" labeled-icon @bottom-right grid-add ;
+
+M: labeled-gadget focusable-child* content>> ;
+
+PRIVATE>
+
+: <labeled-gadget> ( gadget title -- newgadget )
+    3 3 labeled-gadget new-frame
+        { 1 1 } >>filled-cell
+        /-FOO-\
+        |-----|
+        \-----/ ;
diff --git a/basis/ui/gadgets/labeled/summary.txt b/basis/ui/gadgets/labeled/summary.txt
new file mode 100644 (file)
index 0000000..6f7ffe6
--- /dev/null
@@ -0,0 +1 @@
+Labelled gadgets display a border with a text label surrounding a child
diff --git a/basis/ui/gadgets/labelled/authors.txt b/basis/ui/gadgets/labelled/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/ui/gadgets/labelled/labelled-docs.factor b/basis/ui/gadgets/labelled/labelled-docs.factor
deleted file mode 100644 (file)
index 4ad14ab..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-USING: ui.gadgets help.markup help.syntax strings models
-ui.gadgets.panes ;
-IN: ui.gadgets.labelled
-
-HELP: labelled-gadget
-{ $class-description "A labelled gadget can be created by calling " { $link <labelled-gadget> } "." } ;
-
-HELP: <labelled-gadget>
-{ $values { "gadget" gadget } { "title" string } { "newgadget" "a new " { $link <labelled-gadget> } } }
-{ $description "Creates a new " { $link labelled-gadget } " display " { $snippet "gadget" } " with " { $snippet "title" } " on top." } ;
-
-HELP: closable-gadget
-{ $class-description "A closable gadget displays a title bar with a close box on top of another gadget. Clicking the close box invokes a quotation. Closable gadgets are created by calling " { $link <closable-gadget> } "." } ;
-
-HELP: <closable-gadget>
-{ $values { "gadget" gadget } { "title" string } { "quot" { $quotation "( button -- )" } } }
-{ $description "Creates a new " { $link closable-gadget } ". Clicking the close box calls " { $snippet "quot" } "." }
-{ $notes "The quotation can find the " { $link closable-gadget } " instance, or any other parent gadget by calling " { $link find-parent } " with the gadget it receives on the stack." } ;
-
-HELP: <labelled-pane>
-{ $values { "model" model } { "quot" { $quotation "( value -- )" } } { "scrolls?" "a boolean" } { "title" string } { "gadget" "a new " { $link gadget } } }
-{ $description "Creates a new control delegating to a " { $link pane } ", and wraps it in a " { $link labelled-gadget } ". When the value of the model changes, the value is pushed on the stack and the quotation is called using " { $link with-pane } "." } ;
-
-{ <labelled-pane> <pane-control> } related-words
-
-ARTICLE: "ui.gadgets.labelled" "Labelled gadgets"
-"It is possible to create a labelled border around a child gadget:"
-{ $subsection labelled-gadget }
-{ $subsection <labelled-gadget> }
-"Or a labelled border with a close box:"
-{ $subsection closable-gadget }
-{ $subsection <closable-gadget> } ;
-
-ABOUT: "ui.gadgets.labelled"
diff --git a/basis/ui/gadgets/labelled/labelled.factor b/basis/ui/gadgets/labelled/labelled.factor
deleted file mode 100644 (file)
index 636e25c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: arrays ui.gadgets.buttons ui.gadgets.borders
-ui.gadgets.labels ui.gadgets.panes ui.gadgets.scrollers
-ui.gadgets.tracks ui.gadgets.theme ui.gadgets.frames
-ui.gadgets.grids io kernel math models namespaces
-sequences sequences words classes.tuple ui.gadgets ui.render
-colors accessors ;
-IN: ui.gadgets.labelled
-
-TUPLE: labelled-gadget < track content ;
-
-: <labelled-gadget> ( gadget title -- newgadget )
-    { 0 1 } labelled-gadget new-track
-        swap <label> reverse-video-theme f track-add
-        swap >>content
-        dup content>> 1 track-add ;
-
-M: labelled-gadget focusable-child* content>> ;
-
-: <labelled-scroller> ( gadget title -- gadget )
-    [ <scroller> ] dip <labelled-gadget> ;
-
-: <labelled-pane> ( model quot scrolls? title -- gadget )
-    [ [ <pane-control> ] dip >>scrolls? ] dip
-    <labelled-scroller> ;
-
-: <close-box> ( quot -- button/f )
-    gray close-box <polygon-gadget> swap <bevel-button> ;
-
-: title-theme ( gadget -- gadget )
-    { 1 0 } >>orientation
-    {
-        T{ rgba f 0.65 0.65 1.0 1.0 }
-        T{ rgba f 0.65 0.45 1.0 1.0 }
-    } <gradient> >>interior ;
-
-: <title-label> ( text -- label ) <label> title-theme ;
-
-: <title-bar> ( title quot -- gadget )
-    <frame>
-        swap [ <close-box> @left grid-add ] when*
-        swap <title-label> @center grid-add ;
-
-TUPLE: closable-gadget < frame content ;
-
-: find-closable-gadget ( parent -- child )
-    [ closable-gadget? ] find-parent ;
-
-: <closable-gadget> ( gadget title quot -- gadget )
-    [
-        [ closable-gadget new-frame ] dip
-        [ >>content ] [ @center grid-add ] bi
-    ] 2dip
-    <title-bar> @top grid-add ;
-    
-M: closable-gadget focusable-child* content>> ;
diff --git a/basis/ui/gadgets/labelled/summary.txt b/basis/ui/gadgets/labelled/summary.txt
deleted file mode 100644 (file)
index 6f7ffe6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Labelled gadgets display a border with a text label surrounding a child
index 8a63900d4d1220b1e1aa12f8528a567100e6296a..066a79b90009220075e65dc33be61e2c52513db5 100644 (file)
@@ -8,28 +8,19 @@ HELP: <label>
 { $values { "string" string } { "label" "a new " { $link label } } }
 { $description "Creates a new " { $link label } " gadget. The string is permitted to contain line breaks." } ;
 
-HELP: label-string
-{ $values { "label" label } { "string" string } }
-{ $description "Outputs the string currently displayed by the label." } ;
-
-HELP: set-label-string
-{ $values { "label" label } { "string" string } }
-{ $description "Sets the string currently displayed by the label. The string is permitted to contain line breaks. After calling this word, you must also call " { $link relayout } " on the label." } ;
-
 HELP: <label-control>
 { $values { "model" model } { "gadget" "a new " { $link gadget } } }
 { $description "Creates a control which displays the value of " { $snippet "model" } ", which is required to be a string. The label control is automatically updated when the model value changes." } ;
 
-{ label-string set-label-string } related-words
 { <label> <label-control> } related-words
 
 ARTICLE: "ui.gadgets.labels" "Label gadgets"
-"A label displays a piece of text, either a single line string or an array of line strings."
+"The " { $vocab-link "ui.gadgets.labels" } " vocabulary implements labels. A label displays a piece of text, which is either a single line string or an array of line strings."
 { $subsection label }
 { $subsection <label> }
 { $subsection <label-control> }
-{ $subsection label-string }
-{ $subsection set-label-string }
+"Labels have a virtual slot named " { $slot "string" } " which contains the displayed text. The " { $slot "text" } " slot should not be set directly."
+$nl
 "Label specifiers are used by buttons, checkboxes and radio buttons:"
 { $subsection >label } ;
 
index eff3c6f7bb892e23cc5e531ed8fe04346d39b12c..eb992f1428b376bdaf99c2a127dedff54c9fad85 100644 (file)
@@ -1,56 +1,95 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays hashtables io kernel math namespaces
-make opengl sequences strings splitting ui.gadgets
-ui.gadgets.tracks ui.gadgets.theme ui.render colors models ;
+USING: accessors arrays hashtables io kernel math math.functions
+namespaces make opengl sequences strings splitting ui.gadgets
+ui.gadgets.tracks ui.gadgets.packs fonts ui.render ui.pens.solid
+ui.baseline-alignment ui.text colors colors.constants models
+combinators ;
 IN: ui.gadgets.labels
 
 ! A label gadget draws a string.
-TUPLE: label < gadget text font color ;
+TUPLE: label < gadget text font ;
 
-: label-string ( label -- string )
+SLOT: string
+
+M: label string>> ( label -- string )
     text>> dup string? [ "\n" join ] unless ; inline
 
-: set-label-string ( string label -- )
-    [ CHAR: \n over memq? [ string-lines ] when ] dip (>>text) ; inline
+<PRIVATE
+
+PREDICATE: string-array < array [ string? ] all? ;
+
+PRIVATE>
+
+: ?string-lines ( string -- string/array )
+    CHAR: \n over memq? [ string-lines ] when ;
+
+ERROR: not-a-string object ;
+
+M: label (>>string) ( string label -- )
+    [
+        {
+            { [ dup string-array? ] [ ] }
+            { [ dup string? ] [ ?string-lines ] }
+            [ not-a-string ]
+        } cond
+    ] dip (>>text) ; inline
 
 : label-theme ( gadget -- gadget )
-    sans-serif-font >>font
-    black >>color ; inline
+    sans-serif-font >>font ; inline
 
 : new-label ( string class -- label )
-    new-gadget
-    [ set-label-string ] keep
+    new
+    swap >>string
     label-theme ; inline
 
 : <label> ( string -- label )
     label new-label ;
 
+: >label< ( label -- font text )
+    [ font>> ] [ text>> ] bi ;
+
 M: label pref-dim*
-    [ font>> open-font ] [ text>> ] bi text-dim ;
+    >label< text-dim ;
+
+<PRIVATE
+
+: label-metrics ( label -- metrics )
+    >label< dup string? [ first ] unless line-metrics ;
+
+PRIVATE>
+
+M: label baseline
+    label-metrics ascent>> round ;
+
+M: label cap-height
+    label-metrics cap-height>> round ;
 
 M: label draw-gadget*
-    [ color>> gl-color ]
-    [ [ font>> ] [ text>> ] bi origin get draw-text ] bi ;
+    >label<
+    [
+        background get [ font-with-background ] when*
+        foreground get [ font-with-foreground ] when*
+    ] dip
+    draw-text ;
 
-M: label gadget-text* label-string % ;
+M: label gadget-text* string>> % ;
 
 TUPLE: label-control < label ;
 
 M: label-control model-changed
-    swap value>> over set-label-string relayout ;
+    swap value>> >>string relayout ;
 
 : <label-control> ( model -- gadget )
     "" label-control new-label
         swap >>model ;
 
 : text-theme ( gadget -- gadget )
-    black >>color
     monospace-font >>font ;
 
 : reverse-video-theme ( label -- label )
-    white >>color
-    black solid-interior ;
+    sans-serif-font reverse-video-font >>font
+    COLOR: black <solid> >>interior ;
 
 GENERIC: >label ( obj -- gadget )
 M: string >label <label> ;
@@ -58,12 +97,21 @@ M: array >label <label> ;
 M: object >label ;
 M: f >label drop <gadget> ;
 
+<PRIVATE
+
+: label-on-left/right ( -- track )
+    horizontal <track>
+        0 >>fill
+        +baseline+ >>align
+        { 5 5 } >>gap ; inline
+PRIVATE>
+
 : label-on-left ( gadget label -- button )
-    { 1 0 } <track>
+    label-on-left/right
         swap >label f track-add
         swap 1 track-add ;
 
 : label-on-right ( label gadget -- button )
-    { 1 0 } <track>
+    label-on-left/right
         swap f track-add
         swap >label 1 track-add ;
diff --git a/basis/ui/gadgets/line-support/authors.txt b/basis/ui/gadgets/line-support/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/gadgets/line-support/line-support-docs.factor b/basis/ui/gadgets/line-support/line-support-docs.factor
new file mode 100644 (file)
index 0000000..164f8d3
--- /dev/null
@@ -0,0 +1,29 @@
+IN: ui.gadgets.line-support
+USING: help.markup help.syntax ;
+
+ARTICLE: "ui.gadgets.line-support" "Gadget line support"
+"The " { $vocab-link "ui.gadgets.line-support" } " vocabulary provides common code shared by gadgets which display a sequence of lines of text. Currently, the two gadgets that use it are " { $link "ui.gadgets.editors" } " and " { $link "ui.gadgets.tables" } "."
+$nl
+"The class of line gadgets:"
+{ $subsection line-gadget }
+{ $subsection line-gadget? }
+"Line gadgets are backed by a model which must be a sequence. The number of lines in the gadget is the length of the sequence."
+$nl
+"Line gadgets cannot be created and used directly, instead a subclass must be defined:"
+{ $subsection new-line-gadget }
+"Subclasses must implement a generic word:"
+{ $subsection draw-line }
+"Two optional generic words may be implemented; if they are not implemented in the subclass, a default implementation based on font metrics will be used:"
+{ $subsection line-height }
+{ $subsection line-leading }
+"Validating line numbers:"
+{ $subsection validate-line }
+"Working with visible lines:"
+{ $subsection visible-lines }
+{ $subsection first-visible-line }
+{ $subsection last-visible-line }
+"Converting y co-ordinates to line numbers, and vice versa:"
+{ $subsection line>y }
+{ $subsection y>line } ;
+
+ABOUT: "ui.gadgets.line-support"
\ No newline at end of file
diff --git a/basis/ui/gadgets/line-support/line-support-tests.factor b/basis/ui/gadgets/line-support/line-support-tests.factor
new file mode 100644 (file)
index 0000000..4849521
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.gadgets.line-support ;
+IN: ui.gadgets.line-support.tests
diff --git a/basis/ui/gadgets/line-support/line-support.factor b/basis/ui/gadgets/line-support/line-support.factor
new file mode 100644 (file)
index 0000000..80feb31
--- /dev/null
@@ -0,0 +1,85 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays combinators fry kernel math math.functions math.order
+math.ranges math.vectors namespaces opengl sequences ui.gadgets
+ui.render ui.text ui.gadgets.scrollers ui.gadgets.viewports ;
+IN: ui.gadgets.line-support
+
+! Some code shared by table and editor gadgets
+TUPLE: line-gadget < gadget
+font selection-color
+min-rows max-rows
+min-cols max-cols ;
+
+: new-line-gadget ( class -- gadget )
+    new
+        selection-color >>selection-color ;
+
+GENERIC: line-leading ( gadget -- n )
+
+M: line-gadget line-leading font>> font-metrics leading>> ;
+
+GENERIC: line-height ( gadget -- n )
+
+M: line-gadget line-height font>> font-metrics height>> ceiling ;
+
+: y>line ( y gadget -- n ) line-height /i ;
+
+: line>y ( n gadget -- y ) line-height * >integer ;
+
+: validate-line ( m gadget -- n )
+    control-value [ drop f ] [ length 1- min 0 max ] if-empty ;
+
+: visible-line ( gadget quot -- n )
+    '[
+        [ clip get @ origin get [ second ] bi@ - ] dip
+        y>line
+    ] keep validate-line ; inline
+
+: first-visible-line ( gadget -- n )
+    [ loc>> ] visible-line ;
+
+: last-visible-line ( gadget -- n )
+    [ [ loc>> ] [ dim>> ] bi v+ ] visible-line 1+ ;
+
+: each-slice-index ( from to seq quot -- )
+    [ [ <slice> ] [ drop [a,b) ] 3bi ] dip 2each ; inline
+
+GENERIC: draw-line ( line index gadget -- )
+
+: draw-lines ( gadget -- )
+    {
+        [ first-visible-line ]
+        [ last-visible-line ]
+        [ control-value ]
+        [ line-height ]
+        [ ]
+    } cleave '[
+        0 over _ * >integer 2array
+        [ _ draw-line ] with-translation
+    ] each-slice-index ;
+
+<PRIVATE
+
+: clamp ( dim unit min max -- dim' )
+    [ -1/0. or * ] [ 1/.0 or * ] bi-curry* bi
+    [ max ] [ min ] bi* ;
+
+: em ( font -- x ) "m" text-width ;
+
+PRIVATE>
+
+: line-gadget-width ( pref-dim gadget -- w )
+    [ first ] [ [ font>> em ] [ min-cols>> ] [ max-cols>> ] tri ] bi* clamp ;
+
+: line-gadget-height ( pref-dim gadget -- h )
+    [ second ] [ [ line-height ] [ min-rows>> ] [ max-rows>> ] tri ] bi* clamp ;
+
+M: line-gadget pref-viewport-dim
+    [ pref-dim ] keep
+    [ line-gadget-width ]
+    [ line-gadget-height ]
+    2bi 2array ;
+
+: visible-lines ( gadget -- n )
+    [ visible-dim second ] [ line-height ] bi /i ;
\ No newline at end of file
diff --git a/basis/ui/gadgets/line-support/summary.txt b/basis/ui/gadgets/line-support/summary.txt
new file mode 100644 (file)
index 0000000..90ecc38
--- /dev/null
@@ -0,0 +1 @@
+Code shared between table and editor gadgets
diff --git a/basis/ui/gadgets/lists/authors.txt b/basis/ui/gadgets/lists/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/ui/gadgets/lists/lists-docs.factor b/basis/ui/gadgets/lists/lists-docs.factor
deleted file mode 100644 (file)
index 6341e09..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-USING: ui.commands help.markup help.syntax ui.gadgets
-ui.gadgets.presentations ui.operations kernel models classes ;
-IN: ui.gadgets.lists
-
-HELP: +secondary+
-{ $description "A key which may be set in the hashtable passed to " { $link define-operation } ". If set to a true value, this operation becomes the default operation performed when " { $snippet "RET" } " is pressed in a " { $link list } " gadget where the current selection is a presentation matching the operation's predicate." } ;
-
-HELP: list
-{ $class-description
-    "A list control is backed by a " { $link model } " holding a sequence of objects, and displays as a list of " { $link presentation } " instances of these objects."
-    $nl
-    "Lists are created by calling " { $link <list> } "."
-    { $command-map list "keyboard-navigation" }
-} ;
-
-HELP: <list>
-{ $values { "hook" { $quotation "( list -- )" } } { "presenter" { $quotation "( object -- label )" } } { "model" model } { "gadget" list } }
-{ $description "Creates a new " { $link list } "."
-$nl
-"The model value must be a sequence. The list displays presentations of elements with labels obtained by applying the " { $snippet "presenter" } " quotation to each object. The " { $snippet "hook" } " quotation is called when a presentation is selected." } ;
-
-HELP: list-value
-{ $values { "list" list } { "object" object } }
-{ $description "Outputs the currently selected list value." } ;
-
-ARTICLE: "ui.gadgets.lists" "List gadgets"
-"A list displays a list of presentations."
-{ $subsection list }
-{ $subsection <list> }
-{ $subsection list-value } ;
-
-ABOUT: "ui.gadgets.lists"
diff --git a/basis/ui/gadgets/lists/lists-tests.factor b/basis/ui/gadgets/lists/lists-tests.factor
deleted file mode 100644 (file)
index bf2ad72..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-IN: ui.gadgets.lists.tests
-USING: ui.gadgets.lists models prettyprint math tools.test
-kernel ;
-
-[ ] [ [ drop ] [ 3 + . ] f <model> <list> invoke-value-action ] unit-test
diff --git a/basis/ui/gadgets/lists/lists.factor b/basis/ui/gadgets/lists/lists.factor
deleted file mode 100644 (file)
index 0113e19..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors ui.commands ui.gestures ui.render ui.gadgets
-ui.gadgets.labels ui.gadgets.scrollers
-kernel sequences models opengl math math.order namespaces
-ui.gadgets.presentations ui.gadgets.viewports ui.gadgets.packs
-math.vectors classes.tuple math.geometry.rect colors ;
-
-IN: ui.gadgets.lists
-
-TUPLE: list < pack index presenter color hook ;
-
-: list-theme ( list -- list )
-    T{ rgba f 0.8 0.8 1.0 1.0 } >>color ; inline
-
-: <list> ( hook presenter model -- gadget )
-    list new-gadget
-        { 0 1 } >>orientation
-        1 >>fill
-        0 >>index
-        swap >>model
-        swap >>presenter
-        swap >>hook
-        list-theme ;
-
-: calc-bounded-index ( n list -- m )
-    control-value length 1- min 0 max ;
-
-: bound-index ( list -- )
-    dup index>> over calc-bounded-index >>index drop ;
-
-: list-presentation-hook ( list -- quot )
-    hook>> [ [ list? ] find-parent ] prepend ;
-
-: <list-presentation> ( hook elt presenter -- gadget )
-    keep [ >label text-theme ] dip
-    <presentation>
-    swap >>hook ; inline
-
-: <list-items> ( list -- seq )
-    [ list-presentation-hook ]
-    [ presenter>> ]
-    [ control-value ]
-    tri [
-        [ 2dup ] dip swap <list-presentation>
-    ] map 2nip ;
-
-M: list model-changed
-    nip
-    dup clear-gadget
-    dup <list-items> add-gadgets
-    bound-index ;
-
-: selected-rect ( list -- rect )
-    dup index>> swap children>> ?nth ;
-
-M: list draw-gadget*
-    origin get [
-        dup color>> gl-color
-        selected-rect [
-            dup loc>> [
-                dim>> gl-fill-rect
-            ] with-translation
-        ] when*
-    ] with-translation ;
-
-M: list focusable-child* drop t ;
-
-: list-value ( list -- object )
-    dup index>> swap control-value ?nth ;
-
-: scroll>selected ( list -- )
-    #! We change the rectangle's width to zero to avoid
-    #! scrolling right.
-    [ selected-rect rect-bounds { 0 1 } v* <rect> ] keep
-    scroll>rect ;
-
-: list-empty? ( list -- ? ) control-value empty? ;
-
-: select-index ( n list -- )
-    dup list-empty? [
-        2drop
-    ] [
-        [ control-value length rem ] keep
-        swap >>index
-        dup relayout-1
-        scroll>selected
-    ] if ;
-
-: select-previous ( list -- )
-    dup index>> 1- swap select-index ;
-
-: select-next ( list -- )
-    dup index>> 1+ swap select-index ;
-
-: invoke-value-action ( list -- )
-    dup list-empty? [
-        dup hook>> call
-    ] [
-        dup index>> swap nth-gadget invoke-secondary
-    ] if ;
-
-: select-gadget ( gadget list -- )
-    tuck children>> index
-    [ swap select-index ] [ drop ] if* ;
-
-: clamp-loc ( point max -- point )
-    vmin { 0 0 } vmax ;
-
-: select-at ( point list -- )
-    [ rect-dim clamp-loc ] keep
-    [ pick-up ] keep
-    select-gadget ;
-
-: list-page ( list vec -- )
-    [ dup selected-rect rect-bounds 2 v/n v+ over visible-dim ] dip
-    v* v+ swap select-at ;
-
-: list-page-up ( list -- ) { 0 -1 } list-page ;
-
-: list-page-down ( list -- ) { 0 1 } list-page ;
-
-list "keyboard-navigation" "Lists can be navigated from the keyboard." {
-    { T{ button-down } request-focus }
-    { T{ key-down f f "UP" } select-previous }
-    { T{ key-down f f "DOWN" } select-next }
-    { T{ key-down f f "PAGE_UP" } list-page-up }
-    { T{ key-down f f "PAGE_DOWN" } list-page-down }
-    { T{ key-down f f "RET" } invoke-value-action }
-} define-command-map
diff --git a/basis/ui/gadgets/lists/summary.txt b/basis/ui/gadgets/lists/summary.txt
deleted file mode 100644 (file)
index f0b84e7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-List gadgets display a keyboard-navigatable list of presentations
index c482f31896241138c7adac8e89ba97d31a9204f4..a0038b55e5e5bd493f619d78e60ccf7b3a850500 100644 (file)
@@ -1,62 +1,61 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: locals accessors arrays ui.commands ui.operations ui.gadgets
-ui.gadgets.buttons ui.gadgets.worlds ui.gestures generic
-hashtables kernel math models namespaces opengl sequences
-math.vectors ui.gadgets.theme ui.gadgets.packs
-ui.gadgets.borders colors math.geometry.rect ;
+USING: colors.constants kernel locals math.rectangles
+namespaces sequences ui.commands ui.gadgets ui.gadgets.borders
+ui.gadgets.buttons ui.gadgets.glass ui.gadgets.packs
+ui.gadgets.worlds ui.gestures ui.operations ui.pens ui.pens.solid
+opengl math.vectors words accessors math math.order sorting ;
 IN: ui.gadgets.menus
 
-: menu-loc ( world menu -- loc )
-    [ rect-dim ] [ pref-dim ] bi* [v-] hand-loc get-global vmin ;
+: show-menu ( owner menu -- )
+    [ find-world ] dip hand-loc get { 0 0 } <rect> show-glass ;
 
-TUPLE: menu-glass < gadget ;
+GENERIC: <menu-item> ( target hook command -- button )
 
-: <menu-glass> ( world menu -- glass )
-    tuck menu-loc >>loc
-    menu-glass new-gadget
-    swap add-gadget ;
+M:: object <menu-item> ( target hook command -- button )
+    command command-name [
+        hook call
+        target command command-button-quot call
+        hide-glass
+    ] <roll-button> ;
 
-M: menu-glass layout* gadget-child prefer ;
+<PRIVATE
 
-: hide-glass ( world -- )
-    [ [ unparent ] when* f ] change-glass drop ;
+TUPLE: separator-pen color ;
 
-: show-glass ( world gadget -- )
-    [ [ hide-glass ] [ hand-clicked set-global ] bi* ]
-    [ add-gadget drop ]
-    [ >>glass drop ]
-    2tri ;
+C: <separator-pen> separator-pen
 
-: show-menu ( owner menu -- )
-    [ find-world dup ] dip <menu-glass> show-glass ;
+M: separator-pen draw-interior
+    color>> gl-color
+    dim>> [ { 0 0.5 } v* ] [ { 1 0.5 } v* ] bi
+    [ [ >integer ] map ] bi@ gl-line ;
 
-\ menu-glass H{
-    { T{ button-down } [ find-world [ hide-glass ] when* ] }
-    { T{ drag } [ update-clicked drop ] }
-} set-gestures
+PRIVATE>
 
-:: <menu-item> ( target hook command -- button )
-    command command-name [
-        hook call
-        target command command-button-quot call
-        hand-clicked get find-world hide-glass
-    ] <roll-button> ;
+SINGLETON: ----
+
+M: ---- <menu-item>
+    3drop
+    <gadget>
+        { 0 5 } >>dim
+        COLOR: black <separator-pen> >>interior ;
 
 : menu-theme ( gadget -- gadget )
-    light-gray solid-interior
-    faint-boundary ;
+    COLOR: light-gray <solid> >>interior ;
 
 : <commands-menu> ( target hook commands -- menu )
     [ <filled-pile> ] 3dip
     [ <menu-item> add-gadget ] with with each
-    5 <border> menu-theme ;
+    { 5 5 } <border> menu-theme ;
 
 : show-commands-menu ( target commands -- )
     [ dup [ ] ] dip <commands-menu> show-menu ;
 
 : <operations-menu> ( target hook -- menu )
-    over object-operations <commands-menu> ;
+    over object-operations
+    [ primary-operation? ] partition
+    [ reverse ] [ [ [ command-name ] compare ] sort ] bi*
+    { ---- } glue <commands-menu> ;
 
-: show-operations-menu ( gadget target -- )
-    [ ] <operations-menu> show-menu ;
\ No newline at end of file
+: show-operations-menu ( gadget target hook -- )
+    <operations-menu> show-menu ;
\ No newline at end of file
index 14a229067b25e2e94a51101648264769e10c2f95..938a8bf74073f4f468f11174cacd54bfd4fda0cf 100644 (file)
@@ -1,5 +1,6 @@
 USING: ui.gadgets help.markup help.syntax generic kernel
-classes.tuple quotations ;
+classes.tuple quotations ui.gadgets.packs.private
+ui.baseline-alignment ;
 IN: ui.gadgets.packs
 
 ARTICLE: "ui-pack-layout" "Pack layouts"
@@ -23,7 +24,7 @@ HELP: pack
 }
 "Packs have the following slots:"
 { $list
-    { { $snippet "align" } " a rational number between 0 and 1, the alignment of gadgets along the axis perpendicular to the pack's orientation" }
+    { { $snippet "align" } " a rational number between 0 and 1, or " { $link +baseline+ } "; the alignment of gadgets along the axis perpendicular to the pack's orientation" }
     { { $snippet "fill" } " a rational number between 0 and 1, where 0 gives each gadget its preferred size and 1 fills the dimension perpendicular to the pack's orientation" }
     { { $snippet "gap" } " a pair of integers, the horizontal and vertical gap between children" }
 }
@@ -38,7 +39,7 @@ HELP: pack-layout
 
 HELP: <pack>
 { $values { "orientation" "an orientation specifier" } { "pack" "a new " { $link pack } } }
-{ $description "Creates a new pack which lays out children along the given axis. Children are laid out vertically if the orientation is " { $snippet "{ 0 1 }" } " and horizontally if the orientation is " { $snippet "{ 1 0 }" } "." } ;
+{ $description "Creates a new pack which lays out children with the given orientation, either " { $link horizontal } " or " { $link vertical } "." } ;
 
 { <pack> <pile> <shelf> } related-words
 
@@ -51,7 +52,7 @@ HELP: <shelf>
 { $description "Creates a new " { $link pack } " which lays out its children horizontally." } ;
 
 HELP: pack-pref-dim
-{ $values { "gadget" gadget } { "sizes" "a sequence of pairs of integers" } { "dim" "a pair of integers" } }
+{ $values { "pack" pack } { "sizes" "a sequence of pairs of integers" } { "dim" "a pair of integers" } }
 { $description "Computes the preferred size of a pack, with each gadget receiving its size from the corresponding index of the " { $snippet "sizes" } " sequence." }
 { $notes
     "This word is useful if you are writing your own layout gadget which inherits from " { $link pack } ". This allows you to reuse layout logic while computing gadget sizes using a custom procedure."
index 8b52a2ad2fbee5fb31be319c5d41c8dfb8f7880a..cae7d12dc3feae0396edfaafcae67ecb2859de3f 100644 (file)
@@ -1,13 +1,14 @@
+USING: ui.gadgets.packs ui.gadgets.packs.private
+ui.gadgets.labels ui.gadgets ui.gadgets.debug ui.render
+ui.baseline-alignment kernel namespaces tools.test math.parser
+sequences math.rectangles accessors ;
 IN: ui.gadgets.packs.tests
-USING: ui.gadgets.packs ui.gadgets.labels ui.gadgets ui.render
-kernel namespaces tools.test math.parser sequences math.geometry.rect
-accessors ;
 
 [ t ] [
     { 0 0 } { 100 100 } <rect> clip set
 
     <pile>
-      100 [ number>string <label> add-gadget ] each
+        100 [ number>string <label> add-gadget ] each
     dup layout
 
     visible-children [ label? ] all?
@@ -16,6 +17,77 @@ accessors ;
 [ { { 10 30 } } ] [
     { { 10 20 } }
     { { 100 30 } }
-    <gadget> { 0 1 } >>orientation
+    <gadget> vertical >>orientation
     orient
 ] unit-test
+
+! Test baseline alignment
+<shelf> +baseline+ >>align
+    5 5 { 10 10 } <baseline-gadget> add-gadget
+    10 10 { 10 10 } <baseline-gadget> add-gadget
+"g" set
+
+[ ] [ "g" get prefer ] unit-test
+
+[ { 20 15 } ] [ "g" get dim>> ] unit-test
+
+[ V{ { 0 5 } { 10 0 } } ] [
+    "g" get
+    dup layout
+    children>> [ loc>> ] map
+] unit-test
+
+! Test mixed baseline and ordinary alignment
+<shelf> +baseline+ >>align
+    <gadget> { 20 20 } >>dim add-gadget
+    10 10 { 10 10 } <baseline-gadget> add-gadget
+"g" set
+
+[ { 30 20 } ] [ "g" get pref-dim ] unit-test
+
+[ ] [ "g" get layout ] unit-test
+
+[ V{ { 0 0 } { 20 5 } } ] [
+    "g" get children>> [ loc>> ] map
+] unit-test
+
+<shelf> +baseline+ >>align
+    <gadget> { 15 15 } >>dim add-gadget
+    5 5 { 10 10 } <baseline-gadget> add-gadget
+"g" set
+
+[ { 25 15 } ] [ "g" get pref-dim ] unit-test
+
+[ ] [ "g" get prefer ] unit-test
+
+[ ] [ "g" get layout ] unit-test
+
+[ V{ { 0 0 } { 15 5 } } ] [
+    "g" get children>> [ loc>> ] map
+] unit-test
+
+<shelf> +baseline+ >>align
+    <gadget> { 20 20 } >>dim add-gadget
+    30 30 { 10 50 } <baseline-gadget> add-gadget
+"g" set
+
+[ { 30 50 } ] [ "g" get pref-dim ] unit-test
+
+[ ] [ "g" get prefer ] unit-test
+
+[ ] [ "g" get layout ] unit-test
+
+[ V{ { 0 5 } { 20 0 } } ] [
+    "g" get children>> [ loc>> ] map
+] unit-test
+
+<shelf> +baseline+ >>align
+    <gadget> { 30 30 } >>dim add-gadget
+    30 4 { 30 30 } <baseline-gadget> add-gadget
+"g" set
+
+[ { 60 43 } ] [ "g" get pref-dim ] unit-test
+
+[ ] [ "g" get prefer ] unit-test
+
+[ ] [ "g" get layout ] unit-test
\ No newline at end of file
index 86dc6ea354f92d384004377abb41fc4d42c5fbb1..95f04dfe4dc13c1f29c8839a6e7848503fa52aa8 100644 (file)
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: sequences ui.gadgets kernel math math.functions
-math.vectors math.order math.geometry.rect namespaces accessors
-fry ;
+USING: sequences ui.gadgets ui.baseline-alignment kernel math
+math.functions math.vectors math.order math.rectangles namespaces
+accessors fry combinators arrays ;
 IN: ui.gadgets.packs
 
 TUPLE: pack < gadget
 { align initial: 0 } { fill initial: 0 } { gap initial: { 0 0 } } ;
 
-: packed-dim-2 ( gadget sizes -- list )
+<PRIVATE
+
+: (packed-dims) ( gadget sizes -- list )
     swap [ dim>> ] [ fill>> ] bi '[ _ over v- _ v*n v+ ] map ;
 
 : orient ( seq1 seq2 gadget -- seq )
     orientation>> '[ _ set-axis ] 2map ;
 
 : packed-dims ( gadget sizes -- seq )
-    [ packed-dim-2 ] [ nip ] [ drop ] 2tri orient ;
+    [ (packed-dims) ] [ nip ] [ drop ] 2tri orient ;
+
+: gap-locs ( sizes gap -- seq )
+    [ { 0 0 } ] dip '[ v+ _ v+ ] accumulate nip ;
+
+: numerically-aligned-locs ( sizes pack -- seq )
+    [ align>> ] [ dim>> ] bi '[ [ _ _ ] dip v- [ * >integer ] with map ] map ;
 
-: gap-locs ( gap sizes -- seq )
-    { 0 0 } [ v+ over v+ ] accumulate 2nip ;
+: baseline-aligned-locs ( pack -- seq )
+    children>> align-baselines [ 0 swap 2array ] map ;
 
-: aligned-locs ( gadget sizes -- seq )
-    [ [ [ align>> ] [ dim>> ] bi ] dip v- n*v ] with map ;
+: aligned-locs ( sizes pack -- seq )
+    dup align>> +baseline+ eq?
+    [ nip baseline-aligned-locs ]
+    [ numerically-aligned-locs ]
+    if ;
 
-: packed-locs ( gadget sizes -- seq )
-    [ aligned-locs ] [ [ gap>> ] dip gap-locs ] [ drop ] 2tri orient ;
+: packed-locs ( sizes pack -- seq )
+    [ aligned-locs ] [ gap>> gap-locs ] [ nip ] 2tri orient ;
 
 : round-dims ( seq -- newseq )
-    { 0 0 } swap
-    [ swap v- dup [ ceiling >fixnum ] map [ swap v- ] keep ] map
+    [ { 0 0 } ] dip
+    [ swap v- dup [ ceiling ] map [ swap v- ] keep ] map
     nip ;
 
+PRIVATE>
+
 : pack-layout ( pack sizes -- )
-    round-dims over children>>
-    [ dupd packed-dims ] dip
-    [ [ (>>dim) ] 2each ]
-    [ [ packed-locs ] dip [ (>>loc) ] 2each ] 2bi ;
+    [ round-dims packed-dims ] [ drop ] 2bi
+    [ children>> [ (>>dim) ] 2each ]
+    [ [ packed-locs ] [ children>> ] bi [ (>>loc) ] 2each ] 2bi ;
 
 : <pack> ( orientation -- pack )
-    pack new-gadget
+    pack new
         swap >>orientation ;
 
-: <pile> ( -- pack ) { 0 1 } <pack> ;
+: <pile> ( -- pack ) vertical <pack> ;
 
 : <filled-pile> ( -- pack ) <pile> 1 >>fill ;
 
-: <shelf> ( -- pack ) { 1 0 } <pack> ;
+: <shelf> ( -- pack ) horizontal <pack> ;
+
+<PRIVATE
+
+: gap-dim ( pack -- dim )
+    [ gap>> ] [ children>> length 1 [-] ] bi v*n ;
 
-: gap-dims ( sizes gadget -- seeq )
-    [ [ dim-sum ] [ length 1 [-] ] bi ] [ gap>> ] bi* n*v v+ ;
+: max-pack-dim ( pack sizes -- dim )
+    over align>> +baseline+ eq?
+    [ [ children>> ] dip measure-height 0 swap 2array ] [ nip max-dim ] if ;
 
-: pack-pref-dim ( gadget sizes -- dim )
-    [ nip max-dim ]
-    [ swap gap-dims ]
+: pack-pref-dim ( pack sizes -- dim )
+    [ max-pack-dim ]
+    [ [ gap-dim ] [ dim-sum ] bi* v+ ]
     [ drop orientation>> ]
     2tri set-axis ;
 
 M: pack pref-dim*
     dup children>> pref-dims pack-pref-dim ;
 
+: vertical-baseline ( pack -- y )
+    children>> [ f ] [ first baseline ] if-empty ;
+
+: horizontal-baseline ( pack -- y )
+    children>> dup pref-dims measure-metrics drop ;
+
+: pack-cap-height ( pack -- n )
+    children>> [ cap-height ] map sift
+    [ f ] [ supremum ] if-empty ;
+
+PRIVATE>
+
+M: pack baseline
+    dup orientation>> {
+        { vertical [ vertical-baseline ] }
+        { horizontal [ horizontal-baseline ] }
+    } case ;
+
+M: pack cap-height pack-cap-height ;
+
 M: pack layout*
     dup children>> pref-dims pack-layout ;
 
 M: pack children-on ( rect gadget -- seq )
-    dup orientation>> swap children>>
+    [ orientation>> ] [ children>> ] bi
     [ fast-children-on ] keep <slice> ;
index 23dc99da82124b3d0305f6d075ab7fb94c7e3d97..afb2307b1e2ed474404cfaac73e6a7f18e42fafc 100644 (file)
@@ -3,7 +3,7 @@ quotations ;
 IN: ui.gadgets.panes
 
 HELP: pane
-{ $class-description "A pane " { $link gadget } " displays formatted text which is written to a " { $link pane-stream } " targetting the pane. Panes are created by calling " { $link <pane> } ", " { $link <scrolling-pane> } " or " { $link <pane-control> } "." } ;
+{ $class-description "A pane " { $link gadget } " displays formatted text which is written to a " { $link pane-stream } " targetting the pane. Panes are created by calling " { $link <pane> } " or " { $link <pane-control> } "." } ;
 
 HELP: <pane>
 { $values { "pane" "a new " { $link pane } } }
@@ -38,10 +38,6 @@ HELP: make-pane
 { $values { "quot" quotation } { "gadget" "a new " { $link gadget } } }
 { $description "Calls the quotation in a new scope where " { $link output-stream } " is rebound to a " { $link pane-stream } " writing to a new pane. The output area of the new pane is output on the stack after the quotation returns. The pane itself is not output." } ;
 
-HELP: <scrolling-pane>
-{ $values { "pane" "a new " { $link pane } } }
-{ $description "Creates a new " { $link pane } " gadget which scrolls any scroll pane containing it to the bottom on output. behaving much like a terminal or logger." } ;
-
 HELP: <pane-control>
 { $values { "model" model } { "quot" { $quotation "( value -- )" } } { "pane" "a new " { $link pane } } }
 { $description "Creates a new control delegating to a " { $link pane } ". When the value of the model changes, the value is pushed on the stack and the quotation is called using " { $link with-pane } "." } ;
@@ -56,10 +52,9 @@ HELP: <pane-stream>
 { with-pane make-pane } related-words
 
 ARTICLE: "ui.gadgets.panes" "Pane gadgets"
-"A pane displays formatted text."
+"The " { $vocab-link "ui.gadgets.panes" } " vocabulary implements panes, which display formatted text."
 { $subsection pane }
 { $subsection <pane> }
-{ $subsection <scrolling-pane> }
 { $subsection <pane-control> }
 "Panes are written to by creating a special output stream:"
 { $subsection pane-stream }
index 8627f7fbfe2b72f0b560f0507f7b0095c8d700ce..766e395ef25be332b154ffbb19131cd9ff3d0d79 100644 (file)
@@ -2,7 +2,7 @@ USING: alien ui.gadgets.panes ui.gadgets namespaces
 kernel sequences io io.styles io.streams.string tools.test
 prettyprint definitions help help.syntax help.markup
 help.stylesheet splitting tools.test.ui models math summary
-inspector accessors ;
+inspector accessors help.topics ;
 IN: ui.gadgets.panes.tests
 
 : #children "pane" get children>> length ;
@@ -17,7 +17,7 @@ IN: ui.gadgets.panes.tests
 
 [ t ] [ #children "num-children" get = ] unit-test
 
-: test-gadget-text
+: test-gadget-text ( quot -- ? )
     dup make-pane gadget-text dup print "======" print
     swap with-string-writer dup print "\n" ?tail drop "\n" ?tail drop = ;
 
@@ -79,6 +79,14 @@ IN: ui.gadgets.panes.tests
     ] test-gadget-text
 ] unit-test
 
+[ t ] [
+    [
+        last-element off
+        \ = >link $title
+        "Hello world" print-content
+    ] test-gadget-text
+] unit-test
+
 ARTICLE: "test-article-1" "This is a test article"
 "Hello world, how are you today." ;
 
index 569d6e0f3f4fe57456f2cd5a679f6db83562a893..7337d992d8c80f02b55954927199ab2ccb6029b7 100644 (file)
@@ -1,36 +1,40 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays ui.gadgets ui.gadgets.borders ui.gadgets.buttons
-ui.gadgets.labels ui.gadgets.scrollers ui.gadgets.paragraphs
-ui.gadgets.incremental ui.gadgets.packs ui.gadgets.theme
+USING: arrays hashtables io kernel namespaces sequences
+strings quotations math opengl combinators memoize math.vectors
+sorting splitting assocs classes.tuple models continuations
+destructors accessors math.rectangles fry fonts ui.pens.solid
+ui.images ui.gadgets ui.gadgets.private ui.gadgets.borders
+ui.gadgets.buttons ui.gadgets.labels ui.gadgets.scrollers
+ui.gadgets.paragraphs ui.gadgets.incremental ui.gadgets.packs
 ui.gadgets.menus ui.clipboards ui.gestures ui.traverse ui.render
-hashtables io kernel namespaces sequences io.styles strings
-quotations math opengl combinators math.vectors sorting
-splitting assocs ui.gadgets.presentations
-ui.gadgets.slots ui.gadgets.grids ui.gadgets.grid-lines
-classes.tuple models continuations destructors accessors
-math.geometry.rect fry ;
+ui.text ui.gadgets.presentations ui.gadgets.grids ui.gadgets.tracks
+ui.gadgets.icons ui.gadgets.grid-lines ui.baseline-alignment
+colors call io.styles ;
 IN: ui.gadgets.panes
 
-TUPLE: pane < pack
-output current prototype scrolls?
+TUPLE: pane < track
+output current input last-line prototype scrolls?
 selection-color caret mark selecting? ;
 
 : clear-selection ( pane -- pane )
-    f >>caret f >>mark ;
+    f >>caret f >>mark ; inline
 
-: add-output  ( pane current -- pane )
-    [ >>output  ] [ add-gadget ] bi ;
-
-: add-current ( pane current -- pane )
-    [ >>current ] [ add-gadget ] bi ;
-
-: prepare-line ( pane -- pane )
+: prepare-last-line ( pane -- )
     clear-selection
-    dup prototype>> clone add-current ;
+    [ last-line>> unparent ]
+    [
+        [ horizontal <track> ] dip
+        dup prototype>> clone >>current
+        [ current>> f track-add ]
+        [ input>> [ 1 track-add ] when* ]
+        [ swap [ >>last-line ] [ 1 track-add ] bi drop ]
+        tri
+    ]
+    [ input>> [ request-focus ] when* ] tri ;
 
 : pane-caret&mark ( pane -- caret mark )
-    [ caret>> ] [ mark>> ] bi ;
+    [ caret>> ] [ mark>> ] bi ; inline
 
 : selected-children ( pane -- seq )
     [ pane-caret&mark sort-pair ] keep gadget-subtree ;
@@ -46,20 +50,21 @@ M: pane gadget-selection ( pane -- string/f )
     [ current>> clear-gadget ]
     bi ;
 
-: new-pane ( class -- pane )
-    new-gadget
-        { 0 1 } >>orientation
-        <shelf> >>prototype
-        <incremental> add-output
-        prepare-line
-        selection-color >>selection-color ;
+: new-pane ( input class -- pane )
+    [ vertical ] dip new-track
+        swap >>input
+        1 >>fill
+        <shelf> +baseline+ >>align >>prototype
+        <incremental> [ >>output ] [ f track-add ] bi
+        dup prepare-last-line
+        selection-color >>selection-color ; inline
 
-: <pane> ( -- pane ) pane new-pane ;
+: <pane> ( -- pane ) pane new-pane ;
 
 GENERIC: draw-selection ( loc obj -- )
 
 : if-fits ( rect quot -- )
-    [ clip get over intersects? ] dip [ drop ] if ; inline
+    [ clip get over contains-rect? ] dip [ drop ] if ; inline
 
 M: gadget draw-selection ( loc gadget -- )
     swap offset-rect [
@@ -71,18 +76,18 @@ M: gadget draw-selection ( loc gadget -- )
 M: node draw-selection ( loc node -- )
     2dup value>> swap offset-rect [
         drop 2dup
-        [ value>> rect-loc v+ ] keep
+        [ value>> loc>> v+ ] keep
         children>> [ draw-selection ] with each
     ] if-fits 2drop ;
 
 M: pane draw-gadget*
     dup gadget-selection? [
-        dup selection-color>> gl-color
-        origin get over rect-loc v- swap selected-children
-        [ draw-selection ] with each
-    ] [
-        drop
-    ] if ;
+        [ selection-color>> gl-color ]
+        [
+            [ [ origin get ] dip loc>> v- ] keep selected-children
+            [ draw-selection ] with each
+        ] bi
+    ] [ drop ] if ;
 
 : scroll-pane ( pane -- )
     dup scrolls?>> [ scroll>bottom ] [ drop ] if ;
@@ -100,20 +105,19 @@ C: <pane-stream> pane-stream
 
 : smash-pane ( pane -- gadget ) output>> smash-line ;
 
-: pane-nl ( pane -- pane )
-    dup current>> dup unparent smash-line
-    over output>> add-incremental
-    prepare-line ;
+: pane-nl ( pane -- )
+    [
+        [ current>> [ unparent ] [ smash-line ] bi ] [ output>> ] bi
+        add-incremental
+    ] [ prepare-last-line ] bi ;
 
-: pane-write ( pane seq -- )
-    [ pane-nl ]
-    [ over current>> stream-write ]
-    interleave drop ;
+: pane-write ( seq pane -- )
+    [ pane-nl ] [ current>> stream-write ]
+    bi-curry interleave ;
 
-: pane-format ( style pane seq -- )
-    [ pane-nl ]
-    [ 2over current>> stream-format ]
-    interleave 2drop ;
+: pane-format ( seq style pane -- )
+    [ nip pane-nl ] [ current>> stream-format ]
+    bi-curry bi-curry interleave ;
 
 GENERIC: write-gadget ( gadget stream -- )
 
@@ -124,7 +128,7 @@ M: style-stream write-gadget
     stream>> write-gadget ;
 
 : print-gadget ( gadget stream -- )
-    tuck write-gadget stream-nl ;
+    [ write-gadget ] [ nip stream-nl ] 2bi ;
 
 : gadget. ( gadget -- )
     output-stream get print-gadget ;
@@ -141,15 +145,14 @@ M: style-stream write-gadget
 : make-pane ( quot -- gadget )
     <pane> [ swap with-pane ] keep smash-pane ; inline
 
-: <scrolling-pane> ( -- pane ) <pane> t >>scrolls? ;
-
 TUPLE: pane-control < pane quot ;
 
 M: pane-control model-changed ( model pane-control -- )
-    [ value>> ] [ dup quot>> ] bi* with-pane ;
+    [ value>> ] [ dup quot>> ] bi*
+    '[ _ call( value -- ) ] with-pane ;
 
 : <pane-control> ( model quot -- pane )
-    pane-control new-pane
+    pane-control new-pane
         swap >>quot
         swap >>model ;
 
@@ -157,16 +160,16 @@ M: pane-control model-changed ( model pane-control -- )
     [ pane>> ] dip keep scroll-pane ; inline
 
 M: pane-stream stream-nl
-    [ pane-nl drop ] do-pane-stream ;
+    [ pane-nl ] do-pane-stream ;
 
 M: pane-stream stream-write1
     [ current>> stream-write1 ] do-pane-stream ;
 
 M: pane-stream stream-write
-    [ swap string-lines pane-write ] do-pane-stream ;
+    [ [ string-lines ] dip pane-write ] do-pane-stream ;
 
 M: pane-stream stream-format
-    [ rot string-lines pane-format ] do-pane-stream ;
+    [ [ string-lines ] 2dip pane-format ] do-pane-stream ;
 
 M: pane-stream dispose drop ;
 
@@ -177,31 +180,47 @@ M: pane-stream make-span-stream
 
 ! Character styles
 
-: apply-style ( style gadget key quot -- style gadget )
-    [ pick at ] dip when* ; inline
-
-: apply-foreground-style ( style gadget -- style gadget )
-    foreground [ >>color ] apply-style ;
-
-: apply-background-style ( style gadget -- style gadget )
-    background [ solid-interior ] apply-style ;
-
-: specified-font ( style -- font )
-    [ font swap at "monospace" or ] keep
-    [ font-style swap at plain or ] keep
-    font-size swap at 12 or 3array ;
+MEMO: specified-font ( assoc -- font )
+    #! We memoize here to avoid creating lots of duplicate font objects.
+    [ monospace-font <font> ] dip
+    {
+        [ font-name swap at >>name ]
+        [
+            font-style swap at {
+                { f [ ] }
+                { plain [ ] }
+                { bold [ t >>bold? ] }
+                { italic [ t >>italic? ] }
+                { bold-italic [ t >>bold? t >>italic? ] }
+            } case
+        ]
+        [ font-size swap at >>size ]
+        [ foreground swap at >>foreground ]
+        [ background swap at >>background ]
+    } cleave
+    derive-font ;
 
 : apply-font-style ( style gadget -- style gadget )
-    over specified-font >>font ;
+    { font-name font-style font-size foreground background }
+    pick extract-keys specified-font >>font ;
+
+: apply-style ( style gadget key quot -- style gadget )
+    [ pick at ] dip when* ; inline
 
 : apply-presentation-style ( style gadget -- style gadget )
     presented [ <presentation> ] apply-style ;
 
+: apply-image-style ( style gadget -- style gadget )
+    image [ nip <image-name> <icon> ] apply-style ;
+
+: apply-background-style ( style gadget -- style gadget )
+    background [ <solid> >>interior ] apply-style ;
+
 : style-label ( style gadget -- gadget )
-    apply-foreground-style
-    apply-background-style
     apply-font-style
+    apply-background-style
     apply-presentation-style
+    apply-image-style
     nip ; inline
 
 : <styled-label> ( style text -- gadget )
@@ -216,27 +235,19 @@ M: pane-stream make-span-stream
     ] apply-style ;
 
 : apply-border-color-style ( style gadget -- style gadget )
-    border-color [ solid-boundary ] apply-style ;
+    border-color [ <solid> >>boundary ] apply-style ;
 
 : apply-page-color-style ( style gadget -- style gadget )
-    page-color [ solid-interior ] apply-style ;
-
-: apply-path-style ( style gadget -- style gadget )
-    presented-path [ <editable-slot> ] apply-style ;
+    page-color [ <solid> >>interior ] apply-style ;
 
 : apply-border-width-style ( style gadget -- style gadget )
-    border-width [ <border> ] apply-style ;
-
-: apply-printer-style ( style gadget -- style gadget )
-    presented-printer [ '[ _ make-pane ] >>printer ] apply-style ;
+    border-width [ dup 2array <border> ] apply-style ;
 
 : style-pane ( style pane -- pane )
     apply-border-width-style
     apply-border-color-style
     apply-page-color-style
     apply-presentation-style
-    apply-path-style
-    apply-printer-style
     nip ;
 
 TUPLE: nested-pane-stream < pane-stream style parent ;
@@ -317,21 +328,23 @@ M: paragraph stream-write1
     over CHAR: \s =
     [ H{ } swap gadget-bl drop ] [ gadget-write1 ] if ;
 
+: empty-output? ( string style -- ? )
+    [ empty? ] [ image swap key? not ] bi* and ;
+
 : gadget-format ( string style stream -- )
-    spin dup empty?
-    [ 3drop ] [ <styled-label> add-gadget drop ] if ;
+    [ [ empty-output? ] 2keep ] dip
+    '[ _ _ swap <styled-label> _ swap add-gadget drop ] unless ;
 
 M: pack stream-format
     gadget-format ;
 
 M: paragraph stream-format
-    presented pick at [
+    over { presented image } [ swap key? ] with any? [
         gadget-format
     ] [
-        rot " " split
-        [ 2dup gadget-bl ]
-        [ 2over gadget-format ] interleave
-        2drop
+        [ " " split ] 2dip
+        [ gadget-bl ] [ gadget-format ] bi-curry bi-curry
+        interleave
     ] if ;
 
 : caret>mark ( pane -- pane )
@@ -344,13 +357,13 @@ M: pack sloppy-pick-up* ( loc gadget -- n )
     [ orientation>> ] [ children>> ] bi (fast-children-on) ;
 
 M: gadget sloppy-pick-up*
-    children>> [ inside? ] with find-last drop ;
+    children>> [ contains-point? ] with find-last drop ;
 
 M: f sloppy-pick-up*
     2drop f ;
 
 : wet-and-sloppy ( loc gadget n -- newloc newgadget )
-    swap nth-gadget [ rect-loc v- ] keep ;
+    swap nth-gadget [ loc>> v- ] keep ;
 
 : sloppy-pick-up ( loc gadget -- path )
     2dup sloppy-pick-up* dup
@@ -406,6 +419,6 @@ pane H{
     { T{ button-up f { S+ } 1 } [ end-selection ] }
     { T{ button-up } [ end-selection ] }
     { T{ drag } [ extend-selection ] }
-    { T{ copy-action } [ com-copy ] }
+    { copy-action [ com-copy ] }
     { T{ button-down f f 3 } [ pane-menu ] }
 } set-gestures
diff --git a/basis/ui/gadgets/paragraphs/paragraphs-tests.factor b/basis/ui/gadgets/paragraphs/paragraphs-tests.factor
new file mode 100644 (file)
index 0000000..fcc121e
--- /dev/null
@@ -0,0 +1,52 @@
+IN: ui.gadgets.paragraphs.tests
+USING: ui.gadgets.paragraphs ui.gadgets.paragraphs.private
+ui.gadgets ui.gadgets.debug accessors tools.test namespaces
+sequences kernel ;
+
+TUPLE: fake-break < gadget ;
+
+: <fake-break> ( -- gadget ) fake-break new { 5 5 } >>dim ;
+
+INSTANCE: fake-break word-break
+
+100 <paragraph>
+<gadget> { 40 30 } >>dim dup "a" set add-gadget
+<fake-break> add-gadget
+<gadget> { 40 15 } >>dim dup "b" set add-gadget
+<fake-break> add-gadget
+<gadget> { 50 20 } >>dim dup "c" set add-gadget
+"p" set
+
+[ { 4 1 } ] [ "p" get wrap-paragraph [ words>> length ] map ] unit-test
+
+[ { 85 50 } ] [ "p" get pref-dim ] unit-test
+
+[ ] [ "p" get prefer ] unit-test
+
+[ ] [ "p" get layout ] unit-test
+
+[ { 0 0 } ] [ "a" get loc>> ] unit-test
+
+[ { 45 15 } ] [ "b" get loc>> ] unit-test
+
+[ { 0 30 } ] [ "c" get loc>> ] unit-test
+
+100 <paragraph>
+15 15 { 40 30 } <baseline-gadget> dup "a" set add-gadget
+<fake-break> add-gadget
+10 10 { 40 30 } <baseline-gadget> dup "b" set add-gadget
+<fake-break> add-gadget
+20 20 { 40 30 } <baseline-gadget> dup "c" set add-gadget
+"p" set
+
+[ { 85 65 } ] [ "p" get pref-dim ] unit-test
+
+[ ] [ "p" get prefer ] unit-test
+
+[ ] [ "p" get layout ] unit-test
+
+[ { 0 0 } ] [ "a" get loc>> ] unit-test
+
+[ { 45 5 } ] [ "b" get loc>> ] unit-test
+
+[ { 0 35 } ] [ "c" get loc>> ] unit-test
\ No newline at end of file
index 6e26a2989f0c7342ac0e6f268e6ce209d517d7bb..fd5ae0b246646f81f3745a2036d54d4a3ebf1f3f 100644 (file)
@@ -1,10 +1,12 @@
-! Copyright (C) 2005, 2008 Slava Pestov
+! Copyright (C) 2005, 2009 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays ui.gadgets ui.gadgets.labels ui.render
-kernel math namespaces sequences math.order math.geometry.rect
-locals ;
+USING: accessors kernel math math.order sequences wrap wrap.words
+arrays fry ui.gadgets ui.gadgets.labels ui.gadgets.packs.private
+ui.render ui.baseline-alignment ;
 IN: ui.gadgets.paragraphs
 
+MIXIN: word-break
+
 ! A word break gadget
 TUPLE: word-break-gadget < label ;
 
@@ -13,68 +15,71 @@ TUPLE: word-break-gadget < label ;
 
 M: word-break-gadget draw-gadget* drop ;
 
+INSTANCE: word-break-gadget word-break
+
 ! A gadget that arranges its children in a word-wrap style.
 TUPLE: paragraph < gadget margin ;
 
 : <paragraph> ( margin -- gadget )
-    paragraph new-gadget
-    { 1 0 } >>orientation
+    paragraph new
+    horizontal >>orientation
     swap >>margin ;
 
-SYMBOL: x SYMBOL: max-x
+<PRIVATE
 
-SYMBOL: y SYMBOL: max-y
+: gadget>word ( gadget -- word )
+    [ ] [ pref-dim first ] [ word-break? ] tri <word> ;
 
-SYMBOL: line-height
+TUPLE: line words height ;
 
-SYMBOL: margin
+: <line> ( words -- line )
+    dup [ key>> ] map dup pref-dims measure-height line boa ;
 
-: overrun? ( width -- ? ) x get + margin get > ;
+: wrap-paragraph ( paragraph -- wrapped-paragraph )
+    [ children>> [ gadget>word ] map ] [ margin>> ] bi
+    dup wrap-words [ <line> ] map ;
 
-: zero-vars ( seq -- ) [ 0 swap set ] each ;
+: line-width ( wrapped-line -- n )
+    [ break?>> ] trim-tail-slice [ width>> ] sigma ;
 
-: wrap-line ( -- )
-    line-height get y +@
-    { x line-height } zero-vars ;
+: max-line-width ( wrapped-paragraph -- x )
+    [ words>> line-width ] [ max ] map-reduce ;
 
-: wrap-pos ( -- pos ) x get y get 2array ; inline
+: sum-line-heights ( wrapped-paragraph -- y )
+    [ height>> ] sigma ;
 
-: advance-x ( x -- )
-    x +@
-    x get max-x [ max ] change ;
+M: paragraph pref-dim*
+    wrap-paragraph [ max-line-width ] [ sum-line-heights ] bi 2array ;
 
-: advance-y ( y -- )
-    dup line-height [ max ] change
-    y get + max-y [ max ] change ;
+: line-y-coordinates ( wrapped-paragraph -- ys )
+    0 [ height>> + ] accumulate nip ;
 
-:: wrap-step ( quot child -- )
-    child pref-dim
-    [
-        child
-        [
-            word-break-gadget?
-            [ drop ] [ first overrun? [ wrap-line ] when ] if
-        ]
-        [ wrap-pos quot call ] bi
-    ]
-    [ first advance-x ]
-    [ second advance-y ]
-    tri ; inline
-
-: wrap-dim ( -- dim ) max-x get max-y get 2array ;
-
-: init-wrap ( paragraph -- )
-    margin>> margin set
-    { x max-x y max-y line-height } zero-vars ;
-
-: do-wrap ( paragraph quot -- dim )
-    [
-        swap dup init-wrap
-        [ wrap-step ] with each-child wrap-dim
-    ] with-scope ; inline
+: word-x-coordinates ( wrapped-line -- xs )
+    0 [ width>> + ] accumulate nip ;
 
-M: paragraph pref-dim*
-    [ 2drop ] do-wrap ;
+: layout-word ( word x y -- )
+    [ key>> ] 2dip 2array >>loc prefer ;
+
+: layout-line ( wrapped-line y -- )
+    [
+        words>>
+        [ ]
+        [ word-x-coordinates ]
+        [ [ key>> ] map align-baselines ] tri
+    ] dip '[ _ + layout-word ] 3each ;
 
 M: paragraph layout*
-    [ swap dup prefer (>>loc) ] do-wrap drop ;
+    wrap-paragraph dup line-y-coordinates
+    [ layout-line ] 2each ;
+
+M: paragraph baseline
+    wrap-paragraph [ f ] [
+        first words>>
+        [ key>> ] map
+        dup [ pref-dim ] map
+        measure-metrics drop
+    ] if-empty ;
+
+M: paragraph cap-height pack-cap-height ;
+    
+PRIVATE>
\ No newline at end of file
index 005fa1e7fe61b6a75732dd01508ee0d2824a41b6..4b98f65c82e529116e92c71dea663d43d7e28f65 100644 (file)
@@ -33,7 +33,7 @@ HELP: <presentation>
 { $description "Creates a new " { $link presentation } " derived from " { $link <roll-button> } "." }
 { $see-also "presentations" } ;
 
-{ <button> <bevel-button> <command-button> <roll-button> <presentation> } related-words
+{ <button> <border-button> <command-button> <roll-button> <presentation> } related-words
 
 { <status-bar> show-mouse-help show-status show-summary hide-status } related-words
 
@@ -42,9 +42,10 @@ HELP: show-mouse-help
 { $description "Displays a " { $link summary } " of the " { $snippet "object" } "in the status bar of the " { $link world } " containing this presentation. This word is executed when the mouse enters the presentation." } ;
 
 ARTICLE: "ui.gadgets.presentations" "Presentation gadgets"
-"Outliner gadgets are usually not constructed directly, and instead are written to " { $link "ui.gadgets.panes" } " with formatted stream output words (" { $link "presentations" } ")."
+"The " { $vocab-link "ui.gadgets.presentations" } " vocabulary implements presentations, which are graphical representations of an object, associated with the object itself (see " { $link "ui-operations" } ")."
+$nl
+"Clicking a presentation with the left mouse button invokes the object's primary operation, and clicking with the right mouse button displays a menu of all applicable operations. Presentations are usually not constructed directly, and instead are written to " { $link "ui.gadgets.panes" } " with formatted stream output words (see " { $link "presentations" } ")."
 { $subsection presentation }
-{ $subsection <presentation> }
-"Presentations remember the object they are presenting; operations can be performed on the presented object. See " { $link "ui-operations" } "." ;
+{ $subsection <presentation> } ;
 
 ABOUT: "ui.gadgets.presentations"
index f05ea5ae5d7ec100e50a46ad0343a195168fb252..621e7006c91fdac4dfe5fbc7492ce1f7cb5543b0 100644 (file)
@@ -1,9 +1,8 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays accessors definitions hashtables io kernel
-sequences strings io.styles words help math models
-namespaces quotations
-ui.gadgets ui.gadgets.borders ui.gadgets.buttons
+USING: arrays accessors definitions hashtables io kernel sequences
+strings words help math models namespaces quotations ui.gadgets
+ui.gadgets.borders ui.gadgets.buttons ui.gadgets.buttons.private
 ui.gadgets.labels ui.gadgets.menus ui.gadgets.worlds
 ui.gadgets.status-bar ui.commands ui.operations ui.gestures ;
 IN: ui.gadgets.presentations
@@ -35,17 +34,17 @@ M: presentation ungraft*
     dup hand-gadget get-global child? [ dup hide-status ] when
     call-next-method ;
 
-: show-operations-menu ( presentation -- )
+: show-presentation-menu ( presentation -- )
     [ ] [ object>> ] [ dup hook>> curry ] tri
-    <operations-menu> show-menu ;
+    show-operations-menu ;
 
 presentation H{
-    { T{ button-down f f 3 } [ show-operations-menu ] }
-    { T{ mouse-leave } [ [ hide-status ] [ button-update ] bi ] }
-    { T{ mouse-enter } [ show-mouse-help ] }
+    { T{ button-down f f 3 } [ show-presentation-menu ] }
+    { mouse-leave [ [ hide-status ] [ button-update ] bi ] }
+    { mouse-enter [ show-mouse-help ] }
     ! Responding to motion too allows nested presentations to
     ! display status help properly, when the mouse leaves a
     ! nested presentation and is still inside the parent, the
     ! parent doesn't receive a mouse-enter
-    { T{ motion } [ show-mouse-help ] }
+    { motion [ show-mouse-help ] }
 } set-gestures
index b248527c37db4629c2f8bab8c3a7a4ddf143bc78..8e0131ec3182d32e3eee98bcadb224c86b9c47aa 100644 (file)
@@ -1,5 +1,5 @@
 USING: ui.gadgets help.markup help.syntax ui.gadgets.viewports
-ui.gadgets.sliders math.geometry.rect ;
+ui.gadgets.sliders math.rectangles ui.gadgets.scrollers.private ;
 IN: ui.gadgets.scrollers
 
 HELP: scroller
@@ -44,7 +44,7 @@ HELP: scroll>top
 { $description "Ensures that any scroller containing " { $snippet "gadget" } " is scrolled all the way up. If no parent of " { $snippet "scroller" } " is a gadget, does nothing." } ;
 
 ARTICLE: "ui.gadgets.scrollers" "Scroller gadgets"
-"A scroller displays a gadget which is larger than the visible area."
+"The " { $vocab-link "ui.gadgets.scrollers" } " vocabulary implements scroller gadgets. A scroller displays a gadget which is larger than the visible area."
 { $subsection scroller }
 { $subsection <scroller> }
 "Getting and setting the scroll position:"
index 25977cd9063615c2cdb1f6ea7fe4d481286b9951..4e61c9b1ed8e20a83c02799b80312c149b586d17 100644 (file)
@@ -1,9 +1,9 @@
 USING: ui.gadgets ui.gadgets.scrollers namespaces tools.test
-kernel models models.compose models.range ui.gadgets.viewports
-ui.gadgets.labels ui.gadgets.grids ui.gadgets.frames
-ui.gadgets.sliders math math.vectors arrays sequences
-tools.test.ui math.geometry.rect accessors ui.gadgets.buttons
-ui.gadgets.packs ;
+kernel models models.product models.range ui.gadgets.viewports
+ui.gadgets.labels ui.gadgets.grids ui.gadgets.sliders math
+math.vectors arrays sequences tools.test.ui math.rectangles
+accessors ui.gadgets.buttons ui.gadgets.packs
+ui.gadgets.scrollers.private ;
 IN: ui.gadgets.scrollers.tests
 
 [ ] [
@@ -12,8 +12,8 @@ IN: ui.gadgets.scrollers.tests
 ] unit-test
 
 [ { 100 200 } ] [
-    { 100 200 } "g" get scroll>rect
-    "s" get follows>> rect-loc
+    { 100 200 } point>rect "g" get scroll>rect
+    "s" get follows>> loc>>
 ] unit-test
 
 [ ] [ "s" get scroll>bottom ] unit-test
@@ -21,14 +21,14 @@ IN: ui.gadgets.scrollers.tests
 
 [ ] [
     <gadget> dup "g" set
-    10 1 0 100 <range> 20 1 0 100 <range> 2array <compose>
+    10 1 0 100 <range> 20 1 0 100 <range> 2array <product>
     <viewport> "v" set
 ] unit-test
 
 "v" get [
     [ { 10 20 } ] [ "v" get model>> range-value ] unit-test
 
-    [ { 10 20 } ] [ "g" get rect-loc vneg viewport-gap v+ scroller-border v+ ] unit-test
+    [ { 10 20 } ] [ "g" get loc>> vneg ] unit-test
 ] with-grafted-gadget
 
 [ ] [
@@ -41,15 +41,15 @@ IN: ui.gadgets.scrollers.tests
 [ ] [ "s" get layout ] unit-test
 
 "s" get [
-    [ { 34 34 } ] [ "s" get viewport>> rect-dim ] unit-test
+    [ { 31 31 } ] [ "s" get viewport>> dim>> ] unit-test
 
-    [ { 107 107 } ] [ "s" get viewport>> viewport-dim ] unit-test
+    [ { 100 100 } ] [ "s" get viewport>> gadget-child pref-dim ] unit-test
 
     [ ] [ { 0 0 } "s" get scroll ] unit-test
 
     [ { 0 0 } ] [ "s" get model>> range-min-value ] unit-test
 
-    [ { 107 107 } ] [ "s" get model>> range-max-value ] unit-test
+    [ { 100 100 } ] [ "s" get model>> range-max-value ] unit-test
 
     [ ] [ { 10 20 } "s" get scroll ] unit-test
 
@@ -57,7 +57,7 @@ IN: ui.gadgets.scrollers.tests
 
     [ { 10 20 } ] [ "s" get viewport>> model>> range-value ] unit-test
 
-    [ { 10 20 } ] [ "g" get rect-loc vneg viewport-gap v+ scroller-border v+ ] unit-test
+    [ { 10 20 } ] [ "g" get loc>> vneg ] unit-test
 ] with-grafted-gadget
 
 <gadget> { 600 400 } >>dim "g1" set
@@ -75,7 +75,7 @@ dup layout
         "g2" get scroll>gadget
         "s" get layout
         "s" get scroller-value
-    ] map [ { 2 0 } = ] all?
+    ] map [ { 0 0 } = ] all?
 ] unit-test
 
 [ ] [ "Hi" <label> dup "l" set <scroller> "s" set ] unit-test
@@ -84,11 +84,11 @@ dup layout
 [ t ] [ "l" get dup find-scroller viewport>> swap child? ] unit-test
 [ t ] [ "l" get find-scroller* "s" get eq? ] unit-test
 [ f ] [ "s" get viewport>> find-scroller* ] unit-test
-[ t ] [ "s" get @right grid-child slider? ] unit-test
-[ f ] [ "s" get @right grid-child find-scroller* ] unit-test
+[ t ] [ "s" get { 1 0 } grid-child slider? ] unit-test
+[ f ] [ "s" get { 1 0 } grid-child find-scroller* ] unit-test
 
 [ ] [
-    "Click Me" [ [ scroll>gadget ] [ unparent ] bi ] <bevel-button>
+    "Click Me" [ [ scroll>gadget ] [ unparent ] bi ] <border-button>
     [ <pile> swap add-gadget <scroller> ] keep
     dup quot>> call
     layout
@@ -96,13 +96,13 @@ dup layout
 
 [ t ] [
     <gadget> { 200 200 } >>dim
-    [ [ scroll>gadget ] [ unparent ] bi ] <bevel-button>
+    [ [ scroll>gadget ] [ unparent ] bi ] <border-button>
     dup
     <pile> swap add-gadget <scroller> { 100 100 } >>dim dup layout
     swap dup quot>> call
     dup layout
     model>> dependencies>> [ range-max value>> ] map
-    viewport-padding =
+    { 0 0 } =
 ] unit-test
 
 \ <scroller> must-infer
index 93f6b8bb40c25df8159a06360697934ef5010c65..64e035c81bb505858741b5d73b4c5414f75a5008 100644 (file)
@@ -1,13 +1,22 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays ui.gadgets ui.gadgets.viewports
-ui.gadgets.frames ui.gadgets.grids ui.gadgets.theme
-ui.gadgets.sliders ui.gestures kernel math namespaces sequences
-models models.range models.compose combinators math.vectors
-classes.tuple math.geometry.rect combinators.short-circuit ;
+ui.gadgets.frames ui.gadgets.grids ui.gadgets.sliders
+ui.gestures kernel math namespaces sequences models models.range
+models.product combinators math.vectors classes.tuple
+math.rectangles combinators.short-circuit ;
 IN: ui.gadgets.scrollers
 
-TUPLE: scroller < frame viewport x y follows ;
+TUPLE: scroller < frame column-header viewport x y follows ;
+
+! Scrollable gadget protocol; optional
+GENERIC: pref-viewport-dim ( gadget -- dim )
+
+M: gadget pref-viewport-dim pref-dim ;
+
+GENERIC: viewport-column-header ( gadget -- gadget/f )
+
+M: gadget viewport-column-header drop f ;
 
 : find-scroller ( gadget -- scroller/f )
     [ scroller? ] find-parent ;
@@ -20,6 +29,8 @@ TUPLE: scroller < frame viewport x y follows ;
 
 : scroll-down-line ( scroller -- ) y>> 1 swap slide-by-line ;
 
+<PRIVATE
+
 : do-mouse-scroll ( scroller -- )
     scroll-direction get-global
     [ first swap x>> slide-by-line ]
@@ -27,43 +38,27 @@ TUPLE: scroller < frame viewport x y follows ;
     2bi ;
 
 scroller H{
-    { T{ mouse-scroll } [ do-mouse-scroll ] }
+    { mouse-scroll [ do-mouse-scroll ] }
 } set-gestures
 
 : <scroller-model> ( -- model )
-    0 0 0 0 <range> 0 0 0 0 <range> 2array <compose> ;
-
-: new-scroller ( gadget class -- scroller )
-    new-frame
-        t >>root?
-        <scroller-model> >>model
-
-        dup model>> dependencies>>
-        [ first <x-slider> [ >>x ] [ @bottom grid-add ] bi ]
-        [ second <y-slider> [ >>y ] [ @right grid-add ] bi ] bi
+    0 0 0 0 <range> 0 0 0 0 <range> 2array <product> ;
 
-        tuck model>> <viewport> [ >>viewport ] [ @center grid-add ] bi
-
-        faint-boundary ; inline
-
-: <scroller> ( gadget -- scroller ) scroller new-scroller ;
+M: viewport pref-dim* gadget-child pref-viewport-dim ;
 
 : scroll ( value scroller -- )
     [
-        viewport>> [ rect-dim { 0 0 } ] [ viewport-dim ] bi
+        viewport>> [ dim>> { 0 0 } ] [ gadget-child pref-dim ] bi
         4array flip
     ] keep
     2dup control-value = [ 2drop ] [ set-control-value ] if ;
 
-: rect-min ( rect dim -- rect' )
-    [ [ loc>> ] [ dim>> ] bi ] dip vmin <rect> ;
-
 : (scroll>rect) ( rect scroller -- )
-    [ [ loc>> { 1 1 } v- ] [ dim>> { 1 1 } v+ ] bi <rect> ] dip
+    [ [ loc>> ] [ dim>> { 1 1 } v+ ] bi <rect> ] dip
     {
-        [ scroller-value vneg offset-rect viewport-gap offset-rect ]
+        [ scroller-value vneg offset-rect ]
         [ viewport>> dim>> rect-min ]
-        [ viewport>> 2rect-extent [ v- { 0 0 } vmin ] [ v- { 0 0 } vmax ] 2bi* v+ ]
+        [ viewport>> [ v- { 0 0 } vmin ] [ v- { 0 0 } vmax ] with-rect-extents v+ ]
         [ scroller-value v+ ]
         [ scroll ]
     } cleave ;
@@ -76,39 +71,18 @@ scroller H{
     { [ nip ] [ viewport>> gadget-child swap child? ] [ nip ] }
     2&& ;
 
-: scroll>rect ( rect gadget -- )
-    dup find-scroller* dup [
-        [ relative-scroll-rect ] keep
-        swap >>follows
-        relayout
-    ] [ 3drop ] if ;
-
 : (update-scroller) ( scroller -- )
     [ scroller-value ] keep scroll ;
 
 : (scroll>gadget) ( gadget scroller -- )
     2dup swap child? [
-        [ [ pref-dim { 0 0 } swap <rect> ] keep ] dip
+        [ [ [ { 0 0 } ] dip pref-dim <rect> ] keep ] dip
         [ relative-scroll-rect ] keep
         (scroll>rect)
     ] [ f >>follows (update-scroller) drop ] if ;
 
-: scroll>gadget ( gadget -- )
-    dup find-scroller* dup [
-        swap >>follows
-        relayout
-    ] [
-        2drop
-    ] if ;
-
 : (scroll>bottom) ( scroller -- )
-    [ viewport>> viewport-dim { 0 1 } v* ] keep scroll ;
-
-: scroll>bottom ( gadget -- )
-    find-scroller [ t >>follows relayout-1 ] when* ;
-
-: scroll>top ( gadget -- )
-    <zero-rect> swap scroll>rect ;
+    [ viewport>> gadget-child pref-dim { 0 1 } v* ] keep scroll ;
 
 GENERIC: update-scroller ( scroller follows -- )
 
@@ -132,12 +106,61 @@ M: scroller focusable-child*
 M: scroller model-changed
     f >>follows 2drop ;
 
-TUPLE: limited-scroller < scroller
-{ min-dim initial: { 0 0 } }
-{ max-dim initial: { 1/0. 1/0. } } ;
+: build-scroller ( scroller -- scroller )
+    dup x>> { 0 1 } grid-add
+    dup y>> { 1 0 } grid-add
+    dup viewport>> { 0 0 } grid-add ; inline
+
+: <column-header-viewport> ( scroller -- viewport )
+    [ column-header>> ] [ model>> ] bi
+    <viewport> horizontal >>constraint ;
+
+: build-header-scroller ( scroller -- scroller )
+    dup <column-header-viewport> { 0 0 } grid-add
+    dup x>> { 0 2 } grid-add
+    dup y>> { 1 1 } grid-add
+    dup viewport>> { 0 1 } grid-add ; inline
+
+: init-scroller ( column-header scroller -- scroller )
+    { 1 1 } >>gap
+    over { 0 1 } { 0 0 } ? >>filled-cell
+    t >>root?
+    <scroller-model> >>model
+    swap >>column-header ; inline
+
+: build-children ( gadget scroller -- scroller )
+    dup model>> dependencies>>
+    [ first horizontal <slider> >>x ]
+    [ second vertical <slider> >>y ] bi
+    [ nip ] [ model>> <viewport> ] 2bi >>viewport ; inline
+
+PRIVATE>
+
+: <scroller> ( gadget -- scroller )
+    dup viewport-column-header
+    dup [ 2 3 ] [ 2 2 ] if scroller new-frame
+        init-scroller
+        build-children
+        dup column-header>>
+        [ build-header-scroller ] [ build-scroller ] if ;
 
-: <limited-scroller> ( gadget -- scroller )
-    limited-scroller new-scroller ;
+: scroll>rect ( rect gadget -- )
+    dup find-scroller* dup [
+        [ relative-scroll-rect ] keep
+        swap >>follows
+        relayout
+    ] [ 3drop ] if ;
 
-M: limited-scroller pref-dim*
-    [ call-next-method ] [ min-dim>> vmax ] [ max-dim>> vmin ] tri ;
+: scroll>gadget ( gadget -- )
+    dup find-scroller* dup [
+        swap >>follows
+        relayout
+    ] [
+        2drop
+    ] if ;
+
+: scroll>bottom ( gadget -- )
+    find-scroller [ t >>follows relayout-1 ] when* ;
+
+: scroll>top ( gadget -- )
+    <zero-rect> swap scroll>rect ;
diff --git a/basis/ui/gadgets/search-tables/search-tables.factor b/basis/ui/gadgets/search-tables/search-tables.factor
new file mode 100644 (file)
index 0000000..4a2983b
--- /dev/null
@@ -0,0 +1,81 @@
+! Copyright (C) 2008, 2009 Slava Pestov
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors kernel delegate fry sequences models
+combinators.short-circuit models.search models.delay calendar locals
+ui.gestures ui.pens ui.pens.image ui.gadgets.editors ui.gadgets.labels
+ui.gadgets.scrollers ui.gadgets.tables ui.gadgets.tracks
+ui.gadgets.borders ui.gadgets.buttons ui.baseline-alignment ui.gadgets ;
+IN: ui.gadgets.search-tables
+
+TUPLE: search-table < track table field ;
+
+: find-search-table ( gadget -- search-table/f )
+    [ search-table? ] find-parent ;
+
+TUPLE: search-field < track field ;
+
+: clear-search-field ( search-field -- )
+    field>> editor>> clear-editor ;
+
+: <clear-button-pen> ( -- pen )
+    "clear-button" theme-image <image-pen> dup
+    "clear-button-clicked" theme-image <image-pen> dup dup <button-pen> ;
+
+: <clear-button> ( search-field -- button )
+    [ f ] dip '[ drop _ clear-search-field ] <button>
+    <clear-button-pen> >>interior
+    dup dup interior>> pen-pref-dim >>min-dim ;
+
+: <search-field> ( model -- gadget )
+    horizontal search-field new-track
+        { 5 5 } >>gap
+        +baseline+ >>align
+        swap <model-field> 10 >>min-cols >>field
+        dup field>> "Search:" label-on-left 1 track-add
+        dup <clear-button> f track-add ;
+
+M: search-field focusable-child* field>> ;
+
+: pass-to-table ( gesture gadget -- ? )
+    find-search-table table>> handle-gesture ;
+
+M: search-field handle-gesture
+    over key-gesture? [
+        { [ pass-to-table ] [ call-next-method ] } 2&&
+    ] [ call-next-method ] if ;
+
+! A protocol with customizable slots
+SLOT-PROTOCOL: table-protocol
+renderer
+action
+hook
+font
+gap
+selection-color
+focus-border-color
+mouse-color
+column-line-color
+selection-required?
+single-click?
+selected-value
+min-rows
+min-cols
+max-rows
+max-cols ;
+
+CONSULT: table-protocol search-table table>> ;
+
+:: <search-table> ( values renderer quot -- gadget )
+    f <model> :> search
+    vertical search-table new-track
+        values >>model
+        search <search-field> >>field
+        dup field>> { 2 2 } <filled-border> f track-add
+        values search 500 milliseconds <delay> quot <string-search>
+        renderer <table> f >>takes-focus? >>table
+        dup table>> <scroller> 1 track-add ;
+
+M: search-table model-changed
+    nip field>> clear-search-field ;
+
+M: search-table focusable-child* field>> ;
\ No newline at end of file
index c130c724d0eef790829c7ecee21eb6698d03d2de..38f4b5ac1540d2f43feb4694ba2dd6257a8749f0 100644 (file)
@@ -1,4 +1,5 @@
-USING: help.markup help.syntax ui.gadgets models models.range ;
+USING: help.markup help.syntax ui.gadgets models models.range
+ui.gadgets.sliders.private ;
 IN: ui.gadgets.sliders
 
 HELP: elevator
@@ -11,7 +12,7 @@ HELP: find-elevator
 HELP: slider
 { $class-description "A slider is a control for graphically manipulating a " { $link "models-range" } "."
 $nl
-"Sliders are created by calling " { $link <x-slider> } " or " { $link <y-slider> } "." } ;
+"Sliders are created by calling " { $link <slider> } "." } ;
 
 HELP: find-slider
 { $values { "gadget" gadget } { "slider/f" { $maybe slider } } }
@@ -34,24 +35,12 @@ HELP: slide-by-line
 
 HELP: <slider>
 { $values { "range" range } { "orientation" "an orientation specifier" } { "slider" "a new " { $link slider } } }
-{ $description "Internal word for constructing sliders." }
-{ $notes "This does not build a complete slider, and user code should call " { $link <x-slider> } " or " { $link <y-slider> } " instead." } ;
-
-HELP: <x-slider>
-{ $values { "range" range } { "slider" slider } }
-{ $description "Creates a new horizontal " { $link slider } "." } ;
-
-HELP: <y-slider>
-{ $values { "range" range } { "slider" slider } }
-{ $description "Creates a new vertical " { $link slider } "." } ;
-
-{ <x-slider> <y-slider> } related-words
+{ $description "Creates a new slider." } ;
 
 ARTICLE: "ui.gadgets.sliders" "Slider gadgets"
-"A slider allows the user to graphically manipulate a value by moving a thumb back and forth."
+"The " { $vocab-link "ui.gadgets.sliders" } " vocabulary implements slider gadgets. A slider allows the user to graphically manipulate a value by moving a thumb back and forth."
 { $subsection slider }
-{ $subsection <x-slider> }
-{ $subsection <y-slider> }
+{ $subsection <slider> }
 "Changing slider values:"
 { $subsection slide-by }
 { $subsection slide-by-line }
index f22bd08ba27736d3977777410b5f00b0422a5be4..6cfb83a49a87d31f70cc97e133a33fe44345a19a 100644 (file)
@@ -1,36 +1,49 @@
-! Copyright (C) 2005, 2007 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays ui.gestures ui.gadgets ui.gadgets.buttons
-ui.gadgets.frames ui.gadgets.grids math.order
-ui.gadgets.theme ui.render kernel math namespaces sequences
-vectors models models.range math.vectors math.functions
-quotations colors math.geometry.rect fry ;
+USING: accessors arrays assocs kernel math namespaces sequences
+vectors models models.range math.vectors math.functions quotations
+colors colors.constants math.rectangles fry combinators ui.gestures
+ui.pens ui.gadgets ui.gadgets.buttons ui.gadgets.tracks math.order
+ui.gadgets.icons ui.pens.tile ui.pens.image ;
 IN: ui.gadgets.sliders
 
+TUPLE: slider < track elevator thumb saved line ;
+
+: slider-value ( gadget -- n ) model>> range-value >fixnum ;
+: slider-page ( gadget -- n ) model>> range-page-value ;
+: slider-max ( gadget -- n ) model>> range-max-value ;
+: slider-max* ( gadget -- n ) model>> range-max-value* ;
+
+: slide-by ( amount slider -- ) model>> move-by ;
+: slide-by-page ( amount slider -- ) model>> move-by-page ;
+
+: slide-by-line ( amount slider -- ) [ line>> * ] keep slide-by ;
+
+<PRIVATE
+
 TUPLE: elevator < gadget direction ;
 
 : find-elevator ( gadget -- elevator/f ) [ elevator? ] find-parent ;
 
-TUPLE: slider < frame elevator thumb saved line ;
-
 : find-slider ( gadget -- slider/f ) [ slider? ] find-parent ;
 
+CONSTANT: elevator-padding 4
+
 : elevator-length ( slider -- n )
-  [ elevator>> dim>> ] [ orientation>> ] bi v. ;
+    [ elevator>> dim>> ] [ orientation>> ] bi v.
+    elevator-padding 2 * - ;
 
-CONSTANT: min-thumb-dim 15
+CONSTANT: min-thumb-dim 30
 
-: slider-value ( gadget -- n ) model>> range-value >fixnum ;
-: slider-page  ( gadget -- n ) model>> range-page-value    ;
-: slider-max   ( gadget -- n ) model>> range-max-value     ;
-: slider-max*  ( gadget -- n ) model>> range-max-value*    ;
+: visible-portion ( slider -- n )
+    [ slider-page ] [ slider-max 1 max ] bi / 1 min ;
 
 : thumb-dim ( slider -- h )
     [
-        [ [ slider-page ] [ slider-max 1 max ] bi / 1 min ]
-        [ elevator-length ] bi * min-thumb-dim max
+        [ visible-portion ] [ elevator-length ] bi *
+        min-thumb-dim max
     ]
-    [ [ elevator>> dim>> ] [ orientation>> ] bi v. ] bi min ;
+    [ elevator-length ] bi min ;
 
 : slider-scale ( slider -- n )
     #! A scaling factor such that if x is a slider co-ordinate,
@@ -40,20 +53,23 @@ CONSTANT: min-thumb-dim 15
     [ slider-max* 1 max ]
     bi / ;
 
-: slider>screen ( m scale -- n ) slider-scale * ;
-: screen>slider ( m scale -- n ) slider-scale / ;
+: slider>screen ( m slider -- n ) slider-scale * elevator-padding + ;
+: screen>slider ( m slider -- n ) [ elevator-padding - ] dip slider-scale / ;
 
 M: slider model-changed nip elevator>> relayout-1 ;
 
-TUPLE: thumb < gadget ;
+TUPLE: thumb < track ;
 
 : begin-drag ( thumb -- )
     find-slider dup slider-value >>saved drop ;
 
 : do-drag ( thumb -- )
-    find-slider drag-loc over orientation>> v.
-    over screen>slider swap [ saved>> + ] keep
-    model>> set-range-value ;
+    find-slider {
+        [ orientation>> drag-loc v. ]
+        [ screen>slider ]
+        [ saved>> + ]
+        [ model>> set-range-value ]
+    } cleave ;
 
 thumb H{
     { T{ button-down } [ begin-drag ] }
@@ -61,28 +77,47 @@ thumb H{
     { T{ drag } [ do-drag ] }
 } set-gestures
 
-: thumb-theme ( thumb -- thumb )
-    plain-gradient >>interior
-    faint-boundary ; inline
-
-: <thumb> ( vector -- thumb )
-    thumb new-gadget
-        swap >>orientation
-        t >>root?
-    thumb-theme ;
-
-: slide-by ( amount slider -- ) model>> move-by ;
-
-: slide-by-page ( amount slider -- ) model>> move-by-page ;
+CONSTANT: horizontal-thumb-tiles
+    {
+        { "horizontal-scroller-handle-left" f }
+        { "horizontal-scroller-handle-middle" 1/2 }
+        { "horizontal-scroller-handle-grip" f }
+        { "horizontal-scroller-handle-middle" 1/2 }
+        { "horizontal-scroller-handle-right" f }
+    }
+
+CONSTANT: vertical-thumb-tiles
+    {
+        { "vertical-scroller-handle-top" f }
+        { "vertical-scroller-handle-middle" 1/2 }
+        { "vertical-scroller-handle-grip" f }
+        { "vertical-scroller-handle-middle" 1/2 }
+        { "vertical-scroller-handle-bottom" f }
+    }
+
+: build-thumb ( thumb -- thumb )
+    dup orientation>> {
+        { horizontal [ horizontal-thumb-tiles ] }
+        { vertical [ vertical-thumb-tiles ] }
+    } case
+    [ [ theme-image <icon> ] dip track-add ] assoc-each ;
+
+: <thumb> ( orientation -- thumb )
+    thumb new-track
+        0 >>fill
+        1/2 >>align
+        build-thumb
+        t >>root? ;
 
 : compute-direction ( elevator -- -1/1 )
-    dup find-slider swap hand-click-rel
-    over orientation>> v.
-    over screen>slider
-    swap slider-value - sgn ;
+    [ hand-click-rel ] [ find-slider ] bi
+    [ orientation>> v. ]
+    [ screen>slider ]
+    [ slider-value - sgn ]
+    tri ;
 
 : elevator-hold ( elevator -- )
-    dup direction>> swap find-slider slide-by-page ;
+    [ direction>> ] [ find-slider ] bi slide-by-page ;
 
 : elevator-click ( elevator -- )
     dup compute-direction >>direction
@@ -94,70 +129,112 @@ elevator H{
 } set-gestures
 
 : <elevator> ( vector -- elevator )
-  elevator new-gadget
-    swap             >>orientation
-    lowered-gradient >>interior ;
-
-: (layout-thumb) ( slider n -- n thumb )
-    over orientation>> n*v swap thumb>> ;
+    elevator new
+        swap >>orientation ;
 
 : thumb-loc ( slider -- loc )
-    dup slider-value swap slider>screen ;
+    [ slider-value ] keep slider>screen ;
 
-: layout-thumb-loc ( slider -- )
-    dup thumb-loc (layout-thumb)
-    [ [ floor ] map ] dip (>>loc) ;
+: layout-thumb-loc ( thumb slider -- )
+    [ thumb-loc ] [ orientation>> ] bi n*v
+    [ floor ] map >>loc drop ;
 
-: layout-thumb-dim ( slider -- )
-    dup dup thumb-dim (layout-thumb)
-    [
-        [ [ rect-dim ] dip ] [ drop orientation>> ] 2bi set-axis
-        [ ceiling ] map
-    ] dip (>>dim) ;
+: layout-thumb-dim ( thumb slider -- )
+    [ dim>> ] [ thumb-dim ] [ orientation>> ] tri [ n*v ] keep set-axis
+    [ ceiling ] map >>dim drop ;
+
+: slider-enabled? ( slider -- ? )
+    visible-portion 1 = not ;
 
 : layout-thumb ( slider -- )
-    dup layout-thumb-loc layout-thumb-dim ;
+    [ thumb>> ] keep
+    [ slider-enabled? >>visible? drop ]
+    [ layout-thumb-loc ]
+    [ layout-thumb-dim ]
+    2tri ;
 
 M: elevator layout*
     find-slider layout-thumb ;
 
-: slide-by-line ( amount slider -- ) [ line>> * ] keep slide-by ;
-
-: <slide-button> ( vector polygon amount -- button )
-    [ gray swap <polygon-gadget> ] dip
-    '[ _ swap find-slider slide-by-line ] <repeat-button>
-    swap >>orientation ;
+: add-thumb-to-elevator ( object -- object )
+    [ elevator>> ] [ thumb>> ] bi add-gadget ;
 
-: elevator, ( gadget orientation -- gadget )
-    tuck <elevator> >>elevator
-    swap <thumb> >>thumb
-    dup elevator>> over thumb>> add-gadget
-    @center grid-add ;
+: <slide-button-pen> ( orientation left right -- pen )
+    [ horizontal = ] 2dip ?
+    [ f f ] [ theme-image <image-pen> f f ] bi* <button-pen> ;
 
-: <left-button>  ( -- button ) { 0 1 } arrow-left -1 <slide-button> ;
-: <right-button> ( -- button ) { 0 1 } arrow-right 1 <slide-button> ;
-: <up-button>    ( -- button ) { 1 0 } arrow-up   -1 <slide-button> ;
-: <down-button>  ( -- button ) { 1 0 } arrow-down  1 <slide-button> ;
+TUPLE: slide-button < repeat-button ;
 
-: <slider> ( range orientation -- slider )
-    slider new-frame
-        swap >>orientation
-        swap >>model
-        32 >>line ;
-
-: <x-slider> ( range -- slider )
-    { 1 0 } <slider>
-        <left-button> @left grid-add
-        { 0 1 } elevator,
-        <right-button> @right grid-add ;
-
-: <y-slider> ( range -- slider )
-    { 0 1 } <slider>
-        <up-button> @top grid-add
-        { 1 0 } elevator,
-        <down-button> @bottom grid-add ;
+: <slide-button> ( orientation amount left right -- button )
+    [ swap ] 2dip
+    [
+        [ <gadget> ] dip
+        '[ _ swap find-slider slide-by-line ]
+        slide-button new-button
+    ] 3dip
+    <slide-button-pen> >>interior ;
+
+M: slide-button pref-dim* dup interior>> pen-pref-dim ;
+
+: <up-button> ( orientation -- button )
+    -1
+    "horizontal-scroller-leftarrow-clicked"
+    "vertical-scroller-uparrow-clicked"
+    <slide-button> ;
+
+: <down-button> ( orientation -- button )
+    1
+    "horizontal-scroller-rightarrow-clicked"
+    "vertical-scroller-downarrow-clicked"
+    <slide-button> ;
+
+TUPLE: slider-pen enabled disabled ;
+
+: <slider-pen> ( orientation -- pen )
+    {
+        { horizontal [
+            "horizontal-scroller-left" theme-image
+            "horizontal-scroller-middle" theme-image
+            "horizontal-scroller-right" theme-image
+            "horizontal-scroller-right-disabled" theme-image
+        ] }
+        { vertical [
+            "vertical-scroller-top" theme-image
+            "vertical-scroller-middle" theme-image
+            "vertical-scroller-bottom" theme-image
+            "vertical-scroller-bottom-disabled" theme-image
+        ] }
+    } case
+    [ f f <tile-pen> ] bi-curry@ 2bi \ slider-pen boa ;
+
+: slider-pen ( slider pen -- pen )
+    [ slider-enabled? ] [ [ enabled>> ] [ disabled>> ] bi ] bi* ? ;
+
+M: slider-pen draw-interior
+    dupd slider-pen draw-interior ;
+
+M: slider-pen draw-boundary
+    dupd slider-pen draw-boundary ;
+
+M: slider-pen pen-pref-dim
+    enabled>> pen-pref-dim ;
 
 M: slider pref-dim*
-    dup call-next-method
-    swap orientation>> [ 40 v*n ] keep
+    [ dup interior>> pen-pref-dim ] [ drop { 100 100 } ] [ orientation>> ] tri
     set-axis ;
+
+PRIVATE>
+
+: <slider> ( range orientation -- slider )
+    slider new-track
+        swap >>model
+        32 >>line
+        dup orientation>> {
+            [ <slider-pen> >>interior ]
+            [ <thumb> >>thumb ]
+            [ <elevator> >>elevator ]
+            [ drop dup add-thumb-to-elevator 1 track-add ]
+            [ <up-button> f track-add ]
+            [ <down-button> f track-add ]
+            [ drop <gadget> { 1 1 } >>dim f track-add ]
+        } cleave ;
\ No newline at end of file
index d6adbdbff5a5b6b26f9d795c9033521cfb83baf8..e49c60a3ed21458d264e0b24abc5c5be21b6bcb3 100644 (file)
@@ -1,6 +1,4 @@
 IN: ui.gadgets.slots.tests
 USING: assocs ui.gadgets.slots tools.test refs ;
 
-\ <editable-slot> must-infer
-
-[ t ] [ { 1 2 3 } 2 <value-ref> <slot-editor> slot-editor? ] unit-test
+[ t ] [ [ ] [ ] { 1 2 3 } 2 <value-ref> <slot-editor> slot-editor? ] unit-test
index e04b288a5d747feb9eaae7c0f6a8173c94a0ccfc..592900d0cbf6867141f511e1c41302f6341ca5cf 100644 (file)
@@ -1,10 +1,10 @@
-! Copyright (C) 2007, 2008 Slava Pestov.
+! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors namespaces kernel parser prettyprint
 sequences arrays io math definitions math.vectors assocs refs
 ui.gadgets ui.gestures ui.commands ui.gadgets.scrollers
 ui.gadgets.buttons ui.gadgets.borders ui.gadgets.tracks
-ui.gadgets.editors eval ;
+ui.gadgets.editors eval continuations ;
 IN: ui.gadgets.slots
 
 TUPLE: update-object ;
@@ -13,40 +13,44 @@ TUPLE: update-slot ;
 
 TUPLE: edit-slot ;
 
-TUPLE: slot-editor < track ref text ;
+TUPLE: slot-editor < track ref close-hook update-hook text ;
 
 : revert ( slot-editor -- )
-    dup ref>> get-ref unparse-use
-    swap text>> set-editor-string ;
+    [ ref>> get-ref unparse-use ] [ text>> ] bi set-editor-string ;
 
 \ revert H{
     { +description+ "Revert any uncomitted changes." }
 } define-command
 
-GENERIC: finish-editing ( slot-editor ref -- )
+: close ( slot-editor -- )
+    dup close-hook>> call ;
 
-M: key-ref finish-editing
-    drop T{ update-object } swap propagate-gesture ;
+\ close H{
+    { +description+ "Close the slot editor without saving changes." }
+} define-command
 
-M: value-ref finish-editing
-    drop T{ update-slot } swap propagate-gesture ;
+: close-and-update ( slot-editor -- )
+    [ update-hook>> call ] [ close ] bi ;
 
 : slot-editor-value ( slot-editor -- object )
-    text>> control-value parse-fresh ;
+    text>> control-value parse-fresh first ;
 
 : commit ( slot-editor -- )
-    dup text>> control-value parse-fresh first
-    over ref>> set-ref
-    dup ref>> finish-editing ;
+    [ [ slot-editor-value ] [ ref>> ] bi set-ref ]
+    [ close-and-update ]
+    bi ;
 
 \ commit H{
     { +description+ "Parse the object being edited, and store the result back into the edited slot." }
 } define-command
 
+: eval-1 ( string -- object )
+    1array [ eval ] with-datastack first ;
+
 : com-eval ( slot-editor -- )
-    [ text>> editor-string eval ] keep
-    [ ref>> set-ref ] keep
-    dup ref>> finish-editing ;
+    [ [ text>> editor-string eval-1 ] [ ref>> ] bi set-ref ]
+    [ close-and-update ]
+    bi ;
 
 \ com-eval H{
     { +listener+ t }
@@ -54,23 +58,17 @@ M: value-ref finish-editing
 } define-command
 
 : delete ( slot-editor -- )
-    dup ref>> delete-ref
-    T{ update-object } swap propagate-gesture ;
+    [ ref>> delete-ref ] [ close-and-update ] bi ;
 
 \ delete H{
     { +description+ "Delete the slot and close the slot editor." }
 } define-command
 
-: close ( slot-editor -- )
-    T{ update-slot } swap propagate-gesture ;
-
-\ close H{
-    { +description+ "Close the slot editor without saving changes." }
-} define-command
-
-: <slot-editor> ( ref -- gadget )
-    { 0 1 } slot-editor new-track
+: <slot-editor> ( close-hook update-hook ref -- gadget )
+    vertical slot-editor new-track
         swap >>ref
+        swap >>update-hook
+        swap >>close-hook
         add-toolbar
         <source-editor> >>text
         dup text>> <scroller> 1 track-add
@@ -87,39 +85,3 @@ slot-editor "toolbar" f {
     { f delete }
     { T{ key-down f f "ESC" } close }
 } define-command-map
-
-TUPLE: editable-slot < track printer ref ;
-
-: <edit-button> ( -- gadget )
-    "..."
-    [ T{ edit-slot } swap propagate-gesture ]
-    <roll-button> ;
-
-: display-slot ( gadget editable-slot -- )
-  dup clear-track
-    swap          1 track-add
-    <edit-button> f track-add
-  drop ;
-
-: update-slot ( editable-slot -- )
-    [ [ ref>> get-ref ] [ printer>> ] bi call ] keep
-    display-slot ;
-
-: edit-slot ( editable-slot -- )
-    [ clear-track ]
-    [
-        dup ref>> <slot-editor>
-        [ 1 track-add drop ]
-        [ [ scroll>gadget ] [ request-focus ] bi* ] 2bi
-    ] bi ;
-
-\ editable-slot H{
-    { T{ update-slot } [ update-slot ] }
-    { T{ edit-slot } [ edit-slot ] }
-} set-gestures
-
-: <editable-slot> ( gadget ref -- editable-slot )
-    { 1 0 } editable-slot new-track
-        swap >>ref
-        [ drop <gadget> ] >>printer
-        [ display-slot ] keep ;
index 6203cd474ee5b2cb055b1370b6714d59e7cd92b5..f5a6409fcaf79b265ac39dd42e1eccc6f2c19eb0 100644 (file)
@@ -1,8 +1,33 @@
-USING: help.markup help.syntax models
-ui.gadgets ui.gadgets.worlds ;
+USING: help.markup help.syntax models strings
+ui.gadgets ui.gadgets.worlds ui ;
 IN: ui.gadgets.status-bar
 
+HELP: show-status
+{ $values { "string" string } { "gadget" gadget } }
+{ $description "Displays a status message in the gadget's world." }
+{ $notes "The status message will only be visible if the window was opened with " { $link open-status-window } ", and not " { $link open-window } "." } ;
+
+HELP: hide-status
+{ $values { "gadget" gadget } }
+{ $description "Hides the status message in the gadget's world." }
+{ $notes "The gadget passed in must be the gadget passed to " { $link show-status } ", otherwise the word does nothing. This ensures that one gadget does not hide another gadget's status message." } ;
+
 HELP: <status-bar>
 { $values { "model" model } { "gadget" "a new " { $link gadget } } }
 { $description "Creates a new " { $link gadget } " displaying the model value, which must be a string or " { $link f } "." }
 { $notes "If the " { $snippet "model" } " is " { $snippet "status" } ", this gadget will display mouse over help for " { $link "ui.gadgets.presentations" } "." } ;
+
+HELP: open-status-window
+{ $values { "gadget" gadget } { "title" string } }
+{ $description "Like " { $link open-window } ", with the additional feature that the new window iwll have a status bar displaying the value stored in the world's " { $slot "status" } " slot." }
+{ $see-also show-status hide-status } ;
+
+ARTICLE: "ui.gadgets.status-bar" "Status bars and mouse-over help"
+"The " { $vocab-link "ui.gadgets.status-bar" } " vocabulary implements a word to display windows with a status bar."
+{ $subsection open-status-window }
+"Gadgets can use a pair of words to show and hide status bar messages. These words will work in any gadget, but will have no effect unless the gadget is displayed inside a window with a status bar."
+{ $subsection show-status }
+{ $subsection hide-status }
+{ $link "ui.gadgets.presentations" } " use the status bar to display object summary." ;
+
+ABOUT: "ui.gadgets.status-bar"
\ No newline at end of file
index 32abcd5466b50077e632b5bc3136564ede92e66e..a1c2dca23d04e3b91844f1a6f68efe09ad7323de 100644 (file)
@@ -1,12 +1,12 @@
 ! Copyright (C) 2007, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors models models.delay models.filter
-sequences ui.gadgets.labels ui.gadgets.theme ui.gadgets.tracks
+USING: accessors models models.delay models.arrow
+sequences ui.gadgets.labels ui.gadgets.tracks
 ui.gadgets.worlds ui.gadgets ui kernel calendar summary ;
 IN: ui.gadgets.status-bar
 
 : <status-bar> ( model -- gadget )
-    1/10 seconds <delay> [ "" like ] <filter> <label-control>
+    1/10 seconds <delay> [ "" like ] <arrow> <label-control>
     reverse-video-theme
     t >>root? ;
 
diff --git a/basis/ui/gadgets/tabbed/tabbed.factor b/basis/ui/gadgets/tabbed/tabbed.factor
new file mode 100644 (file)
index 0000000..2388110
--- /dev/null
@@ -0,0 +1,60 @@
+! Copyright (C) 2008, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: ui.pens ui.gadgets.tracks ui.gadgets.buttons
+ui.gadgets.buttons.private ui.gadgets.books ui.gadgets.packs
+ui.gadgets.borders ui.gadgets.icons ui.gadgets ui.pens.image
+sequences models accessors kernel colors colors.constants ;
+IN: ui.gadgets.tabbed
+
+TUPLE: tabbed-gadget < track tabs book ;
+
+<PRIVATE
+
+: <lip> ( -- gadget )
+    "active-tab-lip" theme-image <icon> ;
+
+CONSTANT: active-tab-background
+    T{ rgba
+        f
+        0.6745098039215687
+        0.6549019607843137
+        0.5764705882352941
+        1.0
+    }
+
+: <tab-pen> ( -- pen )
+    "inactive-tab" button-background f <border-button-state-pen> dup dup
+    "active-tab" active-tab-background f <border-button-state-pen> dup
+    <button-pen> ;
+
+: tab-theme ( gadget -- gadget )
+    horizontal >>orientation
+    <tab-pen> >>interior
+    dup dup interior>> pen-pref-dim >>min-dim
+    { 30 0 } >>size ; inline
+
+: <tab> ( value model label -- gadget )
+    <radio-control> tab-theme ;
+
+: add-tab/book ( tabbed child -- tabbed )
+    [ dup book>> ] dip add-gadget drop ;
+
+: add-tab/button ( tabbed label -- tabbed )
+    [ [ dup tabs>> dup children>> length ] [ model>> ] bi ] dip
+    <tab> add-gadget drop ;
+
+PRIVATE>
+
+: <tabbed-gadget> ( -- gadget )
+    vertical tabbed-gadget new-track
+        0 <model> >>model
+        <shelf> >>tabs
+        horizontal <track>
+            over tabs>> f track-add
+            <lip> 1 track-add
+        f track-add
+        dup model>> <empty-book> >>book
+        dup book>> { 3 3 } <filled-border> 1 track-add ;
+
+: add-tab ( tabbed child label -- tabbed )
+    [ add-tab/book ] [ add-tab/button ] bi* ;
diff --git a/basis/ui/gadgets/tables/tables-docs.factor b/basis/ui/gadgets/tables/tables-docs.factor
new file mode 100644 (file)
index 0000000..c064a80
--- /dev/null
@@ -0,0 +1,67 @@
+USING: help.markup help.syntax ui.commands kernel ;
+IN: ui.gadgets.tables
+
+ARTICLE: "ui.gadgets.tables.renderers" "Table row renderer protocol"
+"Table gadgets use a row renderer to display rows and do a few other things."
+$nl
+"Renderers are usually instances of singleton classes, since they don't need any state of their own. Renderers are required to implement a single generic word:"
+{ $subsection row-columns }
+"Renderers can also implement the following optional generic words for additional row information:"
+{ $subsection row-value }
+{ $subsection row-color }
+"The following optional generic words allow the renderer to provide some information about the display of all rows:"
+{ $subsection prototype-row }
+{ $subsection column-alignment }
+{ $subsection filled-column }
+{ $subsection column-titles } ;
+
+ARTICLE: "ui.gadgets.tables.selection" "Table row selection"
+"At any given time, a single row in the table may be selected."
+$nl
+"A few slots in the table gadget concern row selection:"
+{ $table
+  { { $slot "selected-value" } { " - if set to a model, the currently selected row's value, as determined by a " { $link row-value } " call to the renderer, is stored in this model. See " { $link "models" } "." } }
+  { { $slot "selected-index" } " - the index of the currently selected row." }
+  { { $slot "selection-required?" } { " - if set to a true value, the table ensures that some row is always selected, if the model is non-empty. If set to " { $link f } ", a state where nothing is selected is permitted to occur. The default is " { $link f } "." } }
+}
+"Some words for row selection:"
+{ $subsection selected-row }
+{ $subsection (selected-row) } ;
+
+ARTICLE: "ui.gadgets.tables.actions" "Table row actions"
+"When the user double-clicks on a row, or presses " { $command table "row" row-action } " while a row is selected, optional action and hook quotations are invoked. The action receives the row value and the hook receives the table gadget itself. These quotations are stored in the " { $slot "action" } " and " { $snippet "hook" } " slots of a table, respectively."
+$nl
+"If the " { $slot "single-click?" } " slot is set to a true value, then single-clicking on a row will invoke the row action. The default value is " { $link f } "."
+$nl
+"The row action can also be invoked programmatically:"
+{ $subsection row-action } ;
+
+ARTICLE: "ui.gadgets.tables.config" "Table gadget configuration"
+"Various slots in the table gadget can be set to change the appearance and behavior of the table gadget."
+{ $table
+  { { $slot "gap" } }
+  { { $slot "focus-border-color" } }
+  { { $slot "mouse-color" } }
+  { { $slot "column-line-color" } }
+  { { $slot "takes-focus?" } }
+} ;
+
+ARTICLE: "ui.gadgets.tables.example" "Table gadget example"
+"The " { $vocab-link "color-table" } " vocabulary implements a simple application which demonstrates table gadgets. It lists all the colors in the " { $snippet "rgb.txt" } " database shipped with " { $vocab-link "colors.constants" } " in a table. Rows are highlighted with their actual color, and columns show the red, green, and blue components. Column titles are supplied." ;
+
+ARTICLE: "ui.gadgets.tables" "Table gadgets"
+"The " { $vocab-link "ui.gadgets.tables" } " vocabulary implements table gadgets. Table gadgets display a grid of values, with each row's columns generated by a renderer object."
+$nl
+"Tables display a model as a series of rows. The model must be a sequence, and a " { $emphasis "renderer" } " creates a sequence of columns for each row. Tables are built from and inherit all features of " { $link "ui.gadgets.line-support" } "."
+{ $command-map table "row" }
+"The class of tables:"
+{ $subsection table }
+{ $subsection table? }
+"Creating new tables:"
+{ $subsection <table> }
+{ $subsection "ui.gadgets.tables.renderers" }
+{ $subsection "ui.gadgets.tables.selection" }
+{ $subsection "ui.gadgets.tables.actions" }
+{ $subsection "ui.gadgets.tables.example" } ;
+
+ABOUT: "ui.gadgets.tables"
\ No newline at end of file
diff --git a/basis/ui/gadgets/tables/tables-tests.factor b/basis/ui/gadgets/tables/tables-tests.factor
new file mode 100644 (file)
index 0000000..11f080a
--- /dev/null
@@ -0,0 +1,22 @@
+IN: ui.gadgets.tables.tests
+USING: ui.gadgets.tables ui.gadgets.scrollers accessors
+models namespaces tools.test kernel ;
+
+SINGLETON: test-renderer
+
+M: test-renderer row-columns drop ;
+
+M: test-renderer column-titles drop { "First" "Last" } ;
+
+[ ] [
+    {
+        { "Britney" "Spears" }
+        { "Justin" "Timberlake" }
+        { "Don" "Stewart" }
+    } <model> test-renderer <table>
+    "table" set
+] unit-test
+
+[ ] [
+    "table" get <scroller> "scroller" set
+] unit-test
\ No newline at end of file
diff --git a/basis/ui/gadgets/tables/tables.factor b/basis/ui/gadgets/tables/tables.factor
new file mode 100644 (file)
index 0000000..7b1befc
--- /dev/null
@@ -0,0 +1,404 @@
+! Copyright (C) 2008, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays colors colors.constants fry kernel math
+math.functions math.rectangles math.order math.vectors namespaces
+opengl sequences ui.gadgets ui.gadgets.scrollers ui.gadgets.status-bar
+ui.gadgets.worlds ui.gestures ui.render ui.pens.solid ui.text
+ui.commands ui.images ui.gadgets.menus ui.gadgets.line-support
+math.rectangles models math.ranges sequences combinators fonts locals
+strings ;
+IN: ui.gadgets.tables
+
+! Row rendererer protocol
+GENERIC: prototype-row ( renderer -- columns )
+GENERIC: column-alignment ( renderer -- alignment )
+GENERIC: filled-column ( renderer -- n )
+GENERIC: column-titles ( renderer -- strings )
+
+GENERIC: row-columns ( row renderer -- columns )
+GENERIC: row-value ( row renderer -- object )
+GENERIC: row-color ( row renderer -- color )
+
+SINGLETON: trivial-renderer
+
+M: object prototype-row drop { "" } ;
+M: object column-alignment drop f ;
+M: object filled-column drop f ;
+M: object column-titles drop f ;
+
+M: trivial-renderer row-columns drop ;
+M: object row-value drop ;
+M: object row-color 2drop f ;
+
+TUPLE: table < line-gadget
+{ renderer initial: trivial-renderer }
+{ action initial: [ drop ] }
+single-click?
+{ hook initial: [ drop ] }
+{ gap initial: 2 }
+column-widths total-width
+focus-border-color
+{ mouse-color initial: COLOR: black }
+column-line-color
+selection-required?
+selected-index selected-value
+mouse-index
+{ takes-focus? initial: t }
+focused? ;
+
+: <table> ( rows renderer -- table )
+    table new-line-gadget
+        swap >>renderer
+        swap >>model
+        f <model> >>selected-value
+        sans-serif-font >>font
+        focus-border-color >>focus-border-color
+        transparent >>column-line-color ;
+
+<PRIVATE
+
+GENERIC: cell-width ( font cell -- x )
+GENERIC: cell-height ( font cell -- y )
+GENERIC: draw-cell ( font cell -- )
+
+M: string cell-width text-width ;
+M: string cell-height text-height ceiling ;
+M: string draw-cell draw-text ;
+
+M: image-name cell-width nip image-dim first ;
+M: image-name cell-height nip image-dim second ;
+M: image-name draw-cell nip draw-image ;
+
+: table-rows ( table -- rows )
+    [ control-value ] [ renderer>> ] bi '[ _ row-columns ] map ;
+
+: column-offsets ( widths gap -- x xs )
+    [ 0 ] dip '[ _ + + ] accumulate ;
+
+CONSTANT: column-title-background COLOR: light-gray
+
+: column-title-font ( font -- font' )
+    column-title-background font-with-background t >>bold? ;
+
+: initial-widths ( table rows -- widths )
+    over renderer>> column-titles dup
+    [ [ drop font>> ] dip [ text-width ] with map ]
+    [ drop nip first length 0 <repetition> ]
+    if ;
+
+: row-column-widths ( table row -- widths )
+    [ font>> ] dip [ cell-width ] with map ;
+
+: compute-total-width ( gap widths -- total )
+    swap [ column-offsets drop ] keep - ;
+
+: compute-column-widths ( table -- total widths )
+    dup table-rows [ drop 0 { } ] [
+        [ drop gap>> ] [ initial-widths ] [ ] 2tri
+        [ row-column-widths vmax ] with each
+        [ compute-total-width ] keep
+    ] if-empty ;
+
+: update-cached-widths ( table -- )
+    dup compute-column-widths
+    [ >>total-width ] [ >>column-widths ] bi*
+    drop ;
+
+: filled-column-width ( table -- n )
+    [ dim>> first ] [ total-width>> ] bi [-] ;
+
+: update-filled-column ( table -- )
+    [ filled-column-width ]
+    [ renderer>> filled-column ]
+    [ column-widths>> ] tri
+    2dup empty? not and
+    [ [ + ] change-nth ] [ 3drop ] if ;
+
+M: table layout*
+    [ update-cached-widths ] [ update-filled-column ] bi ;
+
+: row-rect ( table row -- rect )
+    [ [ line-height ] dip * 0 swap 2array ]
+    [ drop [ dim>> first ] [ line-height ] bi 2array ] 2bi <rect> ;
+
+: highlight-row ( table row color quot -- )
+    [ [ row-rect rect-bounds ] dip gl-color ] dip
+    '[ _ @ ] with-translation ; inline
+
+: draw-selected-row ( table -- )
+    {
+        { [ dup selected-index>> not ] [ drop ] }
+        [
+            [ ] [ selected-index>> ] [ selection-color>> ] tri
+            [ gl-fill-rect ] highlight-row
+        ]
+    } cond ;
+
+: draw-focused-row ( table -- )
+    {
+        { [ dup focused?>> not ] [ drop ] }
+        { [ dup selected-index>> not ] [ drop ] }
+        [
+            [ ] [ selected-index>> ] [ focus-border-color>> ] tri
+            [ gl-rect ] highlight-row
+        ]
+    } cond ;
+
+: draw-moused-row ( table -- )
+    dup mouse-index>> dup [
+        over mouse-color>> [ gl-rect ] highlight-row
+    ] [ 2drop ] if ;
+
+: column-line-offsets ( table -- xs )
+    [ column-widths>> ] [ gap>> ] bi
+    [ column-offsets nip [ f ] ]
+    [ 2/ '[ rest-slice [ _ - ] map ] ]
+    bi if-empty ;
+
+: draw-column-lines ( table -- )
+    [ column-line-color>> gl-color ]
+    [
+        [ column-line-offsets ] [ dim>> second ] bi
+        '[ [ 0 2array ] [ _ 2array ] bi gl-line ] each
+    ] bi ;
+
+: column-loc ( font column width align -- loc )
+    [ [ cell-width ] dip swap - ] dip
+    * >integer 0 2array ;
+
+: translate-column ( width gap -- )
+    + 0 2array gl-translate ;
+
+: draw-column ( font column width align gap -- )
+    [
+        over [
+            [ 2dup ] 2dip column-loc
+            [ draw-cell ] with-translation
+        ] dip
+    ] dip translate-column ;
+
+: table-column-alignment ( table -- seq )
+    dup renderer>> column-alignment
+    [ ] [ column-widths>> length 0 <repetition> ] ?if ;
+
+:: row-font ( row index table -- font )
+    table font>> clone
+    row table renderer>> row-color [ >>foreground ] when*
+    index table selected-index>> = [ table selection-color>> >>background ] when ;
+
+: draw-columns ( columns widths alignment font gap -- )
+    '[ [ _ ] 3dip _ draw-column ] 3each ;
+
+M: table draw-line ( row index table -- )
+    [
+        nip
+        [ renderer>> row-columns ]
+        [ column-widths>> ]
+        [ table-column-alignment ]
+        tri
+    ]
+    [ row-font ]
+    [ 2nip gap>> ] 3tri
+    draw-columns ;
+
+M: table draw-gadget*
+    dup control-value empty? [ drop ] [
+        {
+            [ draw-selected-row ]
+            [ draw-lines ]
+            [ draw-column-lines ]
+            [ draw-focused-row ]
+            [ draw-moused-row ]
+        } cleave
+    ] if ;
+
+M: table line-height ( table -- y )
+    [ font>> ] [ renderer>> prototype-row ] bi
+    [ cell-height ] with [ max ] map-reduce ;
+
+M: table pref-dim*
+    [ compute-column-widths drop ] keep
+    [ line-height ] [ control-value length ] bi * 2array ;
+
+: nth-row ( row table -- value/f ? )
+    over [ control-value nth t ] [ 2drop f f ] if ;
+
+PRIVATE>
+
+: (selected-row) ( table -- value/f ? )
+    [ selected-index>> ] keep nth-row ;
+
+: selected-row ( table -- value/f ? )
+    [ (selected-row) ] keep
+    swap [ renderer>> row-value t ] [ 2drop f f ] if ;
+
+<PRIVATE
+
+: update-selected-value ( table -- )
+    [ selected-row drop ] [ selected-value>> ] bi set-model ;
+
+: initial-selected-index ( model table -- n/f )
+    [ value>> length 1 >= ] [ selection-required?>> ] bi* and 0 f ? ;
+
+: show-row-summary ( table n -- )
+    over nth-row
+    [ swap [ renderer>> row-value ] keep show-summary ]
+    [ 2drop ]
+    if ;
+
+: hide-mouse-help ( table -- )
+    f >>mouse-index [ hide-status ] [ relayout-1 ] bi ;
+
+M: table model-changed
+    [ nip ] [ initial-selected-index ] 2bi {
+        [ >>selected-index f >>mouse-index drop ]
+        [ show-row-summary ]
+        [ drop update-selected-value ]
+        [ drop relayout ]
+    } 2cleave ;
+
+: thin-row-rect ( table row -- rect )
+    row-rect [ { 0 1 } v* ] change-dim ;
+
+: (select-row) ( table n -- )
+    [ dup [ [ thin-row-rect ] [ drop ] 2bi scroll>rect ] [ 2drop ] if ]
+    [ >>selected-index relayout-1 ]
+    2bi ;
+
+: mouse-row ( table -- n )
+    [ hand-rel second ] keep y>line ;
+
+: table-button-down ( table -- )
+    dup takes-focus?>> [ dup request-focus ] when
+    dup control-value empty? [ drop ] [
+        dup [ mouse-row ] keep validate-line
+        [ >>mouse-index ] [ (select-row) ] bi
+    ] if ;
+
+PRIVATE>
+
+: row-action ( table -- )
+    dup selected-row
+    [ swap [ action>> call ] [ dup hook>> call ] bi ]
+    [ 2drop ]
+    if ;
+
+<PRIVATE
+
+: table-button-up ( table -- )
+    dup single-click?>> hand-click# get 2 = or
+    [ row-action ] [ update-selected-value ] if ;
+
+: select-row ( table n -- )
+    over validate-line
+    [ (select-row) ]
+    [ drop update-selected-value ]
+    [ show-row-summary ]
+    2tri ;
+
+: prev/next-row ( table n -- )
+    [ dup selected-index>> ] dip '[ _ + ] [ 0 ] if* select-row ;
+    
+: previous-row ( table -- )
+    -1 prev/next-row ;
+
+: next-row ( table -- )
+    1 prev/next-row ;
+
+: first-row ( table -- )
+    0 select-row ;
+
+: last-row ( table -- )
+    dup control-value length 1- select-row ;
+
+: prev/next-page ( table n -- )
+    over visible-lines 1- * prev/next-row ;
+
+: previous-page ( table -- )
+    -1 prev/next-page ;
+
+: next-page ( table -- )
+    1 prev/next-page ;
+
+: valid-row? ( row table -- ? )
+    control-value length 1- 0 swap between? ;
+
+: if-mouse-row ( table true false -- )
+    [ [ mouse-row ] keep 2dup valid-row? ]
+    [ ] [ '[ nip @ ] ] tri* if ; inline
+
+: show-mouse-help ( table -- )
+    [
+        swap
+        [ >>mouse-index relayout-1 ]
+        [ show-row-summary ]
+        2bi
+    ] [ hide-mouse-help ] if-mouse-row ;
+
+: show-table-menu ( table -- )
+    [
+        [ nip ]
+        [ swap select-row ]
+        [
+            [ nth-row drop ]
+            [ renderer>> row-value ]
+            [ dup hook>> curry ]
+            tri
+        ] 2tri
+        show-operations-menu
+    ] [ drop ] if-mouse-row ;
+
+: focus-table ( table -- ) t >>focused? drop ;
+
+: unfocus-table ( table -- ) f >>focused? drop ;
+
+table "sundry" f {
+    { mouse-enter show-mouse-help }
+    { mouse-leave hide-mouse-help }
+    { motion show-mouse-help }
+    { T{ button-down } table-button-down }
+    { T{ button-up } table-button-up }
+    { gain-focus focus-table }
+    { lose-focus unfocus-table }
+    { T{ drag } table-button-down }
+} define-command-map
+
+table "row" f {
+    { T{ button-down f f 3 } show-table-menu }
+    { T{ key-down f f "RET" } row-action }
+    { T{ key-down f f "UP" } previous-row }
+    { T{ key-down f f "DOWN" } next-row }
+    { T{ key-down f f "HOME" } first-row }
+    { T{ key-down f f "END" } last-row }
+    { T{ key-down f f "PAGE_UP" } previous-page }
+    { T{ key-down f f "PAGE_DOWN" } next-page }
+} define-command-map
+
+TUPLE: column-headers < gadget table ;
+
+: <column-headers> ( table -- gadget )
+    column-headers new
+        swap >>table
+        column-title-background <solid> >>interior ;
+
+: draw-column-titles ( table -- )
+    {
+        [ renderer>> column-titles ]
+        [ column-widths>> ]
+        [ table-column-alignment ]
+        [ font>> column-title-font ]
+        [ gap>> ]
+    } cleave
+    draw-columns ;
+
+M: column-headers draw-gadget*
+    table>> draw-column-titles ;
+
+M: column-headers pref-dim*
+    table>> [ pref-dim first ] [ font>> "" text-height ] bi 2array ;
+
+M: table viewport-column-header
+    dup renderer>> column-titles
+    [ <column-headers> ] [ drop f ] if ;
+
+PRIVATE>
\ No newline at end of file
diff --git a/basis/ui/gadgets/theme/active-tab-left.tiff b/basis/ui/gadgets/theme/active-tab-left.tiff
new file mode 100644 (file)
index 0000000..8a6c05f
Binary files /dev/null and b/basis/ui/gadgets/theme/active-tab-left.tiff differ
diff --git a/basis/ui/gadgets/theme/active-tab-lip.tiff b/basis/ui/gadgets/theme/active-tab-lip.tiff
new file mode 100644 (file)
index 0000000..8ff803f
Binary files /dev/null and b/basis/ui/gadgets/theme/active-tab-lip.tiff differ
diff --git a/basis/ui/gadgets/theme/active-tab-middle.tiff b/basis/ui/gadgets/theme/active-tab-middle.tiff
new file mode 100644 (file)
index 0000000..0f40e93
Binary files /dev/null and b/basis/ui/gadgets/theme/active-tab-middle.tiff differ
diff --git a/basis/ui/gadgets/theme/active-tab-right.tiff b/basis/ui/gadgets/theme/active-tab-right.tiff
new file mode 100644 (file)
index 0000000..b56dc01
Binary files /dev/null and b/basis/ui/gadgets/theme/active-tab-right.tiff differ
diff --git a/basis/ui/gadgets/theme/button-clicked-left.tiff b/basis/ui/gadgets/theme/button-clicked-left.tiff
new file mode 100644 (file)
index 0000000..cb6f760
Binary files /dev/null and b/basis/ui/gadgets/theme/button-clicked-left.tiff differ
diff --git a/basis/ui/gadgets/theme/button-clicked-middle.tiff b/basis/ui/gadgets/theme/button-clicked-middle.tiff
new file mode 100644 (file)
index 0000000..7a75ef9
Binary files /dev/null and b/basis/ui/gadgets/theme/button-clicked-middle.tiff differ
diff --git a/basis/ui/gadgets/theme/button-clicked-right.tiff b/basis/ui/gadgets/theme/button-clicked-right.tiff
new file mode 100644 (file)
index 0000000..496cb1f
Binary files /dev/null and b/basis/ui/gadgets/theme/button-clicked-right.tiff differ
diff --git a/basis/ui/gadgets/theme/button-left.tiff b/basis/ui/gadgets/theme/button-left.tiff
new file mode 100644 (file)
index 0000000..ed96031
Binary files /dev/null and b/basis/ui/gadgets/theme/button-left.tiff differ
diff --git a/basis/ui/gadgets/theme/button-middle.tiff b/basis/ui/gadgets/theme/button-middle.tiff
new file mode 100644 (file)
index 0000000..d22f9ef
Binary files /dev/null and b/basis/ui/gadgets/theme/button-middle.tiff differ
diff --git a/basis/ui/gadgets/theme/button-right.tiff b/basis/ui/gadgets/theme/button-right.tiff
new file mode 100644 (file)
index 0000000..6a24a22
Binary files /dev/null and b/basis/ui/gadgets/theme/button-right.tiff differ
diff --git a/basis/ui/gadgets/theme/checkbox-clicked.tiff b/basis/ui/gadgets/theme/checkbox-clicked.tiff
new file mode 100644 (file)
index 0000000..57026d4
Binary files /dev/null and b/basis/ui/gadgets/theme/checkbox-clicked.tiff differ
diff --git a/basis/ui/gadgets/theme/checkbox-set-clicked.tiff b/basis/ui/gadgets/theme/checkbox-set-clicked.tiff
new file mode 100644 (file)
index 0000000..b8d5ce5
Binary files /dev/null and b/basis/ui/gadgets/theme/checkbox-set-clicked.tiff differ
diff --git a/basis/ui/gadgets/theme/checkbox-set.tiff b/basis/ui/gadgets/theme/checkbox-set.tiff
new file mode 100644 (file)
index 0000000..6f737a7
Binary files /dev/null and b/basis/ui/gadgets/theme/checkbox-set.tiff differ
diff --git a/basis/ui/gadgets/theme/checkbox.tiff b/basis/ui/gadgets/theme/checkbox.tiff
new file mode 100644 (file)
index 0000000..570d9e4
Binary files /dev/null and b/basis/ui/gadgets/theme/checkbox.tiff differ
diff --git a/basis/ui/gadgets/theme/clear-button-clicked.tiff b/basis/ui/gadgets/theme/clear-button-clicked.tiff
new file mode 100644 (file)
index 0000000..52e0e4a
Binary files /dev/null and b/basis/ui/gadgets/theme/clear-button-clicked.tiff differ
diff --git a/basis/ui/gadgets/theme/clear-button.tiff b/basis/ui/gadgets/theme/clear-button.tiff
new file mode 100644 (file)
index 0000000..5e66e39
Binary files /dev/null and b/basis/ui/gadgets/theme/clear-button.tiff differ
diff --git a/basis/ui/gadgets/theme/horizontal-scroller-handle-grip.tiff b/basis/ui/gadgets/theme/horizontal-scroller-handle-grip.tiff
new file mode 100644 (file)
index 0000000..74ca199
Binary files /dev/null and b/basis/ui/gadgets/theme/horizontal-scroller-handle-grip.tiff differ
diff --git a/basis/ui/gadgets/theme/horizontal-scroller-handle-left.tiff b/basis/ui/gadgets/theme/horizontal-scroller-handle-left.tiff
new file mode 100644 (file)
index 0000000..2f6955b
Binary files /dev/null and b/basis/ui/gadgets/theme/horizontal-scroller-handle-left.tiff differ
diff --git a/basis/ui/gadgets/theme/horizontal-scroller-handle-middle.tiff b/basis/ui/gadgets/theme/horizontal-scroller-handle-middle.tiff
new file mode 100644 (file)
index 0000000..f8fd896
Binary files /dev/null and b/basis/ui/gadgets/theme/horizontal-scroller-handle-middle.tiff differ
diff --git a/basis/ui/gadgets/theme/horizontal-scroller-handle-right.tiff b/basis/ui/gadgets/theme/horizontal-scroller-handle-right.tiff
new file mode 100644 (file)
index 0000000..04049eb
Binary files /dev/null and b/basis/ui/gadgets/theme/horizontal-scroller-handle-right.tiff differ
diff --git a/basis/ui/gadgets/theme/horizontal-scroller-left.tiff b/basis/ui/gadgets/theme/horizontal-scroller-left.tiff
new file mode 100644 (file)
index 0000000..2054c1b
Binary files /dev/null and b/basis/ui/gadgets/theme/horizontal-scroller-left.tiff differ
diff --git a/basis/ui/gadgets/theme/horizontal-scroller-leftarrow-clicked.tiff b/basis/ui/gadgets/theme/horizontal-scroller-leftarrow-clicked.tiff
new file mode 100644 (file)
index 0000000..311be25
Binary files /dev/null and b/basis/ui/gadgets/theme/horizontal-scroller-leftarrow-clicked.tiff differ
diff --git a/basis/ui/gadgets/theme/horizontal-scroller-middle.tiff b/basis/ui/gadgets/theme/horizontal-scroller-middle.tiff
new file mode 100644 (file)
index 0000000..0aa4280
Binary files /dev/null and b/basis/ui/gadgets/theme/horizontal-scroller-middle.tiff differ
diff --git a/basis/ui/gadgets/theme/horizontal-scroller-right-disabled.tiff b/basis/ui/gadgets/theme/horizontal-scroller-right-disabled.tiff
new file mode 100644 (file)
index 0000000..a5b162a
Binary files /dev/null and b/basis/ui/gadgets/theme/horizontal-scroller-right-disabled.tiff differ
diff --git a/basis/ui/gadgets/theme/horizontal-scroller-right.tiff b/basis/ui/gadgets/theme/horizontal-scroller-right.tiff
new file mode 100644 (file)
index 0000000..c6942d7
Binary files /dev/null and b/basis/ui/gadgets/theme/horizontal-scroller-right.tiff differ
diff --git a/basis/ui/gadgets/theme/horizontal-scroller-rightarrow-clicked.tiff b/basis/ui/gadgets/theme/horizontal-scroller-rightarrow-clicked.tiff
new file mode 100644 (file)
index 0000000..0efc9ae
Binary files /dev/null and b/basis/ui/gadgets/theme/horizontal-scroller-rightarrow-clicked.tiff differ
diff --git a/basis/ui/gadgets/theme/inactive-tab-left.tiff b/basis/ui/gadgets/theme/inactive-tab-left.tiff
new file mode 100644 (file)
index 0000000..164c008
Binary files /dev/null and b/basis/ui/gadgets/theme/inactive-tab-left.tiff differ
diff --git a/basis/ui/gadgets/theme/inactive-tab-middle.tiff b/basis/ui/gadgets/theme/inactive-tab-middle.tiff
new file mode 100644 (file)
index 0000000..3bdff5c
Binary files /dev/null and b/basis/ui/gadgets/theme/inactive-tab-middle.tiff differ
diff --git a/basis/ui/gadgets/theme/inactive-tab-right.tiff b/basis/ui/gadgets/theme/inactive-tab-right.tiff
new file mode 100644 (file)
index 0000000..c0ddac6
Binary files /dev/null and b/basis/ui/gadgets/theme/inactive-tab-right.tiff differ
diff --git a/basis/ui/gadgets/theme/labeled-block-bottom-left.tiff b/basis/ui/gadgets/theme/labeled-block-bottom-left.tiff
new file mode 100644 (file)
index 0000000..4ac0886
Binary files /dev/null and b/basis/ui/gadgets/theme/labeled-block-bottom-left.tiff differ
diff --git a/basis/ui/gadgets/theme/labeled-block-bottom-middle.tiff b/basis/ui/gadgets/theme/labeled-block-bottom-middle.tiff
new file mode 100644 (file)
index 0000000..35440af
Binary files /dev/null and b/basis/ui/gadgets/theme/labeled-block-bottom-middle.tiff differ
diff --git a/basis/ui/gadgets/theme/labeled-block-bottom-right.tiff b/basis/ui/gadgets/theme/labeled-block-bottom-right.tiff
new file mode 100644 (file)
index 0000000..039a252
Binary files /dev/null and b/basis/ui/gadgets/theme/labeled-block-bottom-right.tiff differ
diff --git a/basis/ui/gadgets/theme/labeled-block-left-edge.tiff b/basis/ui/gadgets/theme/labeled-block-left-edge.tiff
new file mode 100644 (file)
index 0000000..e030f02
Binary files /dev/null and b/basis/ui/gadgets/theme/labeled-block-left-edge.tiff differ
diff --git a/basis/ui/gadgets/theme/labeled-block-right-edge.tiff b/basis/ui/gadgets/theme/labeled-block-right-edge.tiff
new file mode 100644 (file)
index 0000000..695a7fb
Binary files /dev/null and b/basis/ui/gadgets/theme/labeled-block-right-edge.tiff differ
diff --git a/basis/ui/gadgets/theme/labeled-block-title-left.tiff b/basis/ui/gadgets/theme/labeled-block-title-left.tiff
new file mode 100644 (file)
index 0000000..16546dd
Binary files /dev/null and b/basis/ui/gadgets/theme/labeled-block-title-left.tiff differ
diff --git a/basis/ui/gadgets/theme/labeled-block-title-middle.tiff b/basis/ui/gadgets/theme/labeled-block-title-middle.tiff
new file mode 100644 (file)
index 0000000..ea54e94
Binary files /dev/null and b/basis/ui/gadgets/theme/labeled-block-title-middle.tiff differ
diff --git a/basis/ui/gadgets/theme/labeled-block-title-right.tiff b/basis/ui/gadgets/theme/labeled-block-title-right.tiff
new file mode 100644 (file)
index 0000000..0b2cb34
Binary files /dev/null and b/basis/ui/gadgets/theme/labeled-block-title-right.tiff differ
diff --git a/basis/ui/gadgets/theme/radio-clicked.tiff b/basis/ui/gadgets/theme/radio-clicked.tiff
new file mode 100644 (file)
index 0000000..3092f8b
Binary files /dev/null and b/basis/ui/gadgets/theme/radio-clicked.tiff differ
diff --git a/basis/ui/gadgets/theme/radio-set-clicked.tiff b/basis/ui/gadgets/theme/radio-set-clicked.tiff
new file mode 100644 (file)
index 0000000..21b2813
Binary files /dev/null and b/basis/ui/gadgets/theme/radio-set-clicked.tiff differ
diff --git a/basis/ui/gadgets/theme/radio-set.tiff b/basis/ui/gadgets/theme/radio-set.tiff
new file mode 100644 (file)
index 0000000..291b464
Binary files /dev/null and b/basis/ui/gadgets/theme/radio-set.tiff differ
diff --git a/basis/ui/gadgets/theme/radio.tiff b/basis/ui/gadgets/theme/radio.tiff
new file mode 100644 (file)
index 0000000..3494443
Binary files /dev/null and b/basis/ui/gadgets/theme/radio.tiff differ
diff --git a/basis/ui/gadgets/theme/theme.factor b/basis/ui/gadgets/theme/theme.factor
deleted file mode 100644 (file)
index 7dabd99..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
-! Copyright (C) 2006, 2007 Alex Chapman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: arrays kernel sequences io.styles ui.gadgets ui.render
-colors colors.gray accessors ;
-QUALIFIED: colors
-IN: ui.gadgets.theme
-
-: solid-interior ( gadget color -- gadget )
-    <solid> >>interior ; inline
-
-: solid-boundary ( gadget color -- gadget )
-    <solid> >>boundary ; inline
-
-: faint-boundary ( gadget -- gadget )
-    colors:gray solid-boundary ; inline
-
-: selection-color ( -- color ) light-purple ;
-
-: plain-gradient ( -- gradient )
-    {
-        T{ gray f 0.94 1.0 }
-        T{ gray f 0.83 1.0 }
-        T{ gray f 0.83 1.0 }
-        T{ gray f 0.62 1.0 }
-    } <gradient> ;
-
-: rollover-gradient ( -- gradient )
-    {
-        T{ gray f 1.0  1.0 }
-        T{ gray f 0.9  1.0 }
-        T{ gray f 0.9  1.0 }
-        T{ gray f 0.75 1.0 }
-    } <gradient> ;
-
-: pressed-gradient ( -- gradient )
-    {
-        T{ gray f 0.75 1.0 }
-        T{ gray f 0.9  1.0 }
-        T{ gray f 0.9  1.0 }
-        T{ gray f 1.0  1.0 }
-    } <gradient> ;
-
-: selected-gradient ( -- gradient )
-    {
-        T{ gray f 0.65 1.0 }
-        T{ gray f 0.8  1.0 }
-        T{ gray f 0.8  1.0 }
-        T{ gray f 1.0  1.0 }
-    } <gradient> ;
-
-: lowered-gradient ( -- gradient )
-    {
-        T{ gray f 0.37 1.0 }
-        T{ gray f 0.43 1.0 }
-        T{ gray f 0.5  1.0 }
-    } <gradient> ;
-
-CONSTANT: sans-serif-font { "sans-serif" plain 12 }
-
-CONSTANT: monospace-font { "monospace" plain 12 }
diff --git a/basis/ui/gadgets/theme/vertical-scroller-bottom-disabled.tiff b/basis/ui/gadgets/theme/vertical-scroller-bottom-disabled.tiff
new file mode 100644 (file)
index 0000000..b4b2394
Binary files /dev/null and b/basis/ui/gadgets/theme/vertical-scroller-bottom-disabled.tiff differ
diff --git a/basis/ui/gadgets/theme/vertical-scroller-bottom.tiff b/basis/ui/gadgets/theme/vertical-scroller-bottom.tiff
new file mode 100644 (file)
index 0000000..1e159ea
Binary files /dev/null and b/basis/ui/gadgets/theme/vertical-scroller-bottom.tiff differ
diff --git a/basis/ui/gadgets/theme/vertical-scroller-downarrow-clicked.tiff b/basis/ui/gadgets/theme/vertical-scroller-downarrow-clicked.tiff
new file mode 100644 (file)
index 0000000..8a06d05
Binary files /dev/null and b/basis/ui/gadgets/theme/vertical-scroller-downarrow-clicked.tiff differ
diff --git a/basis/ui/gadgets/theme/vertical-scroller-handle-bottom.tiff b/basis/ui/gadgets/theme/vertical-scroller-handle-bottom.tiff
new file mode 100644 (file)
index 0000000..f924a5d
Binary files /dev/null and b/basis/ui/gadgets/theme/vertical-scroller-handle-bottom.tiff differ
diff --git a/basis/ui/gadgets/theme/vertical-scroller-handle-grip.tiff b/basis/ui/gadgets/theme/vertical-scroller-handle-grip.tiff
new file mode 100644 (file)
index 0000000..97b82bb
Binary files /dev/null and b/basis/ui/gadgets/theme/vertical-scroller-handle-grip.tiff differ
diff --git a/basis/ui/gadgets/theme/vertical-scroller-handle-middle.tiff b/basis/ui/gadgets/theme/vertical-scroller-handle-middle.tiff
new file mode 100644 (file)
index 0000000..72b2f9f
Binary files /dev/null and b/basis/ui/gadgets/theme/vertical-scroller-handle-middle.tiff differ
diff --git a/basis/ui/gadgets/theme/vertical-scroller-handle-top.tiff b/basis/ui/gadgets/theme/vertical-scroller-handle-top.tiff
new file mode 100644 (file)
index 0000000..7440525
Binary files /dev/null and b/basis/ui/gadgets/theme/vertical-scroller-handle-top.tiff differ
diff --git a/basis/ui/gadgets/theme/vertical-scroller-middle.tiff b/basis/ui/gadgets/theme/vertical-scroller-middle.tiff
new file mode 100644 (file)
index 0000000..d177ae7
Binary files /dev/null and b/basis/ui/gadgets/theme/vertical-scroller-middle.tiff differ
diff --git a/basis/ui/gadgets/theme/vertical-scroller-top.tiff b/basis/ui/gadgets/theme/vertical-scroller-top.tiff
new file mode 100644 (file)
index 0000000..f6017cd
Binary files /dev/null and b/basis/ui/gadgets/theme/vertical-scroller-top.tiff differ
diff --git a/basis/ui/gadgets/theme/vertical-scroller-uparrow-clicked.tiff b/basis/ui/gadgets/theme/vertical-scroller-uparrow-clicked.tiff
new file mode 100644 (file)
index 0000000..4ee2ef4
Binary files /dev/null and b/basis/ui/gadgets/theme/vertical-scroller-uparrow-clicked.tiff differ
index 9ed5bf422394dbf5ec0026913f8d1099732ee988..b83865fd52f213479da54203ab05a65ad03b3254 100644 (file)
@@ -15,7 +15,7 @@ HELP: track
 
 HELP: <track>
 { $values { "orientation" "an orientation specifier" } { "track" "a new " { $link track } } }
-{ $description "Creates a new track which lays out children along the given axis. Children are laid out vertically if the orientation is " { $snippet "{ 0 1 }" } " and horizontally if the orientation is " { $snippet "{ 1 0 }" } "." } ; 
+{ $description "Creates a new track which lays out children along the given orientation, either " { $link horizontal } " or " { $link vertical } "." } ;
 
 HELP: track-add
 { $values { "gadget" gadget } { "track" track } { "constraint" "a number between 0 and 1, or " { $link f } } }
index 0ce348e9b711ec2a194dcc66ec39fb06a64ba8f0..844cb375d129440ba886ddfef07fd57ad8b765eb 100644 (file)
@@ -1,29 +1,29 @@
 USING: kernel ui.gadgets ui.gadgets.tracks tools.test
-       math.geometry.rect accessors ;
+math.rectangles accessors sequences namespaces ;
 IN: ui.gadgets.tracks.tests
 
 [ { 100 100 } ] [
-    { 0 1 } <track>
+    vertical <track>
         <gadget> { 100 100 } >>dim 1 track-add
     pref-dim    
 ] unit-test
 
 [ { 100 110 } ] [
-    { 0 1 } <track>
+    vertical <track>
         <gadget> { 10 10 } >>dim f track-add
         <gadget> { 100 100 } >>dim 1 track-add
     pref-dim
 ] unit-test
 
 [ { 10 10 } ] [
-    { 0 1 } <track>
+    vertical <track>
         <gadget> { 10 10 } >>dim 1 track-add
         <gadget> { 10 10 } >>dim 0 track-add
     pref-dim
 ] unit-test
 
 [ { 10 30 } ] [
-    { 0 1 } <track>
+    vertical <track>
         <gadget> { 10 10 } >>dim f track-add
         <gadget> { 10 10 } >>dim f track-add
         <gadget> { 10 10 } >>dim f track-add
@@ -31,10 +31,43 @@ IN: ui.gadgets.tracks.tests
 ] unit-test
 
 [ { 10 40 } ] [
-    { 0 1 } <track>
+    vertical <track>
         { 5 5 } >>gap
         <gadget> { 10 10 } >>dim f track-add
         <gadget> { 10 10 } >>dim f track-add
         <gadget> { 10 10 } >>dim f track-add
     pref-dim
-] unit-test
\ No newline at end of file
+] unit-test
+
+[ V{ { 10 10 } { 10 80 } { 10 10 } } ] [
+    vertical <track>
+        0 >>fill
+        <gadget> { 10 10 } >>dim f track-add
+        <gadget> { 10 10 } >>dim 1 track-add
+        <gadget> { 10 10 } >>dim f track-add
+    { 10 100 } >>dim
+    [ layout ] [ children>> [ dim>> ] map ] bi
+] unit-test
+
+[ ] [
+    vertical <track>
+        0 >>fill
+        <gadget> { 10 10 } >>dim f track-add
+        <gadget> { 10 10 } >>dim dup "g1" set 1/2 track-add
+        <gadget> { 10 10 } >>dim dup "g2" set f track-add
+        <gadget> { 10 10 } >>dim 1/2 track-add
+        <gadget> { 10 10 } >>dim f track-add
+    { 10 100 } >>dim
+    "track" set
+] unit-test
+
+[ V{ { 10 10 } { 10 35 } { 10 10 } { 10 35 } { 10 10 } } ]
+[ "track" get [ layout ] [ children>> [ dim>> ] map ] bi ] unit-test
+
+[ V{ { 10 10 } { 10 80 } { 10 10 } } ] [
+    "g1" get unparent
+    "g2" get unparent
+    "track" get [ layout ] [ children>> [ dim>> ] map ] bi
+] unit-test
+
+[ 3 ] [ "track" get sizes>> length ] unit-test
\ No newline at end of file
index aca2d7549e38d58f3702aff6eebce6595960be11..92268690ace27ece968b1c93daf24a2d928e647e 100644 (file)
@@ -1,42 +1,40 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors io kernel namespaces fry
-math math.vectors math.geometry.rect math.order
-sequences words ui.gadgets ui.gadgets.packs ;
-
+USING: accessors io kernel namespaces fry math math.vectors
+math.rectangles math.order sequences words ui.gadgets ui.gadgets.packs
+ui.gadgets.packs.private combinators ;
 IN: ui.gadgets.tracks
 
 TUPLE: track < pack sizes ;
 
-: normalized-sizes ( track -- seq )
-    sizes>> dup sift sum '[ dup [ _ / ] when ] map ;
-
-: init-track ( track -- track )
-    init-gadget
-    V{ } clone >>sizes
-    1 >>fill ;
-
 : new-track ( orientation class -- track )
     new
-        init-track
-        swap >>orientation ;
+        1 >>fill
+        V{ } clone >>sizes
+        swap >>orientation ; inline
 
 : <track> ( orientation -- track ) track new-track ;
 
+<PRIVATE
+
+: normalized-sizes ( track -- seq )
+    sizes>> dup sift sum '[ dup [ _ / ] when ] map ;
+
 : alloted-dim ( track -- dim )
     [ children>> ] [ sizes>> ] bi { 0 0 }
-    [ [ drop { 0 0 } ] [ pref-dim ] if v+ ] 2reduce ;
-
-: gap-dim ( track -- dim )
-    [ gap>> ] [ children>> length 1 [-] ] bi v*n ;
+    [ [ drop ] [ pref-dim v+ ] if ] 2reduce ;
 
 : available-dim ( track -- dim )
     [ dim>> ] [ alloted-dim ] bi v- ;
 
 : track-layout ( track -- sizes )
-    [ [ available-dim ] [ gap-dim ] bi v- ]
-    [ children>> ] [ normalized-sizes ] tri
-    [ [ over n*v ] [ pref-dim ] ?if ] 2map nip ;
+    {
+        [ children>> pref-dims ]
+        [ normalized-sizes ]
+        [ [ available-dim ] [ gap-dim ] bi v- ]
+        [ orientation>> ]
+    } cleave
+    '[ [ _ n*v _ set-axis ] when* ] 2map ;
 
 M: track layout* ( track -- ) dup track-layout pack-layout ;
 
@@ -57,14 +55,12 @@ M: track pref-dim* ( gadget -- dim )
     tri
     set-axis ;
 
+PRIVATE>
+
 : track-add ( track gadget constraint -- track )
     pick sizes>> push add-gadget ;
 
-: track-remove ( track gadget -- track )
-    dupd dup [
-        [ swap children>> index ]
-        [ unparent sizes>> ] 2bi
-        delete-nth 
-    ] [ 2drop ] if ;
+M: track remove-gadget
+    [ [ children>> index ] keep sizes>> delete-nth ] [ call-next-method ] 2bi ;
 
-: clear-track ( track -- ) V{ } clone >>sizes clear-gadget ;
+: clear-track ( track -- ) [ sizes>> delete-all ] [ clear-gadget ] bi ;
index 73782a1e3d804951e15254f5b6797aeeaebd4eae..c14c7f01fb1ea83ac5f89ca3b74de4b9125df95c 100644 (file)
@@ -2,57 +2,39 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays ui.gadgets ui.gadgets.borders
 kernel math namespaces sequences models math.vectors
-math.geometry.rect ;
+math.rectangles ;
 IN: ui.gadgets.viewports
 
-CONSTANT: viewport-gap { 3 3 }
-CONSTANT: scroller-border { 1 1 }
-
-TUPLE: viewport < gadget ;
+TUPLE: viewport < gadget { constraint initial: { 1 1 } } ;
 
 : find-viewport ( gadget -- viewport )
     [ viewport? ] find-parent ;
 
-: viewport-padding ( -- padding )
-    viewport-gap 2 v*n scroller-border v+ ;
-
-: viewport-dim ( viewport -- dim )
-    gadget-child pref-dim viewport-padding v+ ;
-
 : <viewport> ( content model -- viewport )
-    viewport new-gadget
+    viewport new
         swap >>model
         t >>clipped?
         swap add-gadget ;
 
 M: viewport layout*
-    [ gadget-child ] [
-        [ dim>> viewport-padding v- ]
-        [ gadget-child pref-dim ]
-        bi vmax
-    ] bi >>dim drop ;
+    [ gadget-child ]
+    [ [ dim>> ] [ gadget-child pref-dim ] bi vmax ] bi >>dim drop ;
 
 M: viewport focusable-child*
     gadget-child ;
 
-M: viewport pref-dim* viewport-dim ;
-
 : scroller-value ( scroller -- loc )
-    model>> range-value [ >fixnum ] map ;
+    model>> range-value [ >integer ] map ;
 
 M: viewport model-changed
     nip
     [ relayout-1 ]
     [
         [ gadget-child ]
-        [
-            scroller-value vneg
-            viewport-gap v+
-            scroller-border v+
-        ] bi
-        >>loc drop
+        [ scroller-value vneg ]
+        [ constraint>> ]
+        tri v* >>loc drop
     ] bi ;
 
 : visible-dim ( gadget -- dim )
-    dup parent>> viewport?
-    [ parent>> rect-dim viewport-gap 2 v*n v- ] [ dim>> ] if ;
+    dup parent>> viewport? [ parent>> ] when dim>> ;
index 60e4e58ed5d7e9539e24019d887927ffb0f505b5..e3c1226f2216c8e5477c75ffc5aba511f9f5666a 100644 (file)
@@ -1,5 +1,6 @@
-USING: ui.gadgets ui.render ui.gestures ui.backend help.markup
-help.syntax models opengl strings ;
+USING: ui.gadgets ui.render ui.text ui.text.private
+ui.gestures ui.backend help.markup help.syntax
+models opengl strings ;
 IN: ui.gadgets.worlds
 
 HELP: user-input
@@ -26,20 +27,21 @@ HELP: flush-gl-context
 { $description "Ensures all GL rendering calls made to an OpenGL context finish rendering to the screen. This word is called automatically by the UI after drawing a " { $link world } "." } ;
 
 HELP: focus-path
-{ $values { "world" world } { "seq" "a new sequence" } }
-{ $description "If the top-level window containing the world has focus, outputs a sequence of parents of the currently focused gadget, otherwise outputs " { $link f } "." }
+{ $values { "gadget" gadget } { "seq" "a new sequence" } }
+{ $description "If the gadget has focus, outputs a sequence of parents of the currently focused gadget, otherwise outputs " { $link f } "." }
 { $notes "This word is used to avoid sending " { $link gain-focus } " gestures to a gadget which requests focus on an unfocused top-level window, so that, for instance, a text editing caret does not appear in this case." } ;
 
 HELP: world
 { $class-description "A gadget which appears at the top of the gadget hieararchy, and in turn may be displayed in a native window. Worlds have the following slots:"
     { $list
         { { $snippet "active?" } " - if set to " { $link f } ", the world will not be drawn. This slot is set to " { $link f } " if an error is thrown while drawing the world; this prevents multiple debugger windows from being shown." }
-        { { $snippet "glass" } " - a glass pane in front of the primary gadget, used to implement behaviors such as popup menus which are hidden when the mouse is clicked outside the menu." }
+        { { $snippet "layers" } " - a sequence of glass panes in front of the primary gadget, used to implement behaviors such as popup menus which are hidden when the mouse is clicked outside the menu. See " { $link "ui.gadgets.glass" } "." }
         { { $snippet "title" } " - a string to be displayed in the title bar of the native window containing the world." }
         { { $snippet "status" } " - a " { $link model } " holding a string to be displayed in the world's status bar." }
+        { { $snippet "status-owner" } " - the gadget that displayed the most recent status message." }
         { { $snippet "focus" } " - the current owner of the keyboard focus in the world." }
         { { $snippet "focused?" } " - a boolean indicating if the native window containing the world has keyboard focus." }
-        { { $snippet "fonts" } " - a hashtable mapping font instances to vectors of " { $link sprite } " instances." }
+        { { $snippet "fonts" } " - a hashtable used by the " { $link font-renderer } "." }
         { { $snippet "handle" } " - a backend-specific native handle representing the native window containing the world, or " { $link f } " if the world is not grafted." }
         { { $snippet "window-loc" } " - the on-screen location of the native window containing the world. The co-ordinate system here is backend-specific." }
     }
index 34ddc1776751143b262f8f88ae501b5e515acadd..f738a8cff4b79f91d53734b30ccbac0547ea23eb 100644 (file)
@@ -48,14 +48,12 @@ IN: ui.gadgets.worlds.tests
 
 TUPLE: focusing < gadget ;
 
-: <focusing>
-    focusing new-gadget ;
+: <focusing> ( -- gadget ) focusing new ;
 
 TUPLE: focus-test < gadget ;
 
-: <focus-test>
-    focus-test new-gadget
-    dup <focusing> add-gadget drop ;
+: <focus-test> ( -- gadget )
+    focus-test new <focusing> add-gadget ;
 
 M: focus-test focusable-child* gadget-child ;
 
index f57fb60bcd93e8d59c3f6a1d429b0c7771833cc2..ccfa83334b202079c81c1500535c27135a7fb13c 100644 (file)
@@ -1,27 +1,34 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs continuations kernel math models
-namespaces opengl sequences io combinators fry math.vectors
-ui.gadgets ui.gestures ui.render ui.backend ui.gadgets.tracks
-math.geometry.rect ;
+call namespaces opengl sequences io combinators
+combinators.short-circuit fry math.vectors math.rectangles cache
+ui.gadgets ui.gestures ui.render ui.text ui.text.private
+ui.backend ui.gadgets.tracks ui.commands ;
 IN: ui.gadgets.worlds
 
 TUPLE: world < track
 active? focused?
-glass
-title status
-fonts handle
+layers
+title status status-owner
+text-handle handle images
 window-loc ;
 
 : find-world ( gadget -- world/f ) [ world? ] find-parent ;
 
 : show-status ( string/f gadget -- )
-    find-world dup [
-        status>> dup [ set-model ] [ 2drop ] if
+    dup find-world dup [
+        dup status>> [
+            [ (>>status-owner) ] [ status>> set-model ] bi
+        ] [ 3drop ] if
+    ] [ 3drop ] if ;
+
+: hide-status ( gadget -- )
+    dup find-world dup [
+        [ status-owner>> eq? ] keep
+        '[ f _ [ (>>status-owner) ] [ status>> set-model ] 2bi ] when
     ] [ 2drop ] if ;
 
-: hide-status ( gadget -- ) f swap show-status ;
-
 ERROR: no-world-found ;
 
 : find-gl-context ( gadget -- )
@@ -39,38 +46,48 @@ M: world request-focus-on ( child gadget -- )
     [ 2drop ] [ dup focused?>> (request-focus) ] if ;
 
 : new-world ( gadget title status class -- world )
-    { 0 1 } swap new-track
+    vertical swap new-track
         t >>root?
         t >>active?
-        H{ } clone >>fonts
         { 0 0 } >>window-loc
         swap >>status
         swap >>title
         swap 1 track-add
+    dup init-text-rendering
     dup request-focus ;
 
 : <world> ( gadget title status -- world )
     world new-world ;
 
+: as-big-as-possible ( world gadget -- )
+    dup [ { 0 0 } >>loc over dim>> >>dim ] when 2drop ; inline
+
 M: world layout*
-    dup call-next-method
-    dup glass>> [
-        [ dup rect-dim ] dip (>>dim)
-    ] when* drop ;
+    [ call-next-method ]
+    [ dup layers>> [ as-big-as-possible ] with each ] bi ;
 
 M: world focusable-child* gadget-child ;
 
 M: world children-on nip children>> ;
 
+M: world remove-gadget
+    2dup layers>> memq?
+    [ layers>> delq ] [ call-next-method ] if ;
+
 : (draw-world) ( world -- )
     dup handle>> [
-        [ dup init-gl ] keep draw-gadget
+        {
+            [ init-gl ]
+            [ draw-gadget ]
+            [ finish-text-rendering ]
+            [ images>> [ purge-cache ] when* ]
+        } cleave
     ] with-gl-context ;
 
 : draw-world? ( world -- ? )
     #! We don't draw deactivated worlds, or those with 0 size.
     #! On Windows, the latter case results in GL errors.
-    [ active?>> ] [ handle>> ] [ dim>> [ 0 > ] all? ] tri and and ;
+    { [ active?>> ] [ handle>> ] [ dim>> [ 0 > ] all? ] } 1&& ;
 
 TUPLE: world-error error world ;
 
@@ -79,36 +96,34 @@ C: <world-error> world-error
 SYMBOL: ui-error-hook
 
 : ui-error ( error -- )
-    ui-error-hook get [ call ] [ die ] if* ;
+    ui-error-hook get [ call( error -- ) ] [ die drop ] if* ;
 
 ui-error-hook [ [ rethrow ] ] initialize
 
 : draw-world ( world -- )
     dup draw-world? [
         dup world [
-            [
-                (draw-world)
-            ] [
+            [ (draw-world) ] [
                 over <world-error> ui-error
                 f >>active? drop
             ] recover
         ] with-variable
-    ] [
-        drop
-    ] if ;
-
-world H{
-    { T{ key-down f { C+ } "x" } [ T{ cut-action } send-action ] }
-    { T{ key-down f { C+ } "c" } [ T{ copy-action } send-action ] }
-    { T{ key-down f { C+ } "v" } [ T{ paste-action } send-action ] }
-    { T{ key-down f { C+ } "a" } [ T{ select-all-action } send-action ] }
+    ] [ drop ] if ;
+
+world
+action-gestures [
+    [ [ { C+ } ] dip f <key-down> ]
+    [ '[ _ send-action ] ]
+    bi*
+] H{ } assoc-map-as
+H{
     { T{ button-down f { C+ } 1 } [ drop T{ button-down f f 3 } button-gesture ] }
     { T{ button-down f { A+ } 1 } [ drop T{ button-down f f 2 } button-gesture ] }
     { T{ button-down f { M+ } 1 } [ drop T{ button-down f f 2 } button-gesture ] }
     { T{ button-up f { C+ } 1 } [ drop T{ button-up f f 3 } button-gesture ] }
     { T{ button-up f { A+ } 1 } [ drop T{ button-up f f 2 } button-gesture ] }
     { T{ button-up f { M+ } 1 } [ drop T{ button-up f f 2 } button-gesture ] }
-} set-gestures
+} assoc-union set-gestures
 
 PREDICATE: specific-button-up < button-up #>> ;
 PREDICATE: specific-button-down < button-down #>> ;
index b750e3c2a478dbdb911911af81a90c3e0b610ac8..fdcede7f235ef42c14e85948c09e49d1443e8e4c 100644 (file)
@@ -1,17 +1,21 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors ui.gadgets kernel ;
-
+USING: accessors kernel ui.gadgets ui.baseline-alignment ;
 IN: ui.gadgets.wrappers
 
 TUPLE: wrapper < gadget ;
 
-: new-wrapper ( child class -- wrapper ) new-gadget swap add-gadget ;
+: new-wrapper ( child class -- wrapper )
+    new swap add-gadget ; inline
+
+: <wrapper> ( child -- wrapper ) wrapper new-wrapper ;
+
+M: wrapper pref-dim* gadget-child pref-dim ;
 
-: <wrapper> ( child -- border ) wrapper new-wrapper ;
+M: wrapper baseline gadget-child baseline ;
 
-M: wrapper pref-dim* ( wrapper -- dim ) gadget-child pref-dim ;
+M: wrapper cap-height gadget-child cap-height ;
 
-M: wrapper layout* ( wrapper -- ) [ dim>> ] [ gadget-child ] bi (>>dim) ;
+M: wrapper layout* [ gadget-child ] [ dim>> ] bi >>dim drop ;
 
-M: wrapper focusable-child* ( wrapper -- child/t ) gadget-child ;
+M: wrapper focusable-child* gadget-child ;
index f6495a14c3297f4dcc8c6ec5187dac8d7c084599..ebffb0bfbc8888f354328be505dee45980454504 100644 (file)
@@ -1,4 +1,4 @@
-USING: ui.gadgets ui.gadgets.worlds help.markup help.syntax
+USING: ui.gadgets help.markup help.syntax
 hashtables strings kernel system ;
 IN: ui.gestures
 
@@ -23,7 +23,7 @@ HELP: propagate-gesture
 
 HELP: motion
 { $class-description "Mouse motion gesture." }
-{ $examples { $code "T{ motion }" } } ;
+{ $examples { $code "motion" } } ;
 
 HELP: drag
 { $class-description "Mouse drag gesture. The " { $snippet "#" } " slot is either set to a mouse button number, or " { $link f } " indicating no specific button is expected." } ;
@@ -48,43 +48,43 @@ HELP: button-down
 
 HELP: mouse-scroll
 { $class-description "Scroll wheel motion gesture. When this gesture is sent, the " { $link scroll-direction } " global variable is set to a direction vector." }
-{ $examples { $code "T{ mouse-scroll }" } } ;
+{ $examples { $code "mouse-scroll" } } ;
 
 HELP: mouse-enter
 { $class-description "Gesture sent when the mouse enters the bounds of a gadget." }
-{ $examples { $code "T{ mouse-enter }" } } ;
+{ $examples { $code "mouse-enter" } } ;
 
 HELP: mouse-leave
 { $class-description "Gesture sent when the mouse leaves the bounds of a gadget." }
-{ $examples { $code "T{ mouse-leave }" } } ;
+{ $examples { $code "mouse-leave" } } ;
 
 HELP: gain-focus
 { $class-description "Gesture sent when a gadget gains keyboard focus." }
-{ $examples { $code "T{ gain-focus }" } } ;
+{ $examples { $code "gain-focus" } } ;
 
 HELP: lose-focus
 { $class-description "Gesture sent when a gadget loses keyboard focus." }
-{ $examples { $code "T{ lose-focus }" } } ;
+{ $examples { $code "lose-focus" } } ;
 
 HELP: cut-action
 { $class-description "Gesture sent when the " { $emphasis "cut" } " standard window system action is invoked." }
-{ $examples { $code "T{ cut-action }" } } ;
+{ $examples { $code "cut-action" } } ;
 
 HELP: copy-action
 { $class-description "Gesture sent when the " { $emphasis "copy" } " standard window system action is invoked." }
-{ $examples { $code "T{ copy-action }" } } ;
+{ $examples { $code "copy-action" } } ;
 
 HELP: paste-action
 { $class-description "Gesture sent when the " { $emphasis "paste" } " standard window system action is invoked." }
-{ $examples { $code "T{ paste-action }" } } ;
+{ $examples { $code "paste-action" } } ;
 
 HELP: delete-action
 { $class-description "Gesture sent when the " { $emphasis "delete" } " standard window system action is invoked." }
-{ $examples { $code "T{ delete-action }" } } ;
+{ $examples { $code "delete-action" } } ;
 
 HELP: select-all-action
 { $class-description "Gesture sent when the " { $emphasis "select all" } " standard window system action is invoked." }
-{ $examples { $code "T{ select-all-action }" } } ;
+{ $examples { $code "select-all-action" } } ;
 
 HELP: C+
 { $description "Control key modifier." } ;
@@ -184,7 +184,7 @@ HELP: gesture>string
 { $values { "gesture" "a gesture" } { "string/f" { $maybe string } } }
 { $contract "Creates a human-readable string from a gesture object, returning " { $link f } " if the gesture does not have a human-readable form." }
 { $examples
-    { $example "USING: io ui.gestures ;" "T{ key-down f { C+ } \"x\" } gesture>string print" "C+x" }
+    { $unchecked-example "USING: io ui.gestures ;" "T{ key-down f { C+ } \"x\" } gesture>string print" "C+x" }
 } ;
 
 HELP: left-action
@@ -359,10 +359,12 @@ ARTICLE: "action-gestures" "Action gestures"
 "The following keyboard gestures, if not handled directly, send action gestures:"
 { $table
     { { $strong "Keyboard gesture" } { $strong "Action gesture" } }
-    { { $snippet "T{ key-down f { C+ } \"x\" }" } { $snippet "T{ cut-action }" } }
-    { { $snippet "T{ key-down f { C+ } \"c\" }" } { $snippet "T{ copy-action }" } }
-    { { $snippet "T{ key-down f { C+ } \"v\" }" } { $snippet "T{ paste-action }" } }
-    { { $snippet "T{ key-down f { C+ } \"a\" }" } { $snippet "T{ select-all }" } }
+    { { $snippet "T{ key-down f { C+ } \"z\" }" } { $snippet "undo-action" } }
+    { { $snippet "T{ key-down f { C+ } \"Z\" }" } { $snippet "redo-action" } }
+    { { $snippet "T{ key-down f { C+ } \"x\" }" } { $snippet "cut-action" } }
+    { { $snippet "T{ key-down f { C+ } \"c\" }" } { $snippet "copy-action" } }
+    { { $snippet "T{ key-down f { C+ } \"v\" }" } { $snippet "paste-action" } }
+    { { $snippet "T{ key-down f { C+ } \"a\" }" } { $snippet "select-all-action" } }
 }
 "Action gestures should be used in place of the above keyboard gestures if possible. For example, on Mac OS X, the standard " { $strong "Edit" } " menu items send action gestures." ;
 
diff --git a/basis/ui/gestures/gestures-tests.factor b/basis/ui/gestures/gestures-tests.factor
new file mode 100644 (file)
index 0000000..402015e
--- /dev/null
@@ -0,0 +1,5 @@
+IN: ui.gestures.tests
+USING: tools.test ui.gestures ;
+
+\ handle-gesture must-infer
+\ send-queued-gesture must-infer
\ No newline at end of file
index b74a36bc0b34f507a0860e521ebc4d804cd9d038..3581edca473d566149615dbdea1992b36d548876 100644 (file)
@@ -1,17 +1,18 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs kernel math math.order models
 namespaces make sequences words strings system hashtables
 math.parser math.vectors classes.tuple classes boxes calendar
-alarms combinators sets columns fry deques ui.gadgets ;
+alarms combinators sets columns fry deques ui.gadgets
+ui.gadgets.private unicode.case combinators.short-circuit call ;
 IN: ui.gestures
 
 GENERIC: handle-gesture ( gesture gadget -- ? )
 
 M: object handle-gesture
-    tuck class superclasses
-    [ "gestures" word-prop ] map
-    assoc-stack dup [ call f ] [ 2drop t ] if ;
+    [ nip ]
+    [ class superclasses [ "gestures" word-prop ] map assoc-stack ] 2bi
+    dup [ call( gadget -- ) f ] [ 2drop t ] if ;
 
 : set-gestures ( class hash -- ) "gestures" set-word-prop ;
 
@@ -34,9 +35,11 @@ M: send-gesture send-queued-gesture
 
 TUPLE: propagate-gesture gesture gadget ;
 
+: resend-gesture ( gesture gadget -- ? )
+    [ handle-gesture ] with each-parent ;
+
 M: propagate-gesture send-queued-gesture
-    [ gesture>> ] [ gadget>> ] bi
-    [ handle-gesture ] with each-parent drop ;
+    [ gesture>> ] [ gadget>> ] bi resend-gesture drop ;
 
 : propagate-gesture ( gesture gadget -- )
     \ propagate-gesture queue-gesture ;
@@ -63,46 +66,58 @@ M: user-input send-queued-gesture
     '[ _ \ user-input queue-gesture ] unless-empty ;
 
 ! Gesture objects
-TUPLE: motion ;             C: <motion> motion
 TUPLE: drag # ;             C: <drag> drag
 TUPLE: button-up mods # ;   C: <button-up> button-up
 TUPLE: button-down mods # ; C: <button-down> button-down
-TUPLE: mouse-scroll ;       C: <mouse-scroll> mouse-scroll
-TUPLE: mouse-enter ;        C: <mouse-enter> mouse-enter
-TUPLE: mouse-leave ;        C: <mouse-leave> mouse-leave
-TUPLE: lose-focus ;         C: <lose-focus> lose-focus
-TUPLE: gain-focus ;         C: <gain-focus> gain-focus
-
-! Higher-level actions
-TUPLE: cut-action ;         C: <cut-action> cut-action
-TUPLE: copy-action ;        C: <copy-action> copy-action
-TUPLE: paste-action ;       C: <paste-action> paste-action
-TUPLE: delete-action ;      C: <delete-action> delete-action
-TUPLE: select-all-action ;  C: <select-all-action> select-all-action
 
-TUPLE: left-action ;        C: <left-action> left-action
-TUPLE: right-action ;       C: <right-action> right-action
-TUPLE: up-action ;          C: <up-action> up-action
-TUPLE: down-action ;        C: <down-action> down-action
+SINGLETONS:
+motion
+mouse-scroll
+mouse-enter mouse-leave
+lose-focus gain-focus ;
 
-TUPLE: zoom-in-action ;     C: <zoom-in-action> zoom-in-action
-TUPLE: zoom-out-action ;    C: <zoom-out-action> zoom-out-action
+! Higher-level actions
+SINGLETONS:
+undo-action redo-action
+cut-action copy-action paste-action
+delete-action select-all-action
+left-action right-action up-action down-action
+zoom-in-action zoom-out-action ;
+
+UNION: action
+undo-action redo-action
+cut-action copy-action paste-action
+delete-action select-all-action
+left-action right-action up-action down-action
+zoom-in-action zoom-out-action ;
+
+CONSTANT: action-gestures
+    {
+        { "z" undo-action }
+        { "Z" redo-action }
+        { "x" cut-action }
+        { "c" copy-action }
+        { "v" paste-action }
+        { "a" select-all-action }
+    }
 
 ! Modifiers
 SYMBOLS: C+ A+ M+ S+ ;
 
-TUPLE: key-down mods sym ;
+TUPLE: key-gesture mods sym ;
+
+TUPLE: key-down < key-gesture ;
 
-: <key-gesture> ( mods sym action? class -- mods' sym' )
+: new-key-gesture ( mods sym action? class -- mods' sym' )
     [ [ [ S+ swap remove f like ] dip ] unless ] dip boa ; inline
 
 : <key-down> ( mods sym action? -- key-down )
-    key-down <key-gesture> ;
+    key-down new-key-gesture ;
 
-TUPLE: key-up mods sym ;
+TUPLE: key-up < key-gesture ;
 
 : <key-up> ( mods sym action? -- key-up )
-    key-up <key-gesture> ;
+    key-up new-key-gesture ;
 
 ! Hand state
 
@@ -162,15 +177,15 @@ SYMBOL: drag-timer
 
 : fire-motion ( -- )
     hand-buttons get-global empty? [
-        T{ motion } hand-gadget get-global propagate-gesture
+        motion hand-gadget get-global propagate-gesture
     ] [
         drag-gesture
     ] if ;
 
 : hand-gestures ( new old -- )
     drop-prefix <reversed>
-    T{ mouse-leave } swap each-gesture
-    T{ mouse-enter } swap each-gesture ;
+    mouse-leave swap each-gesture
+    mouse-enter swap each-gesture ;
 
 : forget-rollover ( -- )
     f hand-world set-global
@@ -179,10 +194,10 @@ SYMBOL: drag-timer
     parents hand-gestures ;
 
 : send-lose-focus ( gadget -- )
-    T{ lose-focus } swap send-gesture ;
+    lose-focus swap send-gesture ;
 
 : send-gain-focus ( gadget -- )
-    T{ gain-focus } swap send-gesture ;
+    gain-focus swap send-gesture ;
 
 : focus-child ( child gadget ? -- )
     [
@@ -271,19 +286,33 @@ SYMBOL: drag-timer
 : send-wheel ( direction loc world -- )
     move-hand
     scroll-direction set-global
-    T{ mouse-scroll } hand-gadget get-global propagate-gesture ;
+    mouse-scroll hand-gadget get-global propagate-gesture ;
 
 : send-action ( world gesture -- )
     swap world-focus propagate-gesture ;
 
 GENERIC: gesture>string ( gesture -- string/f )
 
-: modifiers>string ( modifiers -- string )
-    [ name>> ] map concat >string ;
+HOOK: modifiers>string os ( modifiers -- string )
+
+M: macosx modifiers>string
+    [
+        {
+            { A+ [ "\u{place-of-interest-sign}" ] }
+            { M+ [ "\u{option-key}" ] }
+            { S+ [ "\u{upwards-white-arrow}" ] }
+            { C+ [ "\u{up-arrowhead}" ] }
+        } case
+    ] map "" join ;
+
+M: object modifiers>string
+    [ name>> ] map "" join ;
 
 M: key-down gesture>string
-    dup mods>> modifiers>string
-    swap sym>> append ;
+    [ mods>> ] [ sym>> ] bi
+    dup { [ length 1 = ] [ upper? ] } 1&&
+    [ [ S+ prefix ] dip ] [ >upper ] if
+    [ modifiers>string ] dip append ;
 
 M: button-up gesture>string
     [
@@ -311,4 +340,14 @@ M: zoom-in-action gesture>string drop "Zoom in" ;
 
 M: zoom-out-action gesture>string drop "Zoom out (pinch)" ;
 
+HOOK: action-modifier os ( -- mod )
+
+M: object action-modifier C+ ;
+M: macosx action-modifier A+ ;
+
+M: action gesture>string
+    action-gestures value-at
+    action-modifier 1array
+    swap f <key-down> gesture>string ;
+
 M: object gesture>string drop f ;
diff --git a/basis/ui/images/authors.txt b/basis/ui/images/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/images/images-tests.factor b/basis/ui/images/images-tests.factor
new file mode 100644 (file)
index 0000000..eb053d8
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.images ;
+IN: ui.images.tests
diff --git a/basis/ui/images/images.factor b/basis/ui/images/images.factor
new file mode 100644 (file)
index 0000000..2b1caa8
--- /dev/null
@@ -0,0 +1,32 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: namespaces cache images images.loader accessors assocs
+kernel opengl opengl.gl opengl.textures ui.gadgets.worlds
+memoize ;
+IN: ui.images
+
+TUPLE: image-name path ;
+
+C: <image-name> image-name
+
+MEMO: cached-image ( image-name -- image ) path>> load-image ;
+
+<PRIVATE
+
+: image-texture-cache ( world -- texture-cache )
+    [ [ <cache-assoc> ] unless* ] change-images images>> ;
+
+PRIVATE>
+
+: rendered-image ( path -- texture )
+    world get image-texture-cache
+    [ cached-image { 0 0 } <texture> ] cache ;
+
+: draw-image ( image-name -- )
+    rendered-image draw-texture ;
+
+: draw-scaled-image ( dim image-name -- )
+    rendered-image draw-scaled-texture ;
+
+: image-dim ( image-name -- dim )
+    cached-image dim>> ;
\ No newline at end of file
index d05519f46a499098b486f09951ed61d1cd77b726..cfec6613b1427e97fcd9159778e3902e1beed5d7 100644 (file)
@@ -5,7 +5,7 @@ IN: ui.operations
 
 : $operations ( element -- )
     >quotation call
-    f operations>commands
+    f operations>commands
     command-map. ;
 
 : $operation ( element -- )
@@ -61,8 +61,8 @@ HELP: define-operation
 } ;
 
 HELP: define-operation-map
-{ $values { "class" "a class word" } { "group" string } { "blurb" { $maybe string } } { "object" object } { "hook" { $quotation "( obj -- newobj )" } ", or " { $link f } } { "translator" { $quotation "( obj -- newobj )" } ", or " { $link f } } }
-{ $description "Defines a command map named " { $snippet "group" } " on " { $snippet "class" } " consisting of operations applicable to " { $snippet "object" } ". The hook quotation is applied to the target gadget; the translator quotation is applied to the result of the hook. Finally the result of the translator is passed to the operation. A distinction is drawn between the hook and the translator because for listener operations, the hook runs in the event loop and the translator runs in the listener. This avoids polluting the listener output with large prettyprinted gadgets and long quotations." } ;
+{ $values { "class" "a class word" } { "group" string } { "blurb" { $maybe string } } { "object" object } { "translator" { $quotation "( obj -- newobj )" } ", or " { $link f } } }
+{ $description "Defines a command map named " { $snippet "group" } " on " { $snippet "class" } " consisting of operations applicable to " { $snippet "object" } ". The translator quotation is applied to the target gadget, and the result of the translator is passed to the operation." } ;
 
 HELP: $operations
 { $values { "element" "a sequence" } }
index 6e4e7c3a5dc3b20c30b4cd1df92575d59a35693d..fe7a8b52c5b31674c3c84ae75b25d0220d00bf83 100644 (file)
@@ -5,7 +5,7 @@ io.streams.string math help help.markup accessors ;
 
 : my-pprint pprint ;
 
-[ drop t ] \ my-pprint [ ] [ ] f operation boa "op" set
+[ drop t ] \ my-pprint [ ] f operation boa "op" set
 
 [ [ 3 my-pprint ] ] [
     3 "op" get command>> command-quot
@@ -13,7 +13,7 @@ io.streams.string math help help.markup accessors ;
 
 [ "3" ] [ [ 3 "op" get invoke-command ] with-string-writer ] unit-test
 
-[ drop t ] \ my-pprint [ ] [ editor-string ] f operation boa
+[ drop t ] \ my-pprint [ editor-string ] f operation boa
 "op" set
 
 [ "\"4\"" ] [
@@ -26,3 +26,5 @@ io.streams.string math help help.markup accessors ;
 [ ] [
     [ { $operations \ + } print-element ] with-string-writer drop
 ] unit-test
+
+\ object-operations must-infer
\ No newline at end of file
index 8ba0e5dac7d532e57d3ebe63c139609aade285ea..2f9cfba961adf3795f1de6eeba25b25c2f8aac85 100644 (file)
@@ -1,19 +1,18 @@
 ! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays definitions kernel ui.commands
-ui.gestures sequences strings math words generic namespaces make
-hashtables help.markup quotations assocs fry linked-assocs ;
+ui.gestures sequences strings math words generic namespaces
+hashtables help.markup quotations assocs fry call linked-assocs ;
 IN: ui.operations
 
 SYMBOL: +keyboard+
 SYMBOL: +primary+
 SYMBOL: +secondary+
 
-TUPLE: operation predicate command translator hook listener? ;
+TUPLE: operation predicate command translator listener? ;
 
 : <operation> ( predicate command -- operation )
     operation new
-        [ ] >>hook
         [ ] >>translator
         swap >>command
         swap >>predicate ;
@@ -38,19 +37,31 @@ operations [ <linked-hash> ] initialize
 
 : object-operations ( obj -- operations )
     operations get values
-    [ predicate>> call ] with filter ;
+    [ predicate>> call( obj -- ? ) ] with filter ;
+
+: gesture>operation ( gesture object -- operation/f )
+    object-operations [ operation-gesture = ] with find nip ;
 
 : find-operation ( obj quot -- command )
     [ object-operations ] dip find-last nip ; inline
 
+: primary-operation? ( operation -- ? )
+    command>> +primary+ word-prop ;
+
 : primary-operation ( obj -- operation )
-    [ command>> +primary+ word-prop ] find-operation ;
+    [ primary-operation? ] find-operation ;
+
+: invoke-primary-operation ( obj -- )
+    dup primary-operation invoke-command ;
 
 : secondary-operation ( obj -- operation )
     dup
     [ command>> +secondary+ word-prop ] find-operation
     [ ] [ primary-operation ] ?if ;
 
+: invoke-secondary-operation ( obj -- )
+    dup secondary-operation invoke-command ;
+
 : default-flags ( -- assoc )
     H{ { +keyboard+ f } { +primary+ f } { +secondary+ f } } ;
 
@@ -63,28 +74,23 @@ operations [ <linked-hash> ] initialize
     dupd define-command <operation>
     (define-operation) ;
 
-: modify-operation ( hook translator operation -- operation )
+: modify-operation ( translator operation -- operation )
     clone
         swap >>translator
-        swap >>hook
         t >>listener? ;
 
-: modify-operations ( operations hook translator -- operations )
-    '[ [ _ ] dip modify-operation ] map ;
+: modify-operations ( operations translator -- operations )
+    '[ [ _ ] dip modify-operation ] map ;
 
-: operations>commands ( object hook translator -- pairs )
-    [ object-operations ] 2dip modify-operations
+: operations>commands ( object translator -- pairs )
+    [ object-operations ] dip modify-operations
     [ [ operation-gesture ] keep ] { } map>assoc ;
 
-: define-operation-map ( class group blurb object hook translator -- )
+: define-operation-map ( class group blurb object translator -- )
     operations>commands define-command-map ;
 
 : operation-quot ( target command -- quot )
-    [
-        swap literalize ,
-        dup translator>> %
-        command>> ,
-    ] [ ] make ;
+    [ translator>> ] [ command>> ] bi '[ _ @ _ execute ] ;
 
 M: operation invoke-command ( target command -- )
-    [ hook>> call ] keep operation-quot call ;
+    operation-quot call( -- ) ;
diff --git a/basis/ui/pens/authors.txt b/basis/ui/pens/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/pens/caching/authors.txt b/basis/ui/pens/caching/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/pens/caching/caching-tests.factor b/basis/ui/pens/caching/caching-tests.factor
new file mode 100644 (file)
index 0000000..3a655b2
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.pens.caching ;
+IN: ui.pens.caching.tests
diff --git a/basis/ui/pens/caching/caching.factor b/basis/ui/pens/caching/caching.factor
new file mode 100644 (file)
index 0000000..f137ac3
--- /dev/null
@@ -0,0 +1,16 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors kernel ;
+IN: ui.pens.caching
+
+! A pen that caches vertex arrays, etc
+TUPLE: caching-pen last-dim ;
+
+GENERIC: recompute-pen ( gadget pen -- )
+
+: compute-pen ( gadget pen -- )
+    2dup [ dim>> ] [ last-dim>> ] bi* eq? [
+        2drop
+    ] [
+        [ swap dim>> >>last-dim drop ] [ recompute-pen ] 2bi
+    ] if ;
diff --git a/basis/ui/pens/gradient/authors.txt b/basis/ui/pens/gradient/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/pens/gradient/gradient-docs.factor b/basis/ui/pens/gradient/gradient-docs.factor
new file mode 100644 (file)
index 0000000..35697a8
--- /dev/null
@@ -0,0 +1,6 @@
+IN: ui.pens.gradient
+USING: help.markup help.syntax ui.pens colors ;
+
+HELP: gradient
+{ $class-description "A class implementing the " { $link draw-interior } " generic word to draw a smoothly shaded transition between colors. The " { $snippet "colors" } " slot stores a sequence of " { $link color } " instances, and the gradient is drawn in the direction given by the " { $snippet "orientation" } " slot of the gadget." }
+{ $notes "See " { $link "colors" } "." } ;
diff --git a/basis/ui/pens/gradient/gradient-tests.factor b/basis/ui/pens/gradient/gradient-tests.factor
new file mode 100644 (file)
index 0000000..63134b3
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.pens.gradient ;
+IN: ui.pens.gradient.tests
diff --git a/basis/ui/pens/gradient/gradient.factor b/basis/ui/pens/gradient/gradient.factor
new file mode 100644 (file)
index 0000000..a137ae0
--- /dev/null
@@ -0,0 +1,44 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel accessors math math.vectors locals sequences
+specialized-arrays.float colors arrays combinators
+opengl opengl.gl ui.pens ui.pens.caching ;
+IN: ui.pens.gradient
+
+! Gradient pen
+TUPLE: gradient < caching-pen colors last-vertices last-colors ;
+
+: <gradient> ( colors -- gradient ) gradient new swap >>colors ;
+
+<PRIVATE
+
+:: gradient-vertices ( direction dim colors -- seq )
+    direction dim v* dim over v- swap
+    colors length dup 1- v/n [ v*n ] with map
+    swap [ over v+ 2array ] curry map
+    concat concat >float-array ;
+
+: gradient-colors ( colors -- seq )
+    [ >rgba-components 4array dup 2array ] map concat concat
+    >float-array ;
+
+M: gradient recompute-pen ( gadget gradient -- )
+    [ nip ] [ [ [ orientation>> ] [ dim>> ] bi ] [ colors>> ] bi* ] 2bi
+    [ gradient-vertices >>last-vertices ]
+    [ gradient-colors >>last-colors ]
+    bi drop ;
+
+: draw-gradient ( colors -- )
+    GL_COLOR_ARRAY [
+        [ GL_QUAD_STRIP 0 ] dip length 2 * glDrawArrays
+    ] do-enabled-client-state ;
+
+PRIVATE>
+
+M: gradient draw-interior
+    {
+        [ compute-pen ]
+        [ last-vertices>> gl-vertex-pointer ]
+        [ last-colors>> gl-color-pointer ]
+        [ colors>> draw-gradient ]
+    } cleave ;
\ No newline at end of file
diff --git a/basis/ui/pens/image/authors.txt b/basis/ui/pens/image/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/pens/image/image-tests.factor b/basis/ui/pens/image/image-tests.factor
new file mode 100644 (file)
index 0000000..797a203
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.pens.image ;
+IN: ui.pens.image.tests
diff --git a/basis/ui/pens/image/image.factor b/basis/ui/pens/image/image.factor
new file mode 100644 (file)
index 0000000..da253f8
--- /dev/null
@@ -0,0 +1,22 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel accessors sequences fry math
+opengl ui.pens ui.images io.pathnames ;
+IN: ui.pens.image
+
+! Image pen
+TUPLE: image-pen image fill? ;
+
+: <image-pen> ( image -- pen ) f image-pen boa ;
+
+M: image-pen draw-interior
+    [ dim>> ] [ [ image>> ] [ fill?>> ] bi ] bi*
+    [ draw-scaled-image ] [
+        [ image-dim [ - 2 /i ] 2map ] keep
+        '[ _ draw-image ] with-translation
+    ] if ;
+
+M: image-pen pen-pref-dim nip image>> image-dim ;
+
+: theme-image ( name -- image-name )
+    "vocab:ui/gadgets/theme/" prepend-path ".tiff" append <image-name> ;
\ No newline at end of file
diff --git a/basis/ui/pens/pens-docs.factor b/basis/ui/pens/pens-docs.factor
new file mode 100644 (file)
index 0000000..865210e
--- /dev/null
@@ -0,0 +1,24 @@
+IN: ui.pens
+USING: help.markup help.syntax kernel ui.gadgets ;
+
+HELP: draw-interior
+{ $values { "pen" object } { "gadget" gadget } } 
+{ $contract "Draws the interior of a gadget by making OpenGL calls. The " { $snippet "interior" } " slot may be set to objects implementing this generic word." } ;
+
+HELP: draw-boundary
+{ $values { "pen" object } { "gadget" gadget } } 
+{ $contract "Draws the boundary of a gadget by making OpenGL calls. The " { $snippet "boundary" } " slot may be set to objects implementing this generic word." } ;
+
+ARTICLE: "ui-pen-protocol" "UI pen protocol"
+"The " { $snippet "interior" } " and " { $snippet "boundary" } " slots of a gadget facilitate easy factoring and sharing of drawing logic. Objects stored in these slots must implement the pen protocol:"
+{ $subsection draw-interior }
+{ $subsection draw-boundary }
+"The default value of these slots is the " { $link f } " singleton, which implements the above protocol by doing nothing."
+$nl
+"Some other pre-defined implementations:"
+{ $vocab-subsection "Gradient pens" "ui.pens.gradient" }
+{ $vocab-subsection "Image pens" "ui.pens.image" }
+{ $vocab-subsection "Polygon pens" "ui.pens.polygon" }
+{ $vocab-subsection "Solid pens" "ui.pens.solid" }
+{ $vocab-subsection "Tile pens" "ui.pens.tile" }
+"Custom implementations must follow the guidelines set forth in " { $link "ui-paint-custom" } "." ;
\ No newline at end of file
diff --git a/basis/ui/pens/pens-tests.factor b/basis/ui/pens/pens-tests.factor
new file mode 100644 (file)
index 0000000..422e352
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.pens ;
+IN: ui.pens.tests
diff --git a/basis/ui/pens/pens.factor b/basis/ui/pens/pens.factor
new file mode 100644 (file)
index 0000000..9a1717f
--- /dev/null
@@ -0,0 +1,20 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel ;
+IN: ui.pens
+
+GENERIC: draw-interior ( gadget pen -- )
+
+GENERIC: draw-boundary ( gadget pen -- )
+
+GENERIC: pen-background ( gadget pen -- color )
+
+M: object pen-background 2drop f ;
+
+GENERIC: pen-foreground ( gadget pen -- color )
+
+M: object pen-foreground 2drop f ;
+
+GENERIC: pen-pref-dim ( gadget pen -- dim )
+
+M: object pen-pref-dim 2drop { 0 0 } ;
\ No newline at end of file
diff --git a/basis/ui/pens/polygon/authors.txt b/basis/ui/pens/polygon/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/pens/polygon/polygon-docs.factor b/basis/ui/pens/polygon/polygon-docs.factor
new file mode 100644 (file)
index 0000000..706c144
--- /dev/null
@@ -0,0 +1,14 @@
+IN: ui.pens.polygon
+USING: help.markup help.syntax ;
+
+HELP: polygon
+{ $class-description "A class implementing the " { $link draw-boundary } " and " { $link draw-interior } " generic words to draw a solid outline or a solid filled polygon, respectively. Instances of " { $link polygon } " have two slots:"
+    { $list
+        { { $snippet "color" } " - a " { $link color } }
+        { { $snippet "points" } " - a sequence of points" }
+    }
+} ;
+
+HELP: <polygon>
+{ $values { "color" color } { "points" "a sequence of points" } { "polygon" polygon } }
+{ $description "Creates a new instance of " { $link polygon } "." } ;
diff --git a/basis/ui/pens/polygon/polygon-tests.factor b/basis/ui/pens/polygon/polygon-tests.factor
new file mode 100644 (file)
index 0000000..529b4f4
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.pens.polygon ;
+IN: ui.pens.polygon.tests
diff --git a/basis/ui/pens/polygon/polygon.factor b/basis/ui/pens/polygon/polygon.factor
new file mode 100644 (file)
index 0000000..4fc05c4
--- /dev/null
@@ -0,0 +1,32 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: ;
+IN: ui.pens.polygon
+
+! Polygon pen
+TUPLE: polygon color
+interior-vertices
+interior-count
+boundary-vertices
+boundary-count ;
+
+: close-path ( points -- points' )
+    dup first suffix ;
+
+: <polygon> ( color points -- polygon )
+    dup close-path [ [ concat >float-array ] [ length ] bi ] bi@
+    polygon boa ;
+
+M: polygon draw-boundary
+    nip
+    [ color>> gl-color ]
+    [ boundary-vertices>> gl-vertex-pointer ]
+    [ [ GL_LINE_STRIP 0 ] dip boundary-count>> glDrawArrays ]
+    tri ;
+
+M: polygon draw-interior
+    nip
+    [ color>> gl-color ]
+    [ interior-vertices>> gl-vertex-pointer ]
+    [ [ GL_POLYGON 0 ] dip interior-count>> glDrawArrays ]
+    tri ;
\ No newline at end of file
diff --git a/basis/ui/pens/solid/authors.txt b/basis/ui/pens/solid/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/pens/solid/solid-docs.factor b/basis/ui/pens/solid/solid-docs.factor
new file mode 100644 (file)
index 0000000..2dc1db1
--- /dev/null
@@ -0,0 +1,6 @@
+IN: ui.pens.solid
+USING: help.markup help.syntax ui.pens colors ;
+
+HELP: solid
+{ $class-description "A class implementing the " { $link draw-boundary } " and " { $link draw-interior } " generic words to draw a solid outline or a solid fill, respectively. The " { $snippet "color" } " slot stores an instance of " { $link color } "." }
+{ $notes "See " { $link "colors" } "." } ;
diff --git a/basis/ui/pens/solid/solid-tests.factor b/basis/ui/pens/solid/solid-tests.factor
new file mode 100644 (file)
index 0000000..ab6234a
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.pens.solid ;
+IN: ui.pens.solid.tests
diff --git a/basis/ui/pens/solid/solid.factor b/basis/ui/pens/solid/solid.factor
new file mode 100644 (file)
index 0000000..32d4004
--- /dev/null
@@ -0,0 +1,32 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel accessors opengl ui.pens ui.pens.caching ;
+IN: ui.pens.solid
+
+TUPLE: solid < caching-pen color interior-vertices boundary-vertices ;
+
+: <solid> ( color -- solid ) solid new swap >>color ;
+
+M: solid recompute-pen
+    swap dim>>
+    [ (fill-rect-vertices) >>interior-vertices ]
+    [ (rect-vertices) >>boundary-vertices ]
+    bi drop ;
+
+<PRIVATE
+
+: (solid) ( gadget pen -- )
+    [ compute-pen ] [ color>> gl-color ] bi ;
+
+PRIVATE>
+
+M: solid draw-interior
+    [ (solid) ] [ interior-vertices>> gl-vertex-pointer ] bi
+    (gl-fill-rect) ;
+
+M: solid draw-boundary
+    [ (solid) ] [ boundary-vertices>> gl-vertex-pointer ] bi
+    (gl-rect) ;
+
+M: solid pen-background
+    nip color>> ;
\ No newline at end of file
diff --git a/basis/ui/pens/tile/authors.txt b/basis/ui/pens/tile/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/pens/tile/tile-tests.factor b/basis/ui/pens/tile/tile-tests.factor
new file mode 100644 (file)
index 0000000..b406b7b
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.pens.tile ;
+IN: ui.pens.tile.tests
diff --git a/basis/ui/pens/tile/tile.factor b/basis/ui/pens/tile/tile.factor
new file mode 100644 (file)
index 0000000..7f26e92
--- /dev/null
@@ -0,0 +1,52 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel accessors math.vectors ui.images opengl fry
+combinators ui.pens ;
+IN: ui.pens.tile
+
+! Tile pen
+TUPLE: tile-pen left center right background foreground ;
+
+: <tile-pen> ( left center right background foreground -- pen )
+    tile-pen boa ;
+
+: >tile-pen< ( pen -- left center right )
+    [ left>> ] [ center>> ] [ right>> ] tri ; inline
+
+M: tile-pen pen-pref-dim
+    swap [
+        >tile-pen< [ image-dim ] tri@
+        [ vmax vmax ] [ v+ v+ ] 3bi
+    ] dip orientation>> set-axis ;
+
+: compute-tile-xs ( gadget pen -- x1 x2 x3 )
+    [ 2drop { 0 0 } ]
+    [ nip left>> image-dim ]
+    [ [ dim>> ] [ right>> image-dim ] bi* v- ]
+    2tri ;
+
+: compute-tile-widths ( gadget pen -- w1 w2 w3 )
+    [ nip left>> image-dim ]
+    [ [ dim>> ] [ [ left>> ] [ right>> ] bi [ image-dim ] bi@ ] bi* v+ v- ]
+    [ nip right>> image-dim ]
+    2tri ;
+
+: render-tile ( tile x width gadget -- )
+    [ orientation>> '[ _ v* ] dip ] keep
+   '[
+       _ _ [ dim>> swap ] [ orientation>> ] bi set-axis
+       swap draw-scaled-image
+   ] with-translation ;
+
+M: tile-pen draw-interior ( gadget pen -- )
+    {
+        [ nip >tile-pen< ]
+        [ compute-tile-xs ]
+        [ compute-tile-widths ]
+        [ drop ]
+    } 2cleave
+    [ render-tile ] curry tri-curry@ tri-curry* tri* ;
+
+M: tile-pen pen-background nip background>> ;
+
+M: tile-pen pen-foreground nip foreground>> ;
\ No newline at end of file
index 7f88a904ecdeb3aeacec49e0b1850ad6ba14a95e..dd499896649656c6e005af46e5c9306676c23000 100644 (file)
@@ -1,6 +1,6 @@
-USING: ui.gadgets ui.gestures help.markup help.syntax
+USING: ui.gadgets ui.pens ui.gestures help.markup help.syntax
 kernel classes strings opengl opengl.gl models
-math.geometry.rect ;
+math.rectangles math colors ;
 IN: ui.render
 
 HELP: gadget
@@ -14,8 +14,8 @@ HELP: gadget
         { { $snippet "visible?" } " - a boolean indicating if the gadget should display and receive user input." }
         { { $snippet "root?" } " - if set to " { $link t } ", layout changes in this gadget will not propagate to the gadget's parent." }
         { { $snippet "clipped?" } " - a boolean indicating if clipping will be enabled when drawing this gadget's children." }
-        { { $snippet "interior" } " - an object whose class implements the " { $link draw-interior } " generic word." }
-        { { $snippet "boundary" } " - an object whose class implements the " { $link draw-boundary } " generic word." }
+        { { $snippet "interior" } " - an implementation of the " { $link "ui-pen-protocol" } }
+        { { $snippet "boundary" } " - an implementation of the " { $link "ui-pen-protocol" } }
         { { $snippet "model" } " - a " { $link model } " or " { $link f } "; see " { $link "ui-control-impl" } }
     }
 "Gadgets subclass the " { $link rect } " class, and thus all instances have " { $snippet "loc" } " and " { $snippet "dim" } " instances holding their location and dimensions." }
@@ -30,68 +30,6 @@ HELP: draw-gadget*
 { $contract "Draws the gadget by making OpenGL calls. The top-left corner of the gadget should be drawn at the location stored in the " { $link origin } " variable." }
 { $notes "This word should not be called directly. To force a gadget to redraw, call " { $link relayout-1 } "." } ;
 
-HELP: draw-interior
-{ $values { "interior" object } { "gadget" gadget } } 
-{ $contract "Draws the interior of a gadget by making OpenGL calls. The " { $snippet "interior" } " slot may be set to objects implementing this generic word." } ;
-
-HELP: draw-boundary
-{ $values { "boundary" object } { "gadget" gadget } } 
-{ $contract "Draws the boundary of a gadget by making OpenGL calls. The " { $snippet "boundary" } " slot may be set to objects implementing this generic word." } ;
-
-HELP: solid
-{ $class-description "A class implementing the " { $link draw-boundary } " and " { $link draw-interior } " generic words to draw a solid outline or a solid fill, respectively. The " { $snippet "color" } " slot stores a color specifier." } ;
-
-HELP: gradient
-{ $class-description "A class implementing the " { $link draw-interior } " generic word to draw a smoothly shaded transition between colors. The " { $snippet "colors" } " slot stores a sequence of color specifiers and the gradient is drawn in the direction given by the " { $snippet "orientation" } " slot of the gadget." } ;
-
-HELP: polygon
-{ $class-description "A class implementing the " { $link draw-boundary } " and " { $link draw-interior } " generic words to draw a solid outline or a solid filled polygon, respectively. Instances of " { $link polygon } " have two slots:"
-    { $list
-        { { $snippet "color" } " - a color specifier" }
-        { { $snippet "points" } " - a sequence of points" }
-    }
-} ;
-
-HELP: <polygon>
-{ $values { "color" "a color specifier" } { "points" "a sequence of points" } { "polygon" polygon } }
-{ $description "Creates a new instance of " { $link polygon } "." } ;
-
-HELP: <polygon-gadget>
-{ $values { "color" "a color specifier" } { "points" "a sequence of points" } { "gadget" "a new " { $link gadget } } }
-{ $description "Creates a gadget which is drawn as a solid filled polygon. The gadget's size is the minimum bounding box containing all the points of the polygon." } ;
-
-HELP: open-font
-{ $values { "font" "a font specifier" } { "open-font" object } }
-{ $description "Loads a font if it has not already been loaded, otherwise outputs the existing font." }
-{ $errors "Throws an error if the font does not exist." } ;
-
-HELP: string-width
-{ $values { "open-font" "a value output by " { $link open-font } } { "string" string } { "w" "a positive integer" } }
-{ $description "Outputs the width of a string." } ;
-
-HELP: text-dim
-{ $values { "open-font" "a value output by " { $link open-font } } { "text" "a string or an array of strings" } { "dim" "a pair of integers" } }
-{ $description "Outputs the dimensions of a piece of text, which is either a single-line string or an array of lines." } ;
-
-HELP: draw-string
-{ $values { "font" "a font specifier" } { "string" string } { "loc" "a pair of integers" } }
-{ $description "Draws a line of text." } ;
-
-HELP: draw-text
-{ $values { "font" "a font specifier" } { "text" "a string or an array of strings" } { "loc" "a pair of integers" } }
-{ $description "Draws text. Text is either a single-line string or an array of lines." } ;
-
-ARTICLE: "gadgets-polygons" "Polygon gadgets"
-"A polygon gadget renders a simple shaded polygon."
-{ $subsection <polygon-gadget> }
-"Some pre-made polygons:"
-{ $subsection arrow-up }
-{ $subsection arrow-right }
-{ $subsection arrow-down }
-{ $subsection arrow-left }
-{ $subsection close-box }
-"Polygon gadgets are rendered by the " { $link polygon } " pen protocol implementation." ;
-
 ARTICLE: "ui-paint" "Customizing gadget appearance"
 "The UI carries out the following steps when drawing a gadget:"
 { $list
@@ -104,36 +42,9 @@ ARTICLE: "ui-paint" "Customizing gadget appearance"
 { $subsection "ui-pen-protocol" }
 { $subsection "ui-paint-custom" } ;
 
-ARTICLE: "ui-pen-protocol" "UI pen protocol"
-"The " { $snippet "interior" } " and " { $snippet "boundary" } " slots of a gadget facilitate easy factoring and sharing of drawing logic. Objects stored in these slots must implement the pen protocol:"
-{ $subsection draw-interior }
-{ $subsection draw-boundary }
-"The default value of these slots is the " { $link f } " singleton, which implements the above protocol by doing nothing."
-$nl
-"Some other pre-defined implementations:"
-{ $subsection solid }
-{ $subsection gradient }
-{ $subsection polygon }
-"Custom implementations must follow the guidelines set forth in " { $link "ui-paint-custom" } "." ;
-
-ARTICLE: "text-rendering" "Rendering text"
-"Unlike OpenGL, Factor's FreeType binding only includes the bare essentials, and there is rarely any need to directly call words in the " { $vocab-link "freetype" } " vocabulary directly. Instead, the UI provides high-level wrappers."
-$nl
-"Font objects are never constructed directly, and instead are obtained by calling a word:"
-{ $subsection open-font }
-"Measuring text:"
-{ $subsection text-dim }
-{ $subsection text-height }
-{ $subsection text-width }
-"Rendering text:"
-{ $subsection draw-string }
-{ $subsection draw-text } ;
-
 ARTICLE: "ui-paint-coord" "The UI co-ordinate system"
-"The UI uses a co-ordinate system where the y axis is oriented down. The OpenGL " { $link GL_MODELVIEW } " matrix is not saved or restored when rendering a gadget. Instead, the origin of the gadget relative to the OpenGL context is stored in a variable:"
+"The UI uses a co-ordinate system where the y axis is oriented down. The OpenGL " { $link GL_MODELVIEW } " matrix is saved or restored when rendering a gadget, and the origin is translated to the gadget's origin within the window. The current origin is stored in a variable:"
 { $subsection origin }
-"Custom drawing implementations can translate co-ordinates manually, or save and restore the " { $link GL_MODELVIEW } " matrix using a word such as " { $link with-translation } "."
-$nl
 "Gadgets must not draw outside of their bounding box, however clipping is not enforced by default, for performance reasons. This can be changed by setting the " { $slot "clipped?" } " slot to " { $link t } " in the gadget's constructor." ;
 
-ABOUT: "ui-paint-custom"
+ABOUT: "ui-paint"
diff --git a/basis/ui/render/render-tests.factor b/basis/ui/render/render-tests.factor
new file mode 100644 (file)
index 0000000..3410560
--- /dev/null
@@ -0,0 +1,4 @@
+IN: ui.render.tests
+USING: ui.render tools.test ;
+
+\ draw-gadget must-infer
\ No newline at end of file
index a913c78f7d68478e447c3d8f0b84b86c2abd9227..d083b70908a3bf38c0816b91eb8e7651fc94d9ad 100755 (executable)
@@ -1,9 +1,8 @@
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien alien.c-types arrays hashtables io kernel
-math namespaces opengl opengl.gl opengl.glu sequences strings
-io.styles vectors combinators math.vectors ui.gadgets colors
-math.order math.geometry.rect locals specialized-arrays.float ;
+USING: math.rectangles math.vectors namespaces kernel accessors
+combinators sequences opengl opengl.gl opengl.glu colors
+colors.constants ui.gadgets ui.pens ;
 IN: ui.render
 
 SYMBOL: clip
@@ -18,17 +17,19 @@ SYMBOL: viewport-translation
 
 : do-clip ( -- ) clip get flip-rect gl-set-clip ;
 
-: init-clip ( clip-rect rect -- )
-    GL_SCISSOR_TEST glEnable
-    [ rect-intersect ] keep
-    dim>> dup { 0 1 } v* viewport-translation set
-    { 0 0 } over gl-viewport
-    0 swap first2 0 gluOrtho2D
-    clip set
+: init-clip ( clip-rect -- )
+    [
+        dim>>
+        [ { 0 1 } v* viewport-translation set ]
+        [ [ { 0 0 } ] dip gl-viewport ]
+        [ [ 0 ] dip first2 0 gluOrtho2D ] tri
+    ]
+    [ clip set ] bi
     do-clip ;
 
-: init-gl ( clip-rect rect -- )
+: init-gl ( clip-rect -- )
     GL_SMOOTH glShadeModel
+    GL_SCISSOR_TEST glEnable
     GL_BLEND glEnable
     GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glBlendFunc
     GL_VERTEX_ARRAY glEnableClientState
@@ -36,41 +37,40 @@ SYMBOL: viewport-translation
     init-clip
     ! white gl-clear is broken w.r.t window resizing
     ! Linux/PPC Radeon 9200
-    white gl-color
+    COLOR: white gl-color
     clip get dim>> gl-fill-rect ;
 
 GENERIC: draw-gadget* ( gadget -- )
 
 M: gadget draw-gadget* drop ;
 
-GENERIC: draw-interior ( gadget interior -- )
-
-GENERIC: draw-boundary ( gadget boundary -- )
-
 SYMBOL: origin
 
 { 0 0 } origin set-global
 
 : visible-children ( gadget -- seq )
-    clip get origin get vneg offset-rect swap children-on ;
+    [ clip get origin get vneg offset-rect ] dip children-on ;
 
-: translate ( rect/point -- ) rect-loc origin [ v+ ] change ;
+: translate ( rect/point -- ) loc>> origin [ v+ ] change ;
 
-DEFER: draw-gadget
+GENERIC: draw-children ( gadget -- )
 
 : (draw-gadget) ( gadget -- )
-    [
-        dup translate
-        dup interior>> [
-            origin get [ dupd draw-interior ] with-translation
-        ] when*
-        dup draw-gadget*
-        dup visible-children [ draw-gadget ] each
-        dup boundary>> [
-            origin get [ dupd draw-boundary ] with-translation
-        ] when*
-        drop
-    ] with-scope ;
+    dup loc>> origin get v+ origin [
+        [
+            origin get [
+                [ dup interior>> dup [ draw-interior ] [ 2drop ] if ]
+                [ draw-gadget* ]
+                bi
+            ] with-translation
+        ]
+        [ draw-children ]
+        [
+            dup boundary>> dup [
+                origin get [ draw-boundary ] with-translation
+            ] [ 2drop ] if
+        ] tri
+    ] with-variable ;
 
 : >absolute ( rect -- rect )
     origin get offset-rect ;
@@ -88,161 +88,28 @@ DEFER: draw-gadget
         [ [ (draw-gadget) ] with-clipping ]
     } cond ;
 
-! A pen that caches vertex arrays, etc
-TUPLE: caching-pen last-dim ;
-
-GENERIC: recompute-pen ( gadget pen -- )
-
-: compute-pen ( gadget pen -- )
-    2dup [ dim>> ] [ last-dim>> ] bi* = [
-        2drop
-    ] [
-        [ swap dim>> >>last-dim drop ] [ recompute-pen ] 2bi
-    ] if ;
-
-! Solid fill/border
-TUPLE: solid < caching-pen color interior-vertices boundary-vertices ;
+! For text rendering
+SYMBOL: background
 
-: <solid> ( color -- solid ) solid new swap >>color ;
+SYMBOL: foreground
 
-M: solid recompute-pen
-    swap dim>>
-    [ (fill-rect-vertices) >>interior-vertices ]
-    [ (rect-vertices) >>boundary-vertices ]
-    bi drop ;
+GENERIC: gadget-background ( gadget -- color )
 
-<PRIVATE
+M: gadget gadget-background dup interior>> pen-background ;
 
-! Solid pen
-: (solid) ( gadget pen -- )
-    [ compute-pen ] [ color>> gl-color ] bi ;
+GENERIC: gadget-foreground ( gadget -- color )
 
-PRIVATE>
+M: gadget gadget-foreground dup interior>> pen-foreground ;
 
-M: solid draw-interior
-    [ (solid) ] [ interior-vertices>> gl-vertex-pointer ] bi
-    (gl-fill-rect) ;
-
-M: solid draw-boundary
-    [ (solid) ] [ boundary-vertices>> gl-vertex-pointer ] bi
-    (gl-rect) ;
-
-! Gradient pen
-TUPLE: gradient < caching-pen colors last-vertices last-colors ;
-
-: <gradient> ( colors -- gradient ) gradient new swap >>colors ;
-
-<PRIVATE
-
-:: gradient-vertices ( direction dim colors -- seq )
-    direction dim v* dim over v- swap
-    colors length dup 1- v/n [ v*n ] with map
-    [ dup rot v+ 2array ] with map
-    concat concat >float-array ;
-
-: gradient-colors ( colors -- seq )
-    [ color>raw 4array dup 2array ] map concat concat
-    >float-array ;
-
-M: gradient recompute-pen ( gadget gradient -- )
-    tuck
-    [ [ orientation>> ] [ dim>> ] bi ] [ colors>> ] bi*
-    [ gradient-vertices >>last-vertices ]
-    [ gradient-colors >>last-colors ] bi
-    drop ;
-
-: draw-gradient ( colors -- )
-    GL_COLOR_ARRAY [
-        [ GL_QUAD_STRIP 0 ] dip length 2 * glDrawArrays
-    ] do-enabled-client-state ;
+M: gadget draw-children
+    [ visible-children ]
+    [ gadget-background ]
+    [ gadget-foreground ] tri [
+        [ foreground set ] when*
+        [ background set ] when*
+        [ draw-gadget ] each
+    ] with-scope ;
 
-PRIVATE>
+CONSTANT: selection-color T{ rgba f 0.8 0.8 1.0 1.0 }
 
-M: gradient draw-interior
-    {
-        [ compute-pen ]
-        [ last-vertices>> gl-vertex-pointer ]
-        [ last-colors>> gl-color-pointer ]
-        [ colors>> draw-gradient ]
-    } cleave ;
-
-! Polygon pen
-TUPLE: polygon color
-interior-vertices
-interior-count
-boundary-vertices
-boundary-count ;
-
-: <polygon> ( color points -- polygon )
-    dup close-path [ [ concat >float-array ] [ length ] bi ] bi@
-    polygon boa ;
-
-M: polygon draw-boundary
-    nip
-    [ color>> gl-color ]
-    [ boundary-vertices>> gl-vertex-pointer ]
-    [ [ GL_LINE_STRIP 0 ] dip boundary-count>> glDrawArrays ]
-    tri ;
-
-M: polygon draw-interior
-    nip
-    [ color>> gl-color ]
-    [ interior-vertices>> gl-vertex-pointer ]
-    [ [ GL_POLYGON 0 ] dip interior-count>> glDrawArrays ]
-    tri ;
-
-CONSTANT: arrow-up { { 3 0 } { 6 6 } { 0 6 } }
-CONSTANT: arrow-right { { 0 0 } { 6 3 } { 0 6 } }
-CONSTANT: arrow-down { { 0 0 } { 6 0 } { 3 6 } }
-CONSTANT: arrow-left { { 0 3 } { 6 0 } { 6 6 } }
-CONSTANT: close-box { { 0 0 } { 6 0 } { 6 6 } { 0 6 } }
-
-: <polygon-gadget> ( color points -- gadget )
-    dup max-dim
-    [ <polygon> <gadget> ] dip >>dim
-    swap >>interior ;
-
-! Font rendering
-SYMBOL: font-renderer
-
-HOOK: open-font font-renderer ( font -- open-font )
-
-HOOK: string-width font-renderer ( open-font string -- w )
-
-HOOK: string-height font-renderer ( open-font string -- h )
-
-HOOK: draw-string font-renderer ( font string loc -- )
-
-HOOK: x>offset font-renderer ( x open-font string -- n )
-
-HOOK: free-fonts font-renderer ( world -- )
-
-: text-height ( open-font text -- n )
-    dup string? [
-        string-height
-    ] [
-        [ string-height ] with map sum
-    ] if ;
-
-: text-width ( open-font text -- n )
-    dup string? [
-        string-width
-    ] [
-        [ 0 ] 2dip [ string-width max ] with each
-    ] if ;
-
-: text-dim ( open-font text -- dim )
-    [ text-width ] 2keep text-height 2array ;
-
-: draw-text ( font text loc -- )
-    over string? [
-        draw-string
-    ] [
-        [
-            [
-                2dup { 0 0 } draw-string
-                [ open-font ] dip string-height
-                0.0 swap 0.0 glTranslated
-            ] with each
-        ] with-translation
-    ] if ;
+CONSTANT: focus-border-color COLOR: dark-gray
diff --git a/basis/ui/text/authors.txt b/basis/ui/text/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/text/core-text/authors.txt b/basis/ui/text/core-text/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/text/core-text/core-text.factor b/basis/ui/text/core-text/core-text.factor
new file mode 100644 (file)
index 0000000..785a936
--- /dev/null
@@ -0,0 +1,51 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: assocs accessors alien core-graphics.types core-text
+core-text.fonts kernel hashtables namespaces sequences
+ui.gadgets.worlds ui.text ui.text.private opengl opengl.gl
+opengl.textures destructors combinators core-foundation
+core-foundation.strings math math.vectors init colors colors.constants
+cache arrays images ;
+IN: ui.text.core-text
+
+SINGLETON: core-text-renderer
+
+M: core-text-renderer init-text-rendering
+    <cache-assoc> >>text-handle drop ;
+
+M: core-text-renderer string-dim
+    [ " " string-dim { 0 1 } v* ]
+    [ cached-line dim>> ]
+    if-empty ;
+
+M: core-text-renderer finish-text-rendering
+    text-handle>> purge-cache
+    cached-lines get purge-cache ;
+
+: rendered-line ( font string -- texture )
+    world get text-handle>>
+    [ cached-line [ image>> ] [ loc>> ] bi <texture> ]
+    2cache ;
+
+M: core-text-renderer draw-string ( font string -- )
+    rendered-line draw-texture ;
+
+M: core-text-renderer x>offset ( x font string -- n )
+    [ 2drop 0 ] [
+        cached-line line>>
+        swap 0 <CGPoint> CTLineGetStringIndexForPosition
+    ] if-empty ;
+
+M: core-text-renderer offset>x ( n font string -- x )
+    cached-line line>> swap f
+    CTLineGetOffsetForStringIndex ;
+
+M: core-text-renderer font-metrics ( font -- metrics )
+    cache-font-metrics ;
+
+M: core-text-renderer line-metrics ( font string -- metrics )
+    [ " " line-metrics clone 0 >>width ]
+    [ cached-line metrics>> ]
+    if-empty ;
+
+core-text-renderer font-renderer set-global
\ No newline at end of file
diff --git a/basis/ui/text/core-text/summary.txt b/basis/ui/text/core-text/summary.txt
new file mode 100644 (file)
index 0000000..aa17c65
--- /dev/null
@@ -0,0 +1 @@
+UI text rendering implementation using Mac OS X Core Text
diff --git a/basis/ui/text/core-text/tags.txt b/basis/ui/text/core-text/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
diff --git a/basis/ui/text/pango/authors.txt b/basis/ui/text/pango/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/text/pango/pango.factor b/basis/ui/text/pango/pango.factor
new file mode 100755 (executable)
index 0000000..8b644be
--- /dev/null
@@ -0,0 +1,43 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors alien.c-types assocs cache kernel math math.vectors
+namespaces opengl.textures pango.cairo pango.layouts ui.gadgets.worlds
+ui.text ui.text.private pango sequences ;
+IN: ui.text.pango
+
+SINGLETON: pango-renderer
+
+M: pango-renderer init-text-rendering
+    <cache-assoc> >>text-handle drop ;
+
+M: pango-renderer string-dim
+    [ " " string-dim { 0 1 } v* ]
+    [ cached-layout logical-rect>> dim>> [ >integer ] map ] if-empty ;
+
+M: pango-renderer finish-text-rendering
+    text-handle>> purge-cache
+    cached-layouts get purge-cache ;
+
+: rendered-layout ( font string -- texture )
+    world get text-handle>>
+    [ cached-layout [ image>> ] [ text-position vneg ] bi <texture> ]
+    2cache ;
+
+M: pango-renderer draw-string ( font string -- )
+    rendered-layout draw-texture ;
+
+M: pango-renderer x>offset ( x font string -- n )
+    cached-layout swap x>line-offset ;
+
+M: pango-renderer offset>x ( n font string -- x )
+    cached-layout swap line-offset>x ;
+
+M: pango-renderer font-metrics ( font -- metrics )
+    " " cached-layout metrics>> clone f >>width ;
+
+M: pango-renderer line-metrics ( font string -- metrics )
+    [ " " line-metrics clone 0 >>width ]
+    [ cached-layout metrics>> ]
+    if-empty ;
+
+pango-renderer font-renderer set-global
\ No newline at end of file
diff --git a/basis/ui/text/text-docs.factor b/basis/ui/text/text-docs.factor
new file mode 100644 (file)
index 0000000..4ac2fbb
--- /dev/null
@@ -0,0 +1,70 @@
+IN: ui.text
+USING: help.markup help.syntax kernel ui.text.private strings math fonts ;
+
+HELP: string-width
+{ $values { "font" font } { "string" string } { "w" "a positive integer" } }
+{ $contract "Outputs the width of a string." }
+{ $notes "This is a low-level word; use " { $link text-width } " instead." } ;
+
+HELP: text-width
+{ $values { "font" font } { "text" "a string or sequence of strings" } { "w" "a positive integer" } }
+{ $description "Outputs the width of a piece of text." } ;
+
+HELP: string-height
+{ $values { "font" font } { "string" string } { "h" "a positive integer" } }
+{ $contract "Outputs the height of a string." }
+{ $notes "This is a low-level word; use " { $link text-height } " instead." } ;
+
+HELP: text-height
+{ $values { "font" font } { "text" "a string or sequence of strings" } { "h" "a positive integer" } }
+{ $description "Outputs the height of a piece of text." } ;
+
+HELP: string-dim
+{ $values { "font" font } { "string" string } { "dim" "a pair of integers" } }
+{ $contract "Outputs the dimensions of a string." }
+{ $notes "This is a low-level word; use " { $link text-dim } " instead." } ;
+
+HELP: text-dim
+{ $values { "font" font } { "text" "a string or sequence of strings" } { "dim" "a pair of integers" } }
+{ $description "Outputs the dimensions of a piece of text, which is either a single-line string or an array of lines." } ;
+
+HELP: draw-string
+{ $values { "font" font } { "string" string } }
+{ $contract "Draws a line of text." } ;
+
+HELP: draw-text
+{ $values { "font" font } { "text" "a string or an array of strings" } }
+{ $description "Draws a piece of text." } ;
+
+HELP: x>offset
+{ $values { "x" real } { "font" font } { "string" string } { "n" integer } }
+{ $contract "Outputs the string index closest to the given x co-ordinate." } ;
+
+HELP: offset>x
+{ $values { "n" integer } { "font" font } { "string" string } { "x" real } }
+{ $contract "Outputs the x co-ordinate of the character at the given index." } ;
+
+HELP: line-metrics
+{ $values { "font" font } { "string" string } { "metrics" line-metrics } }
+{ $contract "Outputs a " { $link line-metrics } " object with text measurements." } ;
+
+ARTICLE: "text-rendering" "Rendering text"
+"The " { $vocab-link "ui.text" } " vocabulary provides a cross-platform interface to the operating system's native font rendering engine. Currently, it uses Core Text on Mac OS X and FreeType on Windows and X11."
+{ $subsection "fonts" }
+"Measuring text:"
+{ $subsection text-dim }
+{ $subsection text-width }
+{ $subsection text-height }
+{ $subsection line-metrics }
+"Converting screen locations to string offsets, and vice versa:"
+{ $subsection x>offset }
+{ $subsection offset>x }
+"Rendering text:"
+{ $subsection draw-text }
+"Low-level text protocol for UI backends:"
+{ $subsection string-width }
+{ $subsection string-height }
+{ $subsection string-dim }
+{ $subsection draw-string } ;
+
+ABOUT: "text-rendering"
\ No newline at end of file
diff --git a/basis/ui/text/text-tests.factor b/basis/ui/text/text-tests.factor
new file mode 100644 (file)
index 0000000..d800c88
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.text ;
+IN: ui.text.tests
diff --git a/basis/ui/text/text.factor b/basis/ui/text/text.factor
new file mode 100644 (file)
index 0000000..d0766e9
--- /dev/null
@@ -0,0 +1,71 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel arrays sequences math math.order opengl opengl.gl
+strings fonts colors accessors ;
+IN: ui.text
+
+<PRIVATE
+
+SYMBOL: font-renderer
+
+HOOK: init-text-rendering font-renderer ( world -- )
+
+HOOK: finish-text-rendering font-renderer ( world -- )
+
+M: object finish-text-rendering drop ;
+
+HOOK: string-dim font-renderer ( font string -- dim )
+
+HOOK: string-width font-renderer ( font string -- w )
+
+HOOK: string-height font-renderer ( font string -- h )
+
+M: object string-dim [ string-width ] [ string-height ] 2bi 2array ;
+
+M: object string-width string-dim first ;
+
+M: object string-height string-dim second ;
+
+HOOK: draw-string font-renderer ( font string -- )
+
+HOOK: free-fonts font-renderer ( world -- )
+
+: combine-text-dim ( dim1 dim2 -- dim3 )
+    [ [ first ] bi@ max ]
+    [ [ second ] bi@ + ]
+    2bi 2array ;
+
+PRIVATE>
+
+HOOK: x>offset font-renderer ( x font string -- n )
+
+HOOK: offset>x font-renderer ( n font string -- x )
+
+GENERIC: text-dim ( font text -- dim )
+
+M: string text-dim string-dim ;
+
+M: array text-dim
+    [ { 0 0 } ] 2dip [ string-dim combine-text-dim ] with each ;
+
+: text-width ( font text -- w ) text-dim first ;
+
+: text-height ( font text -- h ) text-dim second ;
+
+HOOK: font-metrics font-renderer ( font -- metrics )
+
+HOOK: line-metrics font-renderer ( font string -- metrics )
+
+GENERIC: draw-text ( font text -- )
+
+M: string draw-text draw-string ;
+
+M: selection draw-text draw-string ;
+
+M: array draw-text
+    GL_MODELVIEW [
+        [
+            [ draw-string ]
+            [ [ 0.0 ] 2dip string-height 0.0 glTranslated ] 2bi
+        ] with each
+    ] do-matrix ;
\ No newline at end of file
diff --git a/basis/ui/tools/browser/browser-docs.factor b/basis/ui/tools/browser/browser-docs.factor
new file mode 100644 (file)
index 0000000..03a5218
--- /dev/null
@@ -0,0 +1,14 @@
+USING: help.markup help.syntax ui.commands ;
+IN: ui.tools.browser
+
+ARTICLE: "ui-browser" "UI browser"
+"The browser is used to display Factor code, documentation, and vocabularies. The browser is opened when a word or articlelink presentation is clicked. It can also be opened using words:"
+{ $subsection com-browse }
+{ $subsection browser-window }
+{ $command-map browser-gadget "toolbar" }
+{ $command-map browser-gadget "scrolling" }
+{ $command-map browser-gadget "navigation" }
+{ $command-map browser-gadget "multi-touch" }
+"Browsers are instances of " { $link browser-gadget } "." ;
+
+ABOUT: "ui-browser"
\ No newline at end of file
index f56f5bcc4e51ff2e3b7e519b61b015f6cf2e73e8..7477edbe6a713499bc603588c352ead84926abe1 100644 (file)
@@ -1,5 +1,5 @@
 IN: ui.tools.browser.tests
-USING: tools.test tools.test.ui ui.tools.browser ;
+USING: tools.test tools.test.ui ui.tools.browser math ;
 
 \ <browser-gadget> must-infer
-[ ] [ <browser-gadget> [ ] with-grafted-gadget ] unit-test
+[ ] [ \ + <browser-gadget> [ ] with-grafted-gadget ] unit-test
index becb401fa618e234a01f11548d4e956e8b126538..8fcd14c95f051b0233d3db4fcbc144690fa86ab0 100644 (file)
@@ -1,35 +1,51 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: debugger ui.tools.workspace help help.topics kernel
-models models.history ui.commands ui.gadgets ui.gadgets.panes
-ui.gadgets.scrollers ui.gadgets.tracks ui.gestures
-ui.gadgets.buttons compiler.units assocs words vocabs
-accessors fry combinators.short-circuit ;
+USING: debugger help help.topics help.crossref kernel models compiler.units
+assocs words vocabs accessors fry combinators.short-circuit
+sequences models models.history tools.apropos combinators
+ui.commands ui.gadgets ui.gadgets.panes ui.gadgets.scrollers
+ui.gadgets.tracks ui.gestures ui.gadgets.buttons ui.gadgets.packs
+ui.gadgets.editors ui.gadgets.labels ui.gadgets.status-bar
+ui.gadgets.glass ui.gadgets.borders ui.tools.common
+ui.tools.browser.popups ui ;
 IN: ui.tools.browser
 
-TUPLE: browser-gadget < track pane history ;
+TUPLE: browser-gadget < tool pane scroller search-field popup ;
 
-: show-help ( link help -- )
-    history>> dup add-history
+{ 650 400 } browser-gadget set-tool-dim
+
+: show-help ( link browser-gadget -- )
+    model>> dup add-history
     [ >link ] dip set-model ;
 
 : <help-pane> ( browser-gadget -- gadget )
-    history>> [ '[ _ print-topic ] try ] <pane-control> ;
-
-: init-history ( browser-gadget -- )
-    "handbook" >link <history> >>history drop ;
-
-: <browser-gadget> ( -- gadget )
-    { 0 1 } browser-gadget new-track
-        dup init-history
-        add-toolbar
+    model>> [ '[ _ print-topic ] try ] <pane-control> ;
+
+: search-browser ( string browser -- )
+    '[ <apropos> _ show-help ] unless-empty ;
+
+: <search-field> ( browser -- field )
+    '[ _ search-browser ] <action-field>
+        10 >>min-cols
+        10 >>max-cols ;
+
+: <browser-toolbar> ( browser -- toolbar )
+    horizontal <track>
+        0 >>fill
+        1/2 >>align
+        { 5 5 } >>gap
+        over <toolbar> f track-add
+        swap search-field>> "Search:" label-on-left 1 track-add ;
+
+: <browser-gadget> ( link -- gadget )
+    vertical browser-gadget new-track
+        1 >>fill
+        swap >link <history> >>model
+        dup <search-field> >>search-field
+        dup <browser-toolbar> { 3 3 } <border> { 1 0 } >>fill f track-add
         dup <help-pane> >>pane
-        dup pane>> <scroller> 1 track-add ;
-
-M: browser-gadget call-tool* show-help ;
-
-M: browser-gadget tool-scroller
-    pane>> find-scroller ;
+        dup pane>> <scroller> >>scroller
+        dup scroller>> 1 track-add ;
 
 M: browser-gadget graft*
     [ add-definition-observer ] [ call-next-method ] bi ;
@@ -37,6 +53,13 @@ M: browser-gadget graft*
 M: browser-gadget ungraft*
     [ call-next-method ] [ remove-definition-observer ] bi ;
 
+M: browser-gadget handle-gesture
+    {
+        { [ over key-gesture? not ] [ call-next-method ] }
+        { [ dup popup>> ] [ { [ pass-to-popup ] [ call-next-method ] } 2&& ] }
+        [ call-next-method ]
+    } cond ;
+
 : showing-definition? ( defspec assoc -- ? )
     {
         [ key? ]
@@ -45,24 +68,35 @@ M: browser-gadget ungraft*
     } 2|| ;
 
 M: browser-gadget definitions-changed ( assoc browser -- )
-    history>>
-    dup value>> rot showing-definition?
-    [ notify-connections ] [ drop ] if ;
+    model>> [ value>> swap showing-definition? ] keep
+    '[ _ notify-connections ] when ;
 
-: help-action ( browser-gadget -- link )
-    history>> value>> >link ;
+M: browser-gadget focusable-child* search-field>> ;
 
-: com-follow ( link -- ) browser-gadget call-tool ;
+: (browser-window) ( topic -- )
+    <browser-gadget> "Browser" open-status-window ;
 
-: com-back ( browser -- ) history>> go-back ;
+: browser-window ( -- )
+    "handbook" (browser-window) ;
 
-: com-forward ( browser -- ) history>> go-forward ;
+\ browser-window H{ { +nullary+ t } } define-command
 
-: com-documentation ( browser -- ) "handbook" swap show-help ;
+: com-browse ( link -- )
+    [ browser-gadget? ] find-window
+    [ [ raise-window ] [ gadget-child show-help ] bi ]
+    [ (browser-window) ] if* ;
+
+: show-browser ( -- ) "handbook" com-browse ;
 
-: com-vocabularies ( browser -- ) "vocab-index" swap show-help ;
+\ show-browser H{ { +nullary+ t } } define-command
 
-: browser-help ( -- ) "ui-browser" help-window ;
+: com-back ( browser -- ) model>> go-back ;
+
+: com-forward ( browser -- ) model>> go-forward ;
+
+: com-documentation ( browser -- ) "handbook" swap show-help ;
+
+: browser-help ( -- ) "ui-browser" com-browse ;
 
 \ browser-help H{ { +nullary+ t } } define-command
 
@@ -70,11 +104,41 @@ browser-gadget "toolbar" f {
     { T{ key-down f { A+ } "LEFT" } com-back }
     { T{ key-down f { A+ } "RIGHT" } com-forward }
     { f com-documentation }
-    { f com-vocabularies }
     { T{ key-down f f "F1" } browser-help }
 } define-command-map
 
+: ?show-help ( link browser -- )
+    over [ show-help ] [ 2drop ] if ;
+
+: navigate ( browser quot -- )
+    '[ control-value @ ] keep ?show-help ;
+
+: com-up ( browser -- ) [ article-parent ] navigate ;
+
+: com-prev ( browser -- ) [ prev-article ] navigate ;
+
+: com-next ( browser -- ) [ next-article ] navigate ;
+
+browser-gadget "navigation" "Commands for navigating in the article hierarchy" {
+    { T{ key-down f { A+ } "u" } com-up }
+    { T{ key-down f { A+ } "p" } com-prev }
+    { T{ key-down f { A+ } "n" } com-next }
+    { T{ key-down f { A+ } "k" } com-show-outgoing-links }
+    { T{ key-down f { A+ } "K" } com-show-incoming-links }
+} define-command-map
+
 browser-gadget "multi-touch" f {
-    { T{ left-action } com-back }
-    { T{ right-action } com-forward }
+    { left-action com-back }
+    { right-action com-forward }
 } define-command-map
+
+browser-gadget "scrolling"
+"The browser's scroller can be scrolled from the keyboard."
+{
+    { T{ key-down f f "UP" } com-scroll-up }
+    { T{ key-down f f "DOWN" } com-scroll-down }
+    { T{ key-down f f "PAGE_UP" } com-page-up }
+    { T{ key-down f f "PAGE_DOWN" } com-page-down }
+} define-command-map
+
+MAIN: browser-window
\ No newline at end of file
diff --git a/basis/ui/tools/browser/popups/authors.txt b/basis/ui/tools/browser/popups/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/tools/browser/popups/popups.factor b/basis/ui/tools/browser/popups/popups.factor
new file mode 100644 (file)
index 0000000..05d7779
--- /dev/null
@@ -0,0 +1,55 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays assocs definitions fry help.topics kernel
+colors.constants math.rectangles models.arrow namespaces sequences
+sorting definitions.icons ui.gadgets ui.gadgets.glass
+ui.gadgets.labeled ui.gadgets.scrollers ui.gadgets.tables
+ui.gadgets.search-tables ui.gadgets.wrappers ui.gestures ui.operations
+ui.pens.solid ui.images ;
+IN: ui.tools.browser.popups
+
+SINGLETON: link-renderer
+
+M: link-renderer row-columns
+    drop first2 [ definition-icon <image-name> ] dip 2array ;
+
+M: link-renderer row-value drop first ;
+
+TUPLE: links-popup < wrapper ;
+
+: sorted-links ( links -- alist )
+    [ dup article-title ] { } map>assoc sort-values ;
+
+: match? ( value str -- ? )
+    swap second subseq? ;
+
+: <links-table> ( model quot -- table )
+    '[ @ sorted-links ] <arrow>
+    link-renderer [ second ] <search-table>
+        [ invoke-primary-operation ] >>action
+        [ hide-glass ] >>hook
+        t >>selection-required?
+        10 >>min-rows
+        10 >>max-rows
+        30 >>min-cols
+        30 >>max-cols ;
+
+: <links-popup> ( model quot title -- gadget )
+    [ <links-table> COLOR: white <solid> >>interior ] dip
+    <labeled-gadget> links-popup new-wrapper ;
+
+links-popup H{
+    { T{ key-down f f "ESC" } [ hide-glass ] }
+} set-gestures
+
+SLOT: model
+
+: show-links-popup ( browser-gadget quot title -- )
+    [ dup model>> ] 2dip <links-popup>
+    [ hand-loc get { 0 0 } <rect> show-glass ] [ request-focus ] bi ;
+
+: com-show-outgoing-links ( browser-gadget -- )
+    [ uses ] "Outgoing links" show-links-popup ;
+
+: com-show-incoming-links ( browser-gadget -- )
+    [ usage ] "Incoming links" show-links-popup ;
diff --git a/basis/ui/tools/common/common.factor b/basis/ui/tools/common/common.factor
new file mode 100644 (file)
index 0000000..e581e72
--- /dev/null
@@ -0,0 +1,36 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors assocs classes classes.mixin kernel namespaces
+parser ui.gadgets ui.gadgets.scrollers ui.gadgets.tracks
+combinators.short-circuit ;
+IN: ui.tools.common
+
+SYMBOL: tool-dims
+
+tool-dims global [ H{ } clone or ] change-at
+
+TUPLE: tool < track ;
+
+M: tool pref-dim*
+    { [ class tool-dims get at ] [ call-next-method ] } 1|| ;
+
+M: tool layout*
+    [ call-next-method ]
+    [ [ dim>> ] [ class ] bi tool-dims get set-at ]
+    bi ;
+
+: set-tool-dim ( dim class -- ) tool-dims get set-at ;
+
+SLOT: scroller
+
+: com-page-up ( tool -- )
+    scroller>> scroll-up-page ;
+
+: com-page-down ( tool -- )
+    scroller>> scroll-down-page ;
+
+: com-scroll-up ( tool -- )
+    scroller>> scroll-up-line ;
+
+: com-scroll-down ( tool -- )
+    scroller>> scroll-down-line ;
index 94c118953de612c4c8f1e57884f40802fc05c09c..b68b34977428bea9eb557e27738ba065fb2ed00d 100644 (file)
@@ -1,9 +1,9 @@
 USING: ui.gadgets help.markup help.syntax kernel quotations
-continuations debugger ui ;
+continuations debugger ui continuations ;
 IN: ui.tools.debugger
 
 HELP: <debugger>
-{ $values { "error" "an error" } { "restarts" "a sequence of " { $link restart } " instances" } { "restart-hook" { $quotation "( list -- )" } } { "gadget" "a new " { $link gadget } } }
+{ $values { "error" "an error" } { "continuation" continuation } { "restarts" "a sequence of " { $link restart } " instances" } { "restart-hook" { $quotation "( debugger -- )" } } { "debugger" "a new " { $link debugger } } }
 { $description
     "Creates a gadget displaying a description of the error, along with buttons to print the contents of the stacks in the listener, and a list of restarts."
 } ;
@@ -11,5 +11,5 @@ HELP: <debugger>
 { <debugger> debugger-window } related-words
 
 HELP: debugger-window
-{ $values { "error" "an error" } }
+{ $values { "error" "an error" } { "continuation" continuation } }
 { $description "Opens a window with a description of the error." } ;
index cfe7baf0ae9b404a756d1f0df5107092a751bb8d..c3ead4e3f5625f8cf55434ac295b231ac1c40c94 100644 (file)
@@ -1,47 +1,65 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays hashtables io kernel math models
-namespaces sequences sequences words continuations debugger
-prettyprint help editors ui ui.commands ui.gestures ui.gadgets
-ui.gadgets.worlds ui.gadgets.packs ui.gadgets.buttons
-ui.gadgets.labels ui.gadgets.panes ui.gadgets.presentations
-ui.gadgets.viewports ui.gadgets.lists ui.gadgets.tracks
-ui.gadgets.scrollers ui.gadgets.panes ui.tools.traceback ;
+colors.constants namespaces sequences sequences words continuations
+debugger prettyprint help editors fonts ui ui.commands ui.gestures
+ui.gadgets ui.pens.solid ui.gadgets.worlds ui.gadgets.packs
+ui.gadgets.buttons ui.gadgets.labels ui.gadgets.panes
+ui.gadgets.presentations ui.gadgets.viewports ui.gadgets.tables
+ui.gadgets.tracks ui.gadgets.scrollers ui.gadgets.panes
+ui.gadgets.borders ui.gadgets.status-bar ui.tools.traceback
+ui.tools.inspector ;
 IN: ui.tools.debugger
 
 TUPLE: debugger < track error restarts restart-hook restart-list continuation ;
 
 <PRIVATE
 
+SINGLETON: restart-renderer
+
+M: restart-renderer row-columns
+    drop [ name>> ] [ "Abort" ] if* "• " prepend 1array ;
+
 : <restart-list> ( debugger -- gadget )
-    [ restart-hook>> ] [ restarts>> ] bi
-    [ name>> ] swap <model> <list> ; inline
+    dup restarts>> f prefix <model> restart-renderer <table>
+        [ [ \ restart invoke-command ] when* ] >>action
+        swap restart-hook>> >>hook
+        t >>selection-required?
+        t >>single-click? ; inline
 
 : <error-pane> ( error -- pane )
     <pane> [ [ print-error ] with-pane ] keep ; inline
 
-: <debugger-display> ( debugger -- gadget )
-    <filled-pile>
-        over error>> <error-pane> add-gadget
-        swap restart-list>> add-gadget ; inline
+: <error-display> ( debugger -- gadget )
+    [ <filled-pile> ] dip
+    [ error>> <error-pane> add-gadget ]
+    [
+        dup restart-hook>> [
+            [ "To continue, pick one of the options below:" <label> add-gadget ] dip
+            restart-list>> add-gadget
+        ] [ drop ] if
+    ] bi ;
 
 PRIVATE>
 
-: <debugger> ( error restarts restart-hook -- gadget )
-    { 0 1 } debugger new-track
-        add-toolbar
+: <debugger> ( error continuation restarts restart-hook -- debugger )
+    vertical debugger new-track
+        { 3 3 } >>gap
         swap >>restart-hook
         swap >>restarts
+        swap >>continuation
         swap >>error
-        error-continuation get >>continuation
+        add-toolbar
         dup <restart-list> >>restart-list
-        dup <debugger-display> <scroller> 1 track-add ;
+        dup <error-display> f track-add
+        COLOR: white <solid> >>interior ;
 
-M: debugger focusable-child* restart-list>> ;
+M: debugger focusable-child*
+    dup restart-hook>> [ restart-list>> ] [ drop t ] if ;
 
-: debugger-window ( error -- )
+: debugger-window ( error continuation -- )
     #! No restarts for the debugger window
-    f [ drop ] <debugger> "Error" open-window ;
+    f f <debugger> "Error" open-status-window ;
 
 GENERIC: error-in-debugger? ( error -- ? )
 
@@ -50,7 +68,8 @@ M: world-error error-in-debugger? world>> gadget-child debugger? ;
 M: object error-in-debugger? drop f ;
 
 [
-    dup error-in-debugger? [ rethrow ] [ debugger-window ] if 
+    dup error-in-debugger?
+    [ rethrow ] [ error-continuation get debugger-window ] if 
 ] ui-error-hook set-global
 
 M: world-error error.
@@ -63,9 +82,9 @@ debugger "gestures" f {
     { T{ button-down } request-focus }
 } define-command-map
 
-: com-traceback ( debugger -- ) continuation>> traceback-window ;
+: com-inspect ( debugger -- ) error>> inspector ;
 
-\ com-traceback H{ } define-command
+: com-traceback ( debugger -- ) continuation>> traceback-window ;
 
 : com-help ( debugger -- ) error>> (:help) ;
 
@@ -76,7 +95,8 @@ debugger "gestures" f {
 \ com-edit H{ { +listener+ t } } define-command
 
 debugger "toolbar" f {
-    { T{ key-down f f "s" } com-traceback }
-    { T{ key-down f f "h" } com-help }
-    { T{ key-down f f "e" } com-edit }
+    { T{ key-down f { C+ } "i" } com-inspect }
+    { T{ key-down f { C+ } "t" } com-traceback }
+    { T{ key-down f { C+ } "h" } com-help }
+    { T{ key-down f { C+ } "e" } com-edit }
 } define-command-map
index 38db81c3dc26e5664f741e905c170fc514c69de4..6a8322ac02fb9aded6b27a4c6bb782aa6bf9defa 100644 (file)
@@ -1,17 +1,18 @@
-! Copyright (C) 2007, 2008 Slava Pestov.
+! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: ui.gadgets colors kernel ui.render namespaces models
-models.mapping sequences ui.gadgets.buttons ui.gadgets.packs
-ui.gadgets.labels tools.deploy.config tools.deploy.config.editor
-namespaces ui.gadgets.editors ui.gadgets.borders ui.gestures
+USING: colors kernel namespaces models tools.deploy.config
+tools.deploy.config.editor tools.deploy vocabs
+namespaces models.mapping sequences system accessors fry
+ui.gadgets ui.render ui.gadgets.buttons ui.gadgets.packs
+ui.gadgets.labels ui.gadgets.editors ui.gadgets.borders ui.gestures
 ui.commands assocs ui.gadgets.tracks ui ui.tools.listener
-tools.deploy vocabs ui.tools.workspace system accessors fry ;
+ui.tools.browser ;
 IN: ui.tools.deploy
 
 TUPLE: deploy-gadget < pack vocab settings ;
 
 : bundle-name ( parent -- parent )
-    deploy-name get <field>
+    deploy-name get <model-field>
     "Executable name:" label-on-left add-gadget ;
 
 : deploy-ui ( parent -- parent )
@@ -76,12 +77,13 @@ TUPLE: deploy-gadget < pack vocab settings ;
     swap find-deploy-vocab set-deploy-config ;
 
 : com-deploy ( gadget -- )
-    dup com-save
-    dup find-deploy-vocab '[ _ deploy ] call-listener
-    close-window ;
+    [ com-save ]
+    [ find-deploy-vocab '[ _ deploy ] \ deploy call-listener ]
+    [ close-window ]
+    tri ;
 
 : com-help ( -- )
-    "ui.tools.deploy" help-window ;
+    "ui.tools.deploy" com-browse ;
 
 \ com-help H{
     { +nullary+ t }
@@ -102,17 +104,17 @@ deploy-gadget "toolbar" f {
 } define-command-map
 
 : <deploy-gadget> ( vocab -- gadget )
-    deploy-gadget new-gadget
-      over                           >>vocab
-      { 0 1 }                        >>orientation
-      swap <deploy-settings>         >>settings    
-      dup settings>>                 add-gadget
-      dup <toolbar> { 10 10 } >>gap  add-gadget
+    deploy-gadget new
+      over >>vocab
+      vertical >>orientation
+      swap <deploy-settings> >>settings
+      dup settings>> add-gadget
+      dup <toolbar> { 10 10 } >>gap add-gadget
     deploy-settings-theme
     dup com-revert ;
     
 : deploy-tool ( vocab -- )
     vocab-name
-    [ <deploy-gadget> 10 <border> ]
-    [ "Deploying \"" "\"" surround ] bi
+    [ <deploy-gadget> { 10 10 } <border> ]
+    [ "Deploying “" "”" surround ] bi
     open-window ;
diff --git a/basis/ui/tools/inspector/inspector-docs.factor b/basis/ui/tools/inspector/inspector-docs.factor
new file mode 100644 (file)
index 0000000..c329f03
--- /dev/null
@@ -0,0 +1,24 @@
+USING: help.markup help.syntax ui.commands ui.gadgets.slots
+ui.gadgets.editors ;
+IN: ui.tools.inspector
+
+ARTICLE: "ui-inspector-edit" "Editing slot values in the inspector"
+"Slot values can be edited in the inspector. Clicking the ellipsis to the left of the slot's textual representation displays a slot editor gadget. A text representation of the object can be edited in the slot editor. The parser is used to turn the text representation back into an object. Keep in mind that some structure is lost in the conversion; see " { $link "prettyprint-limitations" } "."
+$nl
+"The slot editor's text editing commands are standard; see " { $link "ui.gadgets.editors" } "."
+$nl
+"The slot editor has a toolbar containing various commands."
+{ $command-map slot-editor "toolbar" } ;
+
+ARTICLE: "ui-inspector" "UI inspector"
+"The graphical inspector provides functionality similar to the terminal inspector (see " { $link "inspector" } "), adding in-place editing of slot values."
+$nl
+"To display an object in the UI inspector, right-click a presentation and choose " { $strong "Inspector" } " from the menu that appears. The inspector can also be opened from the listener using a word:"
+{ $subsection inspector }
+"The inspector embeds a table gadget, which supports keyboard navigation; see " { $link "ui.gadgets.tables" } ". It also provides a few other commands:"
+{ $command-map inspector-gadget "toolbar" }
+{ $command-map inspector-gadget "multi-touch" }
+"The UI inspector is an instance of " { $link inspector-gadget } "."
+{ $subsection "ui-inspector-edit" } ;
+
+ABOUT: "ui-inspector"
\ No newline at end of file
diff --git a/basis/ui/tools/inspector/inspector-tests.factor b/basis/ui/tools/inspector/inspector-tests.factor
new file mode 100644 (file)
index 0000000..44e20fb
--- /dev/null
@@ -0,0 +1,6 @@
+IN: ui.tools.inspector.tests
+USING: tools.test ui.tools.inspector math models ;
+
+\ <inspector-gadget> must-infer
+
+[ ] [ \ + <model> <inspector-gadget> com-edit-slot ] unit-test
\ No newline at end of file
index 579210325b26d96fc4931a1c067e580daecfea50..17ffc9ee18e834f5e1dd66fb6b014e5cceff0878 100644 (file)
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors ui.tools.workspace inspector kernel ui.commands
-ui.gadgets ui.gadgets.panes ui.gadgets.scrollers
-ui.gadgets.slots ui.gadgets.tracks ui.gestures
-ui.gadgets.buttons namespaces ;
+USING: accessors inspector namespaces kernel models fry
+colors.constants models.arrow prettyprint sequences mirrors assocs
+classes io io.styles arrays hashtables math.order sorting refs fonts
+ui.tools.browser ui.commands ui.operations ui.gadgets ui.gadgets.panes
+ui.gadgets.scrollers ui.gadgets.slots ui.gadgets.tracks ui.gestures
+ui.gadgets.buttons ui.gadgets.tables ui.gadgets.status-bar
+ui.gadgets.labeled ui.tools.common ui ;
 IN: ui.tools.inspector
 
-TUPLE: inspector-gadget < track object pane ;
+TUPLE: inspector-gadget < tool table ;
 
-: refresh ( inspector -- )
-    [ object>> ] [ pane>> ] bi [
-        +editable+ on
-        +number-rows+ on
-        describe
-    ] with-pane ;
+TUPLE: slot-description key key-string value value-string ;
 
-: <inspector-gadget> ( -- gadget )
-    { 0 1 } inspector-gadget new-track
+: <slot-description> ( key value -- slot-description )
+    [ dup unparse-short ] bi@ slot-description boa ;
+
+SINGLETON: inspector-renderer
+
+M: inspector-renderer row-columns
+    drop [ key-string>> ] [ value-string>> ] bi 2array ;
+
+M: inspector-renderer row-value
+    drop value>> ;
+
+M: inspector-renderer column-titles
+    drop { "Key" "Value" } ;
+
+: <summary-gadget> ( model -- gadget )
+    [
+        standard-table-style [
+            [
+                [
+                    [ "Class:" write ] with-cell
+                    [ class . ] with-cell
+                ] with-row
+            ]
+            [
+                [
+                    [ "Object:" write ] with-cell
+                    [ short. ] with-cell
+                ] with-row
+            ]
+            [
+                [
+                    [ "Summary:" write ] with-cell
+                    [ summary. ] with-cell
+                ] with-row
+            ] tri
+        ] tabular-output
+    ] <pane-control> ;
+
+GENERIC: make-slot-descriptions ( obj -- seq )
+
+M: object make-slot-descriptions
+    make-mirror [ <slot-description> ] { } assoc>map ;
+
+M: hashtable make-slot-descriptions
+    call-next-method [ [ key-string>> ] compare ] sort ;
+
+: <inspector-table> ( model -- table )
+    [ make-slot-descriptions ] <arrow> inspector-renderer <table>
+        [ invoke-primary-operation ] >>action
+        monospace-font >>font
+        COLOR: dark-gray >>column-line-color
+        6 >>gap
+        15 >>min-rows
+        15 >>max-rows
+        40 >>min-cols
+        40 >>max-cols ;
+
+: <inspector-gadget> ( model -- gadget )
+    vertical inspector-gadget new-track
+        { 3 3 } >>gap
         add-toolbar
-        <pane> >>pane
-        dup pane>> <scroller> 1 track-add ;
+        swap >>model
+        dup model>> <inspector-table> >>table
+        dup model>> <summary-gadget> "Object" <labeled-gadget> f track-add
+        dup table>> <scroller> "Contents" <labeled-gadget> 1 track-add ;
 
-: inspect-object ( obj mirror keys inspector -- )
-    2nip swap >>object refresh ;
+M: inspector-gadget focusable-child*
+    table>> ;
 
-\ &push H{ { +nullary+ t } { +listener+ t } } define-command
+: com-refresh ( inspector -- )
+    model>> notify-connections ;
 
-\ &back H{ { +nullary+ t } { +listener+ t } } define-command
+: com-push ( inspector -- obj )
+    control-value ;
 
-\ &globals H{ { +nullary+ t } { +listener+ t } } define-command
+\ com-push H{ { +listener+ t } } define-command
 
-: inspector-help ( -- ) "ui-inspector" help-window ;
+: slot-editor-window ( close-hook update-hook assoc key key-string -- )
+    [ <value-ref> <slot-editor> ] [ "Slot editor: " prepend ] bi*
+    open-window ;
+
+: com-edit-slot ( inspector -- )
+    [ close-window ] swap
+    [ '[ _ com-refresh ] ]
+    [ control-value make-mirror ]
+    [ table>> (selected-row) ] tri [
+        [ key>> ] [ key-string>> ] bi
+        slot-editor-window
+    ] [ 2drop 2drop ] if ;
+
+: inspector-help ( -- ) "ui-inspector" com-browse ;
 
 \ inspector-help H{ { +nullary+ t } } define-command
 
 inspector-gadget "toolbar" f {
-    { T{ update-object } refresh }
-    { f &push }
-    { f &back }
-    { f &globals }
+    { T{ update-object } com-refresh }
+    { T{ key-down f f "p" } com-push }
+    { T{ key-down f f "e" } com-edit-slot }
     { T{ key-down f f "F1" } inspector-help }
 } define-command-map
 
 inspector-gadget "multi-touch" f {
-    { T{ left-action } &back }
+    { up-action com-refresh }
 } define-command-map
 
-M: inspector-gadget tool-scroller
-    pane>> find-scroller ;
+: inspect-model ( model -- )
+    <inspector-gadget> "Inspector" open-status-window ;
+
+: inspector ( obj -- )
+    <model> inspect-model ;
diff --git a/basis/ui/tools/interactor/authors.txt b/basis/ui/tools/interactor/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/ui/tools/interactor/interactor-docs.factor b/basis/ui/tools/interactor/interactor-docs.factor
deleted file mode 100644 (file)
index 338a9be..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-USING: ui.gadgets ui.gadgets.editors listener io help.syntax
-help.markup ;
-IN: ui.tools.interactor
-
-HELP: interactor
-{ $class-description "An interactor is an " { $link editor } " intended to be used as the input component of a " { $link "ui-listener" } "."
-$nl
-"Interactors are created by calling " { $link <interactor> } "."
-$nl
-"Interactors implement the " { $link stream-readln } ", " { $link stream-read } " and " { $link read-quot } " generic words." } ;
diff --git a/basis/ui/tools/interactor/interactor-tests.factor b/basis/ui/tools/interactor/interactor-tests.factor
deleted file mode 100644 (file)
index 101b730..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-IN: ui.tools.interactor.tests
-USING: ui.tools.interactor ui.gadgets.panes namespaces
-ui.gadgets.editors concurrency.promises threads listener
-tools.test kernel calendar parser accessors calendar io ;
-
-\ <interactor> must-infer
-
-[
-    [ ] [ <pane> <pane-stream> <interactor> "interactor" set ] unit-test
-
-    [ ] [ "interactor" get register-self ] unit-test
-
-    [ ] [ "[ 1 2 3" "interactor" get set-editor-string ] unit-test
-
-    [ ] [ <promise> "promise" set ] unit-test
-
-    [
-        self "interactor" get (>>thread)
-        "interactor" get stream-read-quot "promise" get fulfill
-    ] "Interactor test" spawn drop
-
-    ! This should not throw an exception
-    [ ] [ "interactor" get evaluate-input ] unit-test
-
-    [ ] [ [ "interactor" get interactor-busy? ] [ yield ] while ] unit-test
-
-    [ ] [ "[ 1 2 3 ]" "interactor" get set-editor-string ] unit-test
-
-    [ ] [ "interactor" get evaluate-input ] unit-test
-
-    [ [ [ 1 2 3 ] ] ] [ "promise" get 5 seconds ?promise-timeout ] unit-test
-] with-interactive-vocabs
-
-! Hang
-[ ] [ <pane> <pane-stream> <interactor> "interactor" set ] unit-test
-
-[ ] [ [ "interactor" get stream-read-quot drop ] "A" spawn drop ] unit-test
-
-[ ] [ [ "interactor" get stream-read-quot drop ] "B" spawn drop ] unit-test
-
-[ ] [ 1 seconds sleep ] unit-test
-
-[ ] [ "interactor" get interactor-eof ] unit-test
-
-[ ] [ <pane> <pane-stream> <interactor> "interactor" set ] unit-test
-
-: text "Hello world.\nThis is a test." ;
-
-[ ] [ text "interactor" get set-editor-string ] unit-test
-
-[ ] [ <promise> "promise" set ] unit-test
-
-[ ] [
-    [
-        "interactor" get register-self
-        "interactor" get contents "promise" get fulfill
-    ] in-thread
-] unit-test
-
-[ ] [ 100 milliseconds sleep ] unit-test
-
-[ ] [ "interactor" get evaluate-input ] unit-test
-
-[ ] [ 100 milliseconds sleep ] unit-test
-    
-[ ] [ "interactor" get interactor-eof ] unit-test
-
-[ t ] [ "promise" get 2 seconds ?promise-timeout text = ] unit-test
-
-[ ] [ <pane> <pane-stream> <interactor> "interactor" set ] unit-test
-
-[ ] [ text "interactor" get set-editor-string ] unit-test
-
-[ ] [ <promise> "promise" set ] unit-test
-
-[ ] [
-    [
-        "interactor" get register-self
-        "interactor" get stream-read1 "promise" get fulfill
-    ] in-thread
-] unit-test
-
-[ ] [ 100 milliseconds sleep ] unit-test
-
-[ ] [ "interactor" get evaluate-input ] unit-test
-
-[ CHAR: H ] [ "promise" get 2 seconds ?promise-timeout ] unit-test
diff --git a/basis/ui/tools/interactor/interactor.factor b/basis/ui/tools/interactor/interactor.factor
deleted file mode 100644 (file)
index eb2eef3..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: arrays assocs combinators continuations documents
-hashtables io io.styles kernel math math.order math.vectors
-models models.delay namespaces parser lexer prettyprint
-quotations sequences strings threads listener classes.tuple
-ui.commands ui.gadgets ui.gadgets.editors ui.gadgets.status-bar
-ui.gadgets.presentations ui.gadgets.worlds ui.gestures call
-definitions calendar concurrency.flags concurrency.mailboxes
-ui.tools.workspace accessors sets destructors fry vocabs.parser ;
-IN: ui.tools.interactor
-
-! If waiting is t, we're waiting for user input, and invoking
-! evaluate-input resumes the thread.
-TUPLE: interactor < source-editor
-output history flag mailbox thread waiting help ;
-
-: register-self ( interactor -- )
-    <mailbox> >>mailbox
-    self >>thread
-    drop ;
-
-: interactor-continuation ( interactor -- continuation )
-    thread>> continuation>> value>> ;
-
-: interactor-busy? ( interactor -- ? )
-    #! We're busy if there's no thread to resume.
-    [ waiting>> ]
-    [ thread>> dup [ thread-registered? ] when ]
-    bi and not ;
-
-: interactor-use ( interactor -- seq )
-    dup interactor-busy? [ drop f ] [
-        use swap
-        interactor-continuation name>>
-        assoc-stack
-    ] if ;
-
-: <help-model> ( interactor -- model ) caret>> 1/3 seconds <delay> ;
-
-: <interactor> ( output -- gadget )
-    interactor new-editor
-        V{ } clone >>history
-        <flag> >>flag
-        dup <help-model> >>help
-        swap >>output ;
-
-M: interactor graft*
-    [ call-next-method ] [ dup help>> add-connection ] bi ;
-
-M: interactor ungraft*
-    [ dup help>> remove-connection ] [ call-next-method ] bi ;
-
-: word-at-loc ( loc interactor -- word )
-    over [
-        [ model>> T{ one-word-elt } elt-string ] keep
-        interactor-use assoc-stack
-    ] [
-        2drop f
-    ] if ;
-
-M: interactor model-changed
-    2dup help>> eq? [
-        swap value>> over word-at-loc swap show-summary
-    ] [
-        call-next-method
-    ] if ;
-
-: write-input ( string input -- )
-    <input> presented associate
-    [ H{ { font-style bold } } format ] with-nesting ;
-
-: interactor-input. ( string interactor -- )
-    output>> [
-        dup string? [ dup write-input nl ] [ short. ] if
-    ] with-output-stream* ;
-
-: add-interactor-history ( str interactor -- )
-    over empty? [ 2drop ] [ history>> adjoin ] if ;
-
-: interactor-continue ( obj interactor -- )
-    mailbox>> mailbox-put ;
-
-: clear-input ( interactor -- )
-    model>> [ clear-doc ] call( model -- ) ;
-
-: interactor-finish ( interactor -- )
-    [ editor-string ] keep
-    [ interactor-input. ] 2keep
-    [ add-interactor-history ] keep
-    clear-input ;
-
-: interactor-eof ( interactor -- )
-    dup interactor-busy? [
-        f over interactor-continue
-    ] unless drop ;
-
-: evaluate-input ( interactor -- )
-    dup interactor-busy? [
-        dup control-value over interactor-continue
-    ] unless drop ;
-
-: interactor-yield ( interactor -- obj )
-    dup thread>> self eq? [
-        {
-            [ t >>waiting drop ]
-            [ flag>> raise-flag ]
-            [ mailbox>> mailbox-get ]
-            [ f >>waiting drop ]
-        } cleave
-    ] [ drop f ] if ;
-
-: interactor-read ( interactor -- lines )
-    [ interactor-yield ] [ interactor-finish ] bi ;
-
-M: interactor stream-readln
-    interactor-read dup [ first ] when ;
-
-: interactor-call ( quot interactor -- )
-    dup interactor-busy? [
-        2dup interactor-input.
-        2dup interactor-continue
-    ] unless 2drop ;
-
-M: interactor stream-read
-    swap dup zero? [
-        2drop ""
-    ] [
-        [ interactor-read dup [ "\n" join ] when ] dip short head
-    ] if ;
-
-M: interactor stream-read-partial
-    stream-read ;
-
-M: interactor stream-read1
-    dup interactor-read {
-        { [ dup not ] [ 2drop f ] }
-        { [ dup empty? ] [ drop stream-read1 ] }
-        { [ dup first empty? ] [ 2drop CHAR: \n ] }
-        [ nip first first ]
-    } cond ;
-
-M: interactor dispose drop ;
-
-: go-to-error ( interactor error -- )
-    [ line>> 1- ] [ column>> ] bi 2array
-    over set-caret
-    mark>caret ;
-
-: handle-parse-error ( interactor error -- )
-    dup lexer-error? [ 2dup go-to-error error>> ] when
-    swap find-workspace debugger-popup ;
-
-: try-parse ( lines interactor -- quot/error/f )
-    [
-        drop parse-lines-interactive
-    ] [
-        2nip
-        dup lexer-error? [
-            dup error>> unexpected-eof? [ drop f ] when
-        ] when
-    ] recover ;
-
-: handle-interactive ( lines interactor -- quot/f ? )
-    tuck try-parse {
-        { [ dup quotation? ] [ nip t ] }
-        { [ dup not ] [ drop "\n" swap user-input* drop f f ] }
-        [ handle-parse-error f f ]
-    } cond ;
-
-M: interactor stream-read-quot
-    [ interactor-yield ] keep {
-        { [ over not ] [ drop ] }
-        { [ over callable? ] [ drop ] }
-        [
-            [ handle-interactive ] keep swap
-            [ interactor-finish ] [ nip stream-read-quot ] if
-        ]
-    } cond ;
-
-interactor "interactor" f {
-    { T{ key-down f f "RET" } evaluate-input }
-    { T{ key-down f { C+ } "k" } clear-input }
-} define-command-map
diff --git a/basis/ui/tools/interactor/summary.txt b/basis/ui/tools/interactor/summary.txt
deleted file mode 100644 (file)
index 6929b20..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Interactors are used to input Factor code
diff --git a/basis/ui/tools/listener/completion/authors.txt b/basis/ui/tools/listener/completion/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/tools/listener/completion/completion-tests.factor b/basis/ui/tools/listener/completion/completion-tests.factor
new file mode 100644 (file)
index 0000000..9b2b5a1
--- /dev/null
@@ -0,0 +1,10 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.tools.listener.completion ;
+IN: ui.tools.listener.completion.tests
+
+[ t ] [ { "USING:" "A" "B" "C" } complete-USING:? ] unit-test
+
+[ f ] [ { "USING:" "A" "B" "C" ";" } complete-USING:? ] unit-test
+
+[ t ] [ { "X" ";" "USING:" "A" "B" "C" } complete-USING:? ] unit-test
\ No newline at end of file
diff --git a/basis/ui/tools/listener/completion/completion.factor b/basis/ui/tools/listener/completion/completion.factor
new file mode 100644 (file)
index 0000000..0f357cb
--- /dev/null
@@ -0,0 +1,184 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays assocs calendar colors colors.constants
+documents documents.elements fry kernel words sets splitting math
+math.vectors models.delay models.arrow combinators.short-circuit
+parser present sequences tools.completion tools.vocabs.browser generic
+generic.standard.engines.tuple fonts definitions.icons ui.images
+ui.commands ui.operations ui.gadgets ui.gadgets.editors
+ui.gadgets.glass ui.gadgets.scrollers ui.gadgets.tables
+ui.gadgets.tracks ui.gadgets.labeled
+ui.gadgets.worlds ui.gadgets.wrappers ui.gestures ui.pens.solid
+ui.tools.listener.history combinators vocabs ui.tools.listener.popups ;
+IN: ui.tools.listener.completion
+
+! We don't directly depend on the listener tool but we use a few slots
+SLOT: interactor
+SLOT: history
+
+: history-list ( interactor -- alist )
+    history>> elements>>
+    [ dup string>> { { CHAR: \n CHAR: \s } } substitute ] { } map>assoc
+    <reversed> ;
+
+TUPLE: word-completion vocabs ;
+C: <word-completion> word-completion
+
+SINGLETONS: vocab-completion char-completion history-completion ;
+UNION: definition-completion word-completion vocab-completion ;
+UNION: listener-completion definition-completion char-completion history-completion ;
+
+GENERIC: completion-quot ( interactor completion-mode -- quot )
+
+: (completion-quot) ( interactor completion-mode quot -- quot' )
+    2nip '[ [ { } ] _ if-empty ] ; inline
+
+M: word-completion completion-quot [ words-matching ] (completion-quot) ;
+M: vocab-completion completion-quot [ vocabs-matching ] (completion-quot) ;
+M: char-completion completion-quot [ chars-matching ] (completion-quot) ;
+M: history-completion completion-quot drop '[ drop _ history-list ] ;
+
+GENERIC: completion-element ( completion-mode -- element )
+
+M: object completion-element drop one-word-elt ;
+M: history-completion completion-element drop one-line-elt ;
+
+GENERIC: completion-banner ( completion-mode -- string )
+
+M: word-completion completion-banner drop "Words" ;
+M: vocab-completion completion-banner drop "Vocabularies" ;
+M: char-completion completion-banner drop "Unicode code point names" ;
+M: history-completion completion-banner drop "Input history" ;
+
+! Completion modes also implement the row renderer protocol
+M: listener-completion row-columns drop present 1array ;
+
+M: definition-completion prototype-row
+    drop \ + definition-icon <image-name> "" 2array ;
+
+M: definition-completion row-columns
+    drop
+    [ definition-icon <image-name> ]
+    [ present ] bi
+    2array ;
+
+M: word-completion row-color
+    [ vocabulary>> ] [ vocabs>> ] bi* {
+        { [ 2dup [ vocab-words ] dip memq? ] [ COLOR: black ] }
+        { [ over ".private" tail? ] [ COLOR: dark-red ] }
+        [ COLOR: dark-gray ]
+    } cond 2nip ;
+
+M: vocab-completion row-color
+    drop vocab? COLOR: black COLOR: dark-gray ? ;
+
+: complete-IN:/USE:? ( tokens -- ? )
+    2 short tail* { "IN:" "USE:" } intersects? ;
+
+: chop-; ( seq -- seq' )
+    { ";" } split1-last [ ] [ ] ?if ;
+
+: complete-USING:? ( tokens -- ? )
+    chop-; { "USING:" } intersects? ;
+
+: complete-CHAR:? ( tokens -- ? )
+    2 short tail* "CHAR:" swap member? ;
+
+: up-to-caret ( caret document -- string )
+    [ { 0 0 } ] 2dip doc-range ;
+
+: completion-mode ( interactor -- symbol )
+    [ vocabs>> ] [ editor-caret ] [ model>> ] tri up-to-caret " \r\n" split
+    {
+        { [ dup { [ complete-IN:/USE:? ] [ complete-USING:? ] } 1|| ] [ 2drop vocab-completion ] }
+        { [ dup complete-CHAR:? ] [ 2drop char-completion ] }
+        [ drop <word-completion> ]
+    } cond ;
+
+TUPLE: completion-popup < track interactor table completion-mode ;
+
+: find-completion-popup ( gadget -- popup )
+    [ completion-popup? ] find-parent ;
+
+: <completion-model> ( editor element quot -- model )
+    [ <element-model> 1/3 seconds <delay> ] dip
+    '[ @ keys 1000 short head ] <arrow> ;
+
+M: completion-popup focusable-child* table>> ;
+
+: completion-loc/doc/elt ( popup -- loc doc elt )
+    [ interactor>> [ editor-caret ] [ model>> ] bi ]
+    [ completion-mode>> completion-element ]
+    bi ;
+
+GENERIC: completion-string ( object -- string )
+
+M: object completion-string present ;
+
+: method-completion-string ( word -- string )
+    "method-generic" word-prop present ;
+
+M: method-body completion-string method-completion-string ;
+
+M: engine-word completion-string method-completion-string ;
+
+GENERIC# accept-completion-hook 1 ( item popup -- )
+
+: insert-completion ( item popup -- )
+    [ completion-string ] [ completion-loc/doc/elt ] bi* set-elt-string ;
+
+: accept-completion ( item table -- )
+    find-completion-popup
+    [ insert-completion ]
+    [ accept-completion-hook ]
+    [ nip hide-glass ]
+    2tri ;
+
+: <completion-table> ( interactor completion-mode -- table )
+    [ completion-element ] [ completion-quot ] [ nip ] 2tri
+    [ <completion-model> ] dip <table>
+        monospace-font >>font
+        t >>selection-required?
+        t >>single-click?
+        30 >>min-cols
+        10 >>max-rows
+        dup '[ _ accept-completion ] >>action ;
+
+: <completion-scroller> ( completion-popup -- scroller )
+    table>> <scroller> COLOR: white <solid> >>interior ;
+
+: <completion-popup> ( interactor completion-mode -- popup )
+    [ vertical completion-popup new-track ] 2dip
+    [ [ >>interactor ] [ >>completion-mode ] bi* ] [ <completion-table> >>table ] 2bi
+    dup [ <completion-scroller> ] [ completion-mode>> completion-banner ] bi
+    <labeled-gadget> 1 track-add ;
+
+completion-popup H{
+    { T{ key-down f f "TAB" } [ table>> row-action ] }
+    { T{ key-down f f " " } [ table>> row-action ] }
+} set-gestures
+
+: show-completion-popup ( interactor mode -- )
+    [ completion-element ] [ <completion-popup> ] 2bi
+    show-listener-popup ;
+
+: code-completion-popup ( interactor -- )
+    dup completion-mode show-completion-popup ;
+
+: history-completion-popup ( interactor -- )
+    history-completion show-completion-popup ;
+
+: recall-previous ( interactor -- )
+    history>> history-recall-previous ;
+
+: recall-next ( interactor -- )
+    history>> history-recall-next ;
+
+: completion-gesture ( gesture completion -- value/f operation/f )
+    table>> selected-row
+    [ [ nip ] [ gesture>operation ] 2bi ] [ drop f ] if ;
+
+M: completion-popup handle-gesture ( gesture completion -- ? )
+    2dup completion-gesture dup [
+        [ nip hide-glass ] [ invoke-command ] 2bi* f
+    ] [ 2drop call-next-method ] if ;
\ No newline at end of file
diff --git a/basis/ui/tools/listener/history/authors.txt b/basis/ui/tools/listener/history/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/tools/listener/history/history-tests.factor b/basis/ui/tools/listener/history/history-tests.factor
new file mode 100644 (file)
index 0000000..5a2e3cf
--- /dev/null
@@ -0,0 +1,54 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: documents namespaces tools.test io.styles
+ui.tools.listener.history kernel ;
+IN: ui.tools.listener.history.tests
+
+[ ] [ <document> "d" set ] unit-test
+[ ] [ "d" get <history> "h" set ] unit-test
+
+[ ] [ "1" "d" get set-doc-string ] unit-test
+[ T{ input f "1" } ] [ "h" get history-add ] unit-test
+
+[ ] [ "2" "d" get set-doc-string ] unit-test
+[ T{ input f "2" } ] [ "h" get history-add ] unit-test
+
+[ ] [ "3" "d" get set-doc-string ] unit-test
+[ T{ input f "3" } ] [ "h" get history-add ] unit-test
+
+[ ] [ "" "d" get set-doc-string ] unit-test
+
+[ ] [ "h" get history-recall-previous ] unit-test
+[ "3" ] [ "d" get doc-string ] unit-test
+
+[ ] [ "h" get history-recall-previous ] unit-test
+[ "2" ] [ "d" get doc-string ] unit-test
+
+[ ] [ "h" get history-recall-previous ] unit-test
+[ "1" ] [ "d" get doc-string ] unit-test
+
+[ ] [ "h" get history-recall-previous ] unit-test
+[ "1" ] [ "d" get doc-string ] unit-test
+
+[ ] [ "h" get history-recall-next ] unit-test
+[ "2" ] [ "d" get doc-string ] unit-test
+
+[ ] [ "22" "d" get set-doc-string ] unit-test
+
+[ ] [ "h" get history-recall-next ] unit-test
+[ "3" ] [ "d" get doc-string ] unit-test
+
+[ ] [ "h" get history-recall-previous ] unit-test
+[ "22" ] [ "d" get doc-string ] unit-test
+
+[ ] [ "h" get history-recall-previous ] unit-test
+[ "1" ] [ "d" get doc-string ] unit-test
+
+[ ] [ "222" "d" get set-doc-string ] unit-test
+[ T{ input f "222" } ] [ "h" get history-add ] unit-test
+
+[ ] [ "h" get history-recall-previous ] unit-test
+[ ] [ "h" get history-recall-previous ] unit-test
+[ ] [ "h" get history-recall-previous ] unit-test
+
+[ "22" ] [ "d" get doc-string ] unit-test
diff --git a/basis/ui/tools/listener/history/history.factor b/basis/ui/tools/listener/history/history.factor
new file mode 100644 (file)
index 0000000..333347d
--- /dev/null
@@ -0,0 +1,47 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors documents kernel math math.order
+sequences fry io.styles ;
+IN: ui.tools.listener.history
+
+TUPLE: history document elements index ;
+
+: <history> ( document -- history )
+    V{ } clone 0 history boa ;
+
+: history-add ( history -- input )
+    dup elements>> length 1+ >>index
+    [ document>> doc-string [ <input> ] [ empty? ] bi ] keep
+    '[ [ _ elements>> push ] keep ] unless ;
+
+<PRIVATE
+
+: save-history ( history -- )
+    [ document>> doc-string ] keep
+    '[ <input> _ [ index>> ] [ elements>> ] bi set-nth ]
+    unless-empty ;
+
+: update-document ( history -- )
+    [ [ index>> ] [ elements>> ] bi nth string>> ] [ document>> ] bi
+    [ set-doc-string ] [ clear-undo drop ] 2bi ;
+
+: change-history-index ( history i -- )
+    over elements>> length 1-
+    '[ _ + _ min 0 max ] change-index drop ;
+
+: history-recall ( history i -- )
+    [ [ elements>> empty? ] keep ] dip '[
+        _
+        [ save-history ]
+        [ _ change-history-index ]
+        [ update-document ]
+        tri
+    ] unless ;
+
+PRIVATE>
+
+: history-recall-previous ( history -- )
+    -1 history-recall ;
+
+: history-recall-next ( history -- )
+    1 history-recall ;
diff --git a/basis/ui/tools/listener/listener-docs.factor b/basis/ui/tools/listener/listener-docs.factor
new file mode 100644 (file)
index 0000000..d039959
--- /dev/null
@@ -0,0 +1,31 @@
+USING: help.markup help.syntax ui.commands ui.operations
+ui.gadgets.editors ui.gadgets.panes listener io words ;
+IN: ui.tools.listener
+
+HELP: interactor
+{ $class-description "An interactor is an " { $link editor } " intended to be used as the input component of a " { $link "ui-listener" } "."
+$nl
+"Interactors are created by calling " { $link <interactor> } "."
+$nl
+"Interactors implement the " { $link stream-readln } ", " { $link stream-read } " and " { $link read-quot } " generic words." } ;
+
+ARTICLE: "ui-listener" "UI listener"
+"The graphical listener is based around the terminal listener (" { $link "listener" } ") and adds an input history, and word and vocabulary completion."
+{ $command-map listener-gadget "toolbar" }
+{ $command-map interactor "completion" }
+{ $command-map interactor "interactor" }
+{ $command-map listener-gadget "scrolling" }
+{ $command-map listener-gadget "multi-touch" }
+{ $heading "Word commands" }
+"These words operate on the word at the cursor."
+{ $operations \ word }
+{ $heading "Vocabulary commands" }
+"These words operate on the vocabulary at the cursor."
+{ $operations \ word }
+{ $command-map interactor "quotation" }
+{ $heading "Editing commands" }
+"The text editing commands are standard; see " { $link "ui.gadgets.editors" } "."
+{ $heading "Implementation" }
+"Listeners are instances of " { $link listener-gadget } ". The listener consists of an output area (instance of " { $link pane } ") and an input area (instance of " { $link interactor } "). Clickable presentations can also be printed to the listener; see " { $link "ui-presentations" } "." ;
+
+ABOUT: "ui-listener"
\ No newline at end of file
index 28fdef6cb7ce4d92d18844c0d201e4c05b8a8b3c..337921a00cebb02aee1b42891cdd113ab4826a2c 100644 (file)
-USING: continuations documents ui.tools.interactor
+USING: continuations documents
 ui.tools.listener hashtables kernel namespaces parser sequences
 tools.test ui.commands ui.gadgets ui.gadgets.editors
 ui.gadgets.panes vocabs words tools.test.ui slots.private
 threads arrays generic threads accessors listener math
-calendar ;
+calendar concurrency.promises io ui.tools.common ;
 IN: ui.tools.listener.tests
 
-[ f ] [ "word" source-editor command-map commands>> empty? ] unit-test
+\ <interactor> must-infer
+
+[
+    [ ] [ <interactor> <pane> <pane-stream> >>output "interactor" set ] unit-test
+
+    [ ] [ "interactor" get register-self ] unit-test
+
+    [ ] [ "[ 1 2 3" "interactor" get set-editor-string ] unit-test
+
+    [ ] [ <promise> "promise" set ] unit-test
+
+    [
+        self "interactor" get (>>thread)
+        "interactor" get stream-read-quot "promise" get fulfill
+    ] "Interactor test" spawn drop
+
+    ! This should not throw an exception
+    [ ] [ "interactor" get evaluate-input ] unit-test
+
+    [ ] [ [ "interactor" get interactor-busy? ] [ yield ] [ ] while ] unit-test
+
+    [ ] [ "[ 1 2 3 ]" "interactor" get set-editor-string ] unit-test
+
+    [ ] [ "interactor" get evaluate-input ] unit-test
+
+    [ [ [ 1 2 3 ] ] ] [ "promise" get 5 seconds ?promise-timeout ] unit-test
+] with-interactive-vocabs
+
+[
+    [ ] [ <interactor> <pane> <pane-stream> >>output "interactor" set ] unit-test
+
+    [ ] [ "interactor" get register-self ] unit-test
+
+    [ ] [ <promise> "promise" set ] unit-test
+
+    [
+        self "interactor" get (>>thread)
+        "interactor" get stream-readln "promise" get fulfill
+    ] "Interactor test" spawn drop
+
+    [ ] [ "hi" "interactor" get set-editor-string ] unit-test
+
+    [ ] [ [ "interactor" get interactor-busy? ] [ yield ] [ ] while ] unit-test
+
+    [ ] [ "interactor" get evaluate-input ] unit-test
+
+    [ "hi" ] [ "promise" get 5 seconds ?promise-timeout ] unit-test
+] with-interactive-vocabs
+
+! Hang
+[ ] [ <interactor> <pane> <pane-stream> >>output "interactor" set ] unit-test
+
+[ ] [ [ "interactor" get stream-read-quot drop ] "A" spawn drop ] unit-test
+
+[ ] [ [ "interactor" get stream-read-quot drop ] "B" spawn drop ] unit-test
+
+[ ] [ 1 seconds sleep ] unit-test
+
+[ ] [ "interactor" get interactor-eof ] unit-test
+
+[ ] [ <interactor> <pane> <pane-stream> >>output "interactor" set ] unit-test
+
+: text "Hello world.\nThis is a test." ;
+
+[ ] [ text "interactor" get set-editor-string ] unit-test
+
+[ ] [ <promise> "promise" set ] unit-test
+
+[ ] [
+    [
+        "interactor" get register-self
+        "interactor" get contents "promise" get fulfill
+    ] in-thread
+] unit-test
+
+[ ] [ 100 milliseconds sleep ] unit-test
+
+[ ] [ "interactor" get evaluate-input ] unit-test
+
+[ ] [ 100 milliseconds sleep ] unit-test
+    
+[ ] [ "interactor" get interactor-eof ] unit-test
+
+[ t ] [ "promise" get 2 seconds ?promise-timeout text = ] unit-test
+
+[ ] [ <interactor> <pane> <pane-stream> >>output "interactor" set ] unit-test
+
+[ ] [ text "interactor" get set-editor-string ] unit-test
+
+[ ] [ <promise> "promise" set ] unit-test
+
+[ ] [
+    [
+        "interactor" get register-self
+        "interactor" get stream-read1 "promise" get fulfill
+    ] in-thread
+] unit-test
+
+[ ] [ 100 milliseconds sleep ] unit-test
+
+[ ] [ "interactor" get evaluate-input ] unit-test
+
+[ CHAR: H ] [ "promise" get 2 seconds ?promise-timeout ] unit-test
 
 [ ] [ <listener-gadget> [ ] with-grafted-gadget ] unit-test
 
 [ ] [ <listener-gadget> "listener" set ] unit-test
 
 "listener" get [
-    [ "dup" ] [
-        \ dup word-completion-string
-    ] unit-test
-
-    [ "equal?" ]
-    [ \ array \ equal? method word-completion-string ] unit-test
-
-    <pane> <interactor> "i" set
+    <interactor> <pane> <pane-stream> >>output "i" set
 
     [ t ] [ "i" get interactor? ] unit-test
 
@@ -32,7 +127,7 @@ IN: ui.tools.listener.tests
     
     [ t ] [
         "i" get model>> doc-end
-        "i" get editor-caret* =
+        "i" get editor-caret =
     ] unit-test
 
     ! Race condition discovered by SimonRC
@@ -53,4 +148,8 @@ IN: ui.tools.listener.tests
     [ ] [ "listener" get com-end ] unit-test
 ] with-grafted-gadget
 
-[ ] [ \ + <pane> <interactor> interactor-use use-if-necessary ] unit-test
+[ ] [ \ + <interactor> vocabs>> use-if-necessary ] unit-test
+
+[ ] [ <listener-gadget> "l" set ] unit-test
+[ ] [ "l" get com-scroll-up ] unit-test
+[ ] [ "l" get com-scroll-down ] unit-test
\ No newline at end of file
index 7ffbfd273881d115057d298af4b91160d283269e..ca41fa5408e02f22b9b22119856fd846f8f5cb6b 100644 (file)
-! Copyright (C) 2005, 2008 Slava Pestov.
+! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: inspector help help.markup io io.styles kernel models
-namespaces parser quotations sequences vocabs words prettyprint
-listener debugger threads boxes concurrency.flags math arrays
-generic accessors combinators assocs fry ui.commands ui.gadgets
-ui.gadgets.editors ui.gadgets.labelled ui.gadgets.panes
-ui.gadgets.buttons ui.gadgets.scrollers ui.gadgets.packs
-ui.gadgets.tracks ui.gadgets.borders ui.gadgets.frames
-ui.gadgets.grids ui.gestures ui.operations ui.tools.browser
-ui.tools.interactor ui.tools.inspector ui.tools.workspace ;
+USING: accessors arrays assocs calendar combinators locals
+colors.constants combinators.short-circuit compiler.units
+concurrency.flags concurrency.mailboxes continuations destructors
+documents documents.elements fry hashtables help help.markup io
+io.styles kernel lexer listener math models models.delay models.arrow
+namespaces parser prettyprint quotations sequences strings threads
+tools.vocabs vocabs vocabs.loader vocabs.parser words ui ui.commands
+ui.pens.solid ui.gadgets ui.gadgets.glass ui.gadgets.buttons ui.gadgets.editors
+ui.gadgets.labeled ui.gadgets.panes ui.gadgets.scrollers
+ui.gadgets.status-bar ui.gadgets.tracks ui.gadgets.borders ui.gestures
+ui.operations ui.tools.browser ui.tools.common ui.tools.debugger
+ui.tools.listener.completion ui.tools.listener.popups
+ui.tools.listener.history ;
 IN: ui.tools.listener
 
-TUPLE: listener-gadget < track input output ;
+! If waiting is t, we're waiting for user input, and invoking
+! evaluate-input resumes the thread.
+TUPLE: interactor < source-editor
+output history flag mailbox thread waiting token-model word-model popup ;
 
-: listener-streams ( listener -- input output )
-    [ input>> ] [ output>> <pane-stream> ] bi ;
+: register-self ( interactor -- )
+    <mailbox> >>mailbox
+    self >>thread
+    drop ;
 
-: <listener-input> ( listener -- gadget )
-    output>> <pane-stream> <interactor> ;
+: interactor-continuation ( interactor -- continuation )
+    thread>> continuation>> value>> ;
 
-: welcome. ( -- )
-    "If this is your first time with Factor, please read the " print
-    "handbook" ($link) ". To see a list of keyboard shortcuts," print
-    "press F1." print nl ;
+: interactor-busy? ( interactor -- ? )
+    #! We're busy if there's no thread to resume.
+    [ waiting>> ]
+    [ thread>> dup [ thread-registered? ] when ]
+    bi and not ;
 
-M: listener-gadget focusable-child*
-    input>> ;
+SLOT: vocabs
+
+M: interactor vocabs>>
+    dup interactor-busy? [ drop f ] [
+        use swap
+        interactor-continuation name>>
+        assoc-stack
+    ] if ;
+
+: vocab-exists? ( name -- ? )
+    { [ vocab ] [ find-vocab-root ] } 1|| ;
+
+GENERIC: (word-at-caret) ( token completion-mode -- obj )
+
+M: vocab-completion (word-at-caret)
+    drop dup vocab-exists? [ >vocab-link ] [ drop f ] if ;
+
+M: word-completion (word-at-caret)
+    vocabs>> assoc-stack ;
+
+M: char-completion (word-at-caret)
+    2drop f ;
+
+: word-at-caret ( token interactor -- obj )
+    completion-mode (word-at-caret) ;
+
+: <word-model> ( interactor -- model )
+    [ token-model>> 1/3 seconds <delay> ]
+    [ '[ _ word-at-caret ] ] bi
+    <arrow> ;
+
+: <interactor> ( -- gadget )
+    interactor new-editor
+        <flag> >>flag
+        dup one-word-elt <element-model> >>token-model
+        dup <word-model> >>word-model
+        dup model>> <history> >>history ;
+
+M: interactor graft*
+    [ call-next-method ] [ dup word-model>> add-connection ] bi ;
+
+M: interactor ungraft*
+    [ dup word-model>> remove-connection ] [ call-next-method ] bi ;
 
-M: listener-gadget call-tool* ( input listener -- )
-    [ string>> ] dip input>> set-editor-string ;
+M: interactor model-changed
+    2dup word-model>> eq? [
+        dup popup>>
+        [ 2drop ] [ [ value>> ] dip show-summary ] if
+    ] [ call-next-method ] if ;
 
-M: listener-gadget tool-scroller
-    output>> find-scroller ;
+GENERIC: (print-input) ( object -- )
+
+M: input (print-input)
+    dup presented associate
+    [ string>> H{ { font-style bold } } format ] with-nesting nl ;
+
+M: word (print-input)
+    "Command: "
+    [
+        "sans-serif" font-name set
+        bold font-style set
+    ] H{ } make-assoc format . ;
+
+: print-input ( object interactor -- )
+    output>> [ (print-input) ] with-output-stream* ;
+
+: interactor-continue ( obj interactor -- )
+    mailbox>> mailbox-put ;
+
+: interactor-finish ( interactor -- )
+    [ history>> history-add ] keep
+    [ print-input ]
+    [ clear-editor drop ]
+    [ model>> clear-undo drop ] 2tri ;
+
+: interactor-eof ( interactor -- )
+    dup interactor-busy? [
+        f over interactor-continue
+    ] unless drop ;
+
+: evaluate-input ( interactor -- )
+    dup interactor-busy? [ drop ] [
+        [ control-value ] keep interactor-continue
+    ] if ;
+
+: interactor-yield ( interactor -- obj )
+    dup thread>> self eq? [
+        {
+            [ t >>waiting drop ]
+            [ flag>> raise-flag ]
+            [ mailbox>> mailbox-get ]
+            [ f >>waiting drop ]
+        } cleave
+    ] [ drop f ] if ;
+
+: interactor-read ( interactor -- lines )
+    [ interactor-yield ] [ interactor-finish ] bi ;
+
+M: interactor stream-readln
+    interactor-read dup [ first ] when ;
+
+: (call-listener) ( quot command listener -- )
+    input>> dup interactor-busy? [ 3drop ] [
+        [ print-input drop ]
+        [ nip interactor-continue ]
+        3bi
+    ] if ;
+
+M: interactor stream-read
+    swap dup zero? [
+        2drop ""
+    ] [
+        [ interactor-read dup [ "\n" join ] when ] dip short head
+    ] if ;
+
+M: interactor stream-read-partial
+    stream-read ;
+
+M: interactor stream-read1
+    dup interactor-read {
+        { [ dup not ] [ 2drop f ] }
+        { [ dup empty? ] [ drop stream-read1 ] }
+        { [ dup first empty? ] [ 2drop CHAR: \n ] }
+        [ nip first first ]
+    } cond ;
+
+M: interactor dispose drop ;
+
+: go-to-error ( interactor error -- )
+    [ line>> 1- ] [ column>> ] bi 2array
+    over set-caret
+    mark>caret ;
+
+TUPLE: listener-gadget < tool input output scroller ;
+
+{ 600 700 } listener-gadget set-tool-dim
+
+: find-listener ( gadget -- listener )
+    [ listener-gadget? ] find-parent ;
+
+: listener-streams ( listener -- input output )
+    [ input>> ] [ output>> ] bi <pane-stream> ;
+
+: init-listener ( listener -- listener )
+    <interactor>
+    [ >>input ] [ pane new-pane t >>scrolls? >>output ] bi
+    dup listener-streams >>output drop ;
+
+: <listener-gadget> ( -- gadget )
+    vertical listener-gadget new-track
+        add-toolbar
+        init-listener
+        dup output>> <scroller> >>scroller
+        dup scroller>> 1 track-add ;
+
+M: listener-gadget focusable-child*
+    input>> dup popup>> or ;
 
 : wait-for-listener ( listener -- )
     #! Wait for the listener to start.
     input>> flag>> wait-for-flag ;
 
-: workspace-busy? ( workspace -- ? )
-    listener>> input>> interactor-busy? ;
+: listener-busy? ( listener -- ? )
+    input>> interactor-busy? ;
 
-: listener-input ( string -- )
-    get-workspace listener>> input>>
-    [ set-editor-string ] [ request-focus ] bi ;
+: listener-window* ( -- listener )
+    <listener-gadget>
+    dup "Listener" open-status-window ;
+
+: listener-window ( -- )
+    [ listener-window* drop ] with-ui ;
+
+\ listener-window H{ { +nullary+ t } } define-command
 
-: (call-listener) ( quot listener -- )
-    input>> interactor-call ;
+: (get-listener) ( quot -- listener )
+    find-window [
+        [ raise-window ]
+        [
+            gadget-child
+            [ ]
+            [ input>> scroll>caret ]
+            [ input>> request-focus ] tri
+        ] bi
+    ] [ listener-window* ] if* ; inline
 
-: call-listener ( quot -- )
-    [ workspace-busy? not ] get-workspace* listener>>
-    '[ _ _ dup wait-for-listener (call-listener) ]
+: get-listener ( -- listener )
+    [ listener-gadget? ] (get-listener) ;
+
+: show-listener ( -- )
+    get-listener drop ;
+
+\ show-listener H{ { +nullary+ t } } define-command
+
+: get-ready-listener ( -- listener )
+    [
+        {
+            [ listener-gadget? ]
+            [ listener-busy? not ]
+        } 1&&
+    ] (get-listener) ;
+
+GENERIC: listener-input ( obj -- )
+
+M: input listener-input string>> listener-input ;
+
+M: string listener-input
+    get-listener input>>
+    [ set-editor-string ] [ request-focus ] bi ;
+
+: call-listener ( quot command -- )
+    get-ready-listener
+    '[ _ _ _ dup wait-for-listener (call-listener) ]
     "Listener call" spawn drop ;
 
 M: listener-command invoke-command ( target command -- )
-    command-quot call-listener ;
+    [ command-quot ] [ nip ] 2bi call-listener ;
 
 M: listener-operation invoke-command ( target command -- )
-    [ hook>> call ] keep operation-quot call-listener ;
+    [ operation-quot ] [ nip command>> ] 2bi call-listener ;
 
 : eval-listener ( string -- )
-    get-workspace
-    listener>> input>> [ set-editor-string ] keep
+    get-listener input>> [ set-editor-string ] keep
     evaluate-input ;
 
 : listener-run-files ( seq -- )
     [
+        [ \ listener-run-files ] dip
         '[ _ [ run-file ] each ] call-listener
     ] unless-empty ;
 
@@ -77,55 +273,93 @@ M: listener-operation invoke-command ( target command -- )
 \ clear-output H{ { +listener+ t } } define-command
 
 : clear-stack ( listener -- )
-    [ clear ] swap (call-listener) ;
-
-GENERIC: word-completion-string ( word -- string )
-
-M: word word-completion-string
-    name>> ;
-
-M: method-body word-completion-string
-    "method-generic" word-prop word-completion-string ;
-
-USE: generic.standard.engines.tuple
-
-M: engine-word word-completion-string
-    "engine-generic" word-prop word-completion-string ;
+    [ [ clear ] \ clear ] dip (call-listener) ;
 
 : use-if-necessary ( word seq -- )
-    over vocabulary>> over and [
+    2dup [ vocabulary>> ] dip and [
         2dup [ assoc-stack ] keep = [ 2drop ] [
             [ vocabulary>> vocab-words ] dip push
         ] if
     ] [ 2drop ] if ;
 
-: insert-word ( word -- )
-    get-workspace listener>> input>>
-    [ [ word-completion-string ] dip user-input* drop ]
-    [ interactor-use use-if-necessary ]
-    2bi ;
+M: word accept-completion-hook
+    interactor>> vocabs>> use-if-necessary ;
 
-: quot-action ( interactor -- lines )
-    [ control-value ] keep
-    [ [ "\n" join ] dip add-interactor-history ]
-    [ select-all ]
-    2bi ;
+M: object accept-completion-hook 2drop ;
 
-: ui-help-hook ( topic -- )
-    browser-gadget call-tool ;
+: quot-action ( interactor -- lines )
+    [ history>> history-add drop ] [ control-value ] [ select-all ] tri
+    [ parse-lines ] with-compilation-unit ;
+
+: <debugger-popup> ( error continuation -- popup )
+    over compute-restarts [ hide-glass ] <debugger> "Error" <labeled-gadget> ;
+
+: debugger-popup ( interactor error continuation -- )
+    [ one-line-elt ] 2dip <debugger-popup> show-listener-popup ;
+
+: handle-parse-error ( interactor error -- )
+    dup lexer-error? [ 2dup go-to-error error>> ] when
+    error-continuation get
+    debugger-popup ;
+
+: try-parse ( lines interactor -- quot/error/f )
+    [ drop parse-lines-interactive ] [
+        2nip
+        dup lexer-error? [
+            dup error>> unexpected-eof? [ drop f ] when
+        ] when
+    ] recover ;
+
+: handle-interactive ( lines interactor -- quot/f ? )
+    [ nip ] [ try-parse ] 2bi {
+        { [ dup quotation? ] [ nip t ] }
+        { [ dup not ] [ drop "\n" swap user-input* drop f f ] }
+        [ handle-parse-error f f ]
+    } cond ;
+
+M: interactor stream-read-quot
+    [ interactor-yield ] keep {
+        { [ over not ] [ drop ] }
+        { [ over callable? ] [ drop ] }
+        [
+            [ handle-interactive ] keep swap
+            [ interactor-finish ] [ nip stream-read-quot ] if
+        ]
+    } cond ;
+
+: interactor-operation ( gesture interactor -- ? )
+    [ token-model>> value>> ] keep word-at-caret
+    [ nip ] [ gesture>operation ] 2bi dup [ invoke-command f ] [ 2drop t ] if ;
+
+M: interactor handle-gesture
+    {
+        { [ over key-gesture? not ] [ call-next-method ] }
+        { [ dup popup>> ] [ { [ pass-to-popup ] [ call-next-method ] } 2&& ] }
+        { [ dup token-model>> value>> ] [ { [ interactor-operation ] [ call-next-method ] } 2&& ] }
+        [ call-next-method ]
+    } cond ;
+
+interactor "interactor" f {
+    { T{ key-down f f "RET" } evaluate-input }
+    { T{ key-down f { C+ } "k" } clear-editor }
+} define-command-map
 
-: ui-error-hook ( error listener -- )
-    find-workspace debugger-popup ;
+interactor "completion" f {
+    { T{ key-down f f "TAB" } code-completion-popup }
+    { T{ key-down f { C+ } "p" } recall-previous }
+    { T{ key-down f { C+ } "n" } recall-next }
+    { T{ key-down f { C+ } "r" } history-completion-popup }
+} define-command-map
 
-: ui-inspector-hook ( obj listener -- )
-    find-workspace inspector-gadget
-    swap show-tool inspect-object ;
+: welcome. ( -- )
+    "If this is your first time with Factor, please read the " print
+    "handbook" ($link) ". To see a list of keyboard shortcuts," print
+    "press F1." print nl ;
 
 : listener-thread ( listener -- )
     dup listener-streams [
-        [ ui-help-hook ] help-hook set
-        [ '[ _ ui-error-hook ] error-hook set ]
-        [ '[ _ ui-inspector-hook ] inspector-hook set ] bi
+        [ com-browse ] help-hook set
+        '[ [ _ input>> ] 2dip debugger-popup ] error-hook set
         welcome.
         listener
     ] with-streams* ;
@@ -143,28 +377,12 @@ M: engine-word word-completion-string
     {
         [ com-end ]
         [ clear-output ]
-        [ input>> clear-input ]
+        [ input>> clear-editor ]
         [ start-listener-thread ]
         [ wait-for-listener ]
     } cleave ;
 
-: init-listener ( listener -- listener )
-    <scrolling-pane> >>output
-    dup <listener-input> >>input ;
-
-: <listener-scroller> ( listener -- scroller )
-    <frame>
-        over output>> @top grid-add
-        swap input>> @center grid-add
-    <scroller> ;
-
-: <listener-gadget> ( -- gadget )
-    { 0 1 } listener-gadget new-track
-        add-toolbar
-        init-listener
-        dup <listener-scroller> 1 track-add ;
-
-: listener-help ( -- ) "ui-listener" help-window ;
+: listener-help ( -- ) "ui-listener" com-browse ;
 
 \ listener-help H{ { +nullary+ t } } define-command
 
@@ -185,12 +403,21 @@ listener-gadget "toolbar" f {
     { T{ key-down f { C+ } "d" } com-end }
 } define-command-map
 
-M: listener-gadget handle-gesture ( gesture gadget -- ? )
-    2dup find-workspace workspace-page handle-gesture
-    [ call-next-method ] [ 2drop f ] if ;
+listener-gadget "scrolling"
+"The listener's scroller can be scrolled from the keyboard."
+{
+    { T{ key-down f { A+ } "UP" } com-scroll-up }
+    { T{ key-down f { A+ } "DOWN" } com-scroll-down }
+    { T{ key-down f { A+ } "PAGE_UP" } com-page-up }
+    { T{ key-down f { A+ } "PAGE_DOWN" } com-page-down }
+} define-command-map
+
+listener-gadget "multi-touch" f {
+    { up-action refresh-all }
+} define-command-map
 
 M: listener-gadget graft*
     [ call-next-method ] [ restart-listener ] bi ;
 
 M: listener-gadget ungraft*
-    [ com-end ] [ call-next-method ] bi ;
+    [ com-end ] [ call-next-method ] bi ;
\ No newline at end of file
diff --git a/basis/ui/tools/listener/popups/authors.txt b/basis/ui/tools/listener/popups/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/ui/tools/listener/popups/popups-tests.factor b/basis/ui/tools/listener/popups/popups-tests.factor
new file mode 100644 (file)
index 0000000..e0867bc
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test ui.tools.listener.popups ;
+IN: ui.tools.listener.popups.tests
diff --git a/basis/ui/tools/listener/popups/popups.factor b/basis/ui/tools/listener/popups/popups.factor
new file mode 100644 (file)
index 0000000..9329c0e
--- /dev/null
@@ -0,0 +1,18 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors documents.elements kernel math.rectangles
+math.vectors ui.gadgets.editors ui.gadgets.glass ;
+IN: ui.tools.listener.popups
+
+: caret-loc ( interactor element -- loc )
+    [
+        [ [ editor-caret ] [ model>> ] bi ] dip
+        prev-elt
+    ] [ drop ] 2bi
+    loc>point ;
+
+: relevant-rect ( interactor element -- rect )
+    [ caret-loc ] [ drop caret-dim { 0 1 } v+ ] 2bi <rect> ;
+
+: show-listener-popup ( interactor element popup -- )
+    [ [ drop ] [ relevant-rect ] 2bi ] dip swap show-popup ;
\ No newline at end of file
index d8802d66c934ee2fb6f35afff69fd723225a70ba..6d6cda1dba76af5aaf71a69d2a53b6c7445f6b9c 100644 (file)
@@ -1,21 +1,20 @@
-! Copyright (C) 2006, 2007 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: continuations definitions ui.tools.browser
-ui.tools.interactor ui.tools.listener ui.tools.profiler
-ui.tools.search ui.tools.traceback ui.tools.workspace generic
-help.topics stack-checker summary inspector io.pathnames
-io.styles kernel namespaces parser prettyprint quotations
-tools.annotations editors tools.profiler tools.test tools.time
-tools.walker ui.commands ui.gadgets.editors ui.gestures
-ui.operations ui.tools.deploy vocabs vocabs.loader words
-sequences tools.vocabs classes compiler.units accessors
-vocabs.parser ;
+USING: continuations definitions generic help.topics threads
+stack-checker summary io.pathnames io.styles kernel namespaces
+parser prettyprint quotations tools.crossref tools.annotations
+editors tools.profiler tools.test tools.time tools.walker vocabs
+vocabs.loader words sequences tools.vocabs classes
+compiler.units accessors vocabs.parser macros.expander ui
+ui.tools.browser ui.tools.listener ui.tools.listener.completion
+ui.tools.profiler ui.tools.inspector ui.tools.traceback
+ui.commands ui.gadgets.editors ui.gestures ui.operations
+ui.tools.deploy models ;
 IN: ui.tools.operations
 
 ! Objects
-[ drop t ] \ inspect H{
+[ drop t ] \ inspector H{
     { +primary+ t }
-    { +listener+ t }
 } define-operation
 
 : com-prettyprint ( obj -- ) . ;
@@ -34,8 +33,12 @@ IN: ui.tools.operations
 
 [ drop t ] \ com-unparse H{ } define-operation
 
-! Input
+! Models
+[ model? ] \ inspect-model H{
+    { +primary+ t }
+} define-operation
 
+! Input
 : com-input ( obj -- ) string>> listener-input ;
 
 [ input? ] \ com-input H{
@@ -56,11 +59,23 @@ IN: ui.tools.operations
     { +secondary+ t }
 } define-operation
 
+! Thread
+: com-thread-traceback-window ( thread -- )
+    continuation>> dup occupied>>
+    [ value>> traceback-window ]
+    [ drop beep ]
+    if ;
+
+[ thread? ] \ com-thread-traceback-window H{
+    { +primary+ t }
+    { +secondary+ t }
+} define-operation
+
 ! Pathnames
 : edit-file ( pathname -- ) edit ;
 
 [ pathname? ] \ edit-file H{
-    { +keyboard+ T{ key-down f { C+ } "E" } }
+    { +keyboard+ T{ key-down f { C+ } "e" } }
     { +primary+ t }
     { +secondary+ t }
     { +listener+ t }
@@ -69,7 +84,7 @@ IN: ui.tools.operations
 UNION: definition word method-spec link vocab vocab-link ;
 
 [ definition? ] \ edit H{
-    { +keyboard+ T{ key-down f { C+ } "E" } }
+    { +keyboard+ T{ key-down f { C+ } "e" } }
     { +listener+ t }
 } define-operation
 
@@ -78,25 +93,18 @@ UNION: definition word method-spec link vocab vocab-link ;
 
 [ definition? ] \ com-forget H{ } define-operation
 
-! Words
-[ word? ] \ insert-word H{
-    { +secondary+ t }
-} define-operation
-
-[ topic? ] \ com-follow H{
-    { +keyboard+ T{ key-down f { C+ } "H" } }
+[ topic? ] \ com-browse H{
+    { +keyboard+ T{ key-down f { C+ } "h" } }
     { +primary+ t }
 } define-operation
 
-: com-usage ( word -- )
-    get-workspace swap show-word-usage ;
-
-[ word? ] \ com-usage H{
-    { +keyboard+ T{ key-down f { C+ } "U" } }
+[ word? ] \ usage. H{
+    { +keyboard+ T{ key-down f { C+ } "u" } }
+    { +listener+ t }
 } define-operation
 
 [ word? ] \ fix H{
-    { +keyboard+ T{ key-down f { C+ } "F" } }
+    { +keyboard+ T{ key-down f { C+ } "f" } }
     { +listener+ t }
 } define-operation
 
@@ -108,25 +116,11 @@ GENERIC: com-stack-effect ( obj -- )
 
 M: quotation com-stack-effect infer. ;
 
-M: word com-stack-effect def>> com-stack-effect ;
-
-[ word? ] \ com-stack-effect H{
-    { +listener+ t }
-} define-operation
-
-! Vocabularies
-: com-vocab-words ( vocab -- )
-    get-workspace swap show-vocab-words ;
-
-[ vocab? ] \ com-vocab-words H{
-    { +secondary+ t }
-    { +keyboard+ T{ key-down f { C+ } "B" } }
-} define-operation
+M: word com-stack-effect 1quotation com-stack-effect ;
 
 : com-enter-in ( vocab -- ) vocab-name set-in ;
 
 [ vocab? ] \ com-enter-in H{
-    { +keyboard+ T{ key-down f { C+ } "I" } }
     { +listener+ t }
 } define-operation
 
@@ -138,12 +132,10 @@ M: word com-stack-effect def>> com-stack-effect ;
 } define-operation
 
 [ vocab-spec? ] \ run H{
-    { +keyboard+ T{ key-down f { C+ } "R" } }
     { +listener+ t }
 } define-operation
 
 [ vocab? ] \ test H{
-    { +keyboard+ T{ key-down f { C+ } "T" } }
     { +listener+ t }
 } define-operation
 
@@ -165,33 +157,24 @@ M: word com-stack-effect def>> com-stack-effect ;
     { +listener+ t }
 } define-operation
 
-: com-show-profile ( workspace -- )
-    profiler-gadget call-tool ;
-
-: com-profile ( quot -- ) profile f com-show-profile ;
+: com-profile ( quot -- ) profile profiler-window ;
 
 [ quotation? ] \ com-profile H{
-    { +keyboard+ T{ key-down f { C+ } "r" } }
+    { +keyboard+ T{ key-down f { C+ } "o" } }
     { +listener+ t }
 } define-operation
 
-! Profiler presentations
-[ dup usage-profile? swap vocab-profile? or ]
-\ com-show-profile H{ { +primary+ t } } define-operation
+: com-expand-macros ( quot -- ) expand-macros . ;
 
-! Operations -> commands
-source-editor
-"word"
-"These commands operate on the Factor word named by the token at the caret position."
-\ selected-word
-[ selected-word ]
-[ dup search [ ] [ no-word ] ?if ] 
-define-operation-map
+[ quotation? ] \ com-expand-macros H{
+    { +keyboard+ T{ key-down f { C+ } "m" } }
+    { +listener+ t }
+} define-operation
 
+! Operations -> commands
 interactor
 "quotation"
 "These commands operate on the entire contents of the input area."
 [ ]
 [ quot-action ]
-[ [ parse-lines ] with-compilation-unit ]
 define-operation-map
index 7280efe8850a2b3389b5ec391cbca2f55b5687ef..0ab1519cd78eec1e523fcff60e6cd5b192d10ece 100644 (file)
-! Copyright (C) 2007 Slava Pestov.
+! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: ui.tools.workspace kernel quotations tools.profiler
-ui.commands ui.gadgets ui.gadgets.panes ui.gadgets.scrollers
-ui.gadgets.tracks ui.gestures ui.gadgets.buttons accessors fry ;
+USING: kernel quotations accessors fry assocs present math.order
+math.vectors arrays locals models.search models.sort models sequences
+vocabs tools.profiler words prettyprint combinators.smart
+definitions.icons ui ui.commands ui.gadgets ui.gadgets.panes
+ui.gadgets.scrollers ui.gadgets.tracks ui.gestures ui.gadgets.buttons
+ui.gadgets.tables ui.gadgets.search-tables ui.gadgets.labeled
+ui.gadgets.buttons ui.gadgets.packs ui.gadgets.labels
+ui.gadgets.tabbed ui.gadgets.status-bar ui.gadgets.borders
+ui.tools.browser ui.tools.common ui.baseline-alignment
+ui.operations ui.images ;
+FROM: models.arrow => <arrow> ;
+FROM: models.product => <product> ;
 IN: ui.tools.profiler
 
-TUPLE: profiler-gadget < track pane ;
+TUPLE: profiler-gadget < tool
+sort
+vocabs vocab
+words
+methods
+generic class ;
 
-: <profiler-gadget> ( -- gadget )
-    { 0 1 } profiler-gadget new-track
-        add-toolbar
-        <pane> >>pane
-        dup pane>> <scroller> 1 track-add ;
+SINGLETONS: word-renderer vocab-renderer ;
+UNION: profiler-renderer word-renderer vocab-renderer ;
 
-: with-profiler-pane ( gadget quot -- )
-    [ pane>> ] dip with-pane ;
+<PRIVATE
 
-: com-full-profile ( gadget -- )
-    [ profile. ] with-profiler-pane ;
+: with-datastack* ( seq quot -- seq' )
+    '[ _ input<sequence ] output>array ; inline
 
-: com-vocabs-profile ( gadget -- )
-    [ vocabs-profile. ] with-profiler-pane ;
+PRIVATE>
 
-: com-method-profile ( gadget -- )
-    [ method-profile. ] with-profiler-pane ;
+! Value is a { word count } pair
+M: profiler-renderer row-columns
+    drop
+    [
+        [
+            [ [ definition-icon <image-name> ] [ present ] bi ]
+            [ present ]
+            bi*
+        ] with-datastack*
+    ] [ { "" "All" "" } ] if* ;
 
-: profiler-help ( -- ) "ui-profiler" help-window ;
+M: profiler-renderer prototype-row
+    drop \ = definition-icon <image-name> "" "" 3array ;
+
+M: profiler-renderer row-value
+    drop dup [ first ] when ;
+
+M: profiler-renderer column-alignment drop { 0 0 1 } ;
+M: profiler-renderer filled-column drop 1 ;
+
+M: word-renderer column-titles drop { "" "Word" "Count" } ;
+M: vocab-renderer column-titles drop { "" "Vocabulary" "Count" } ;
+
+SINGLETON: method-renderer
+
+M: method-renderer column-alignment drop { 0 0 1 } ;
+M: method-renderer filled-column drop 1 ;
+
+! Value is a { method-body count } pair
+M: method-renderer row-columns
+    drop [
+        [ [ definition-icon <image-name> ] [ synopsis ] bi ]
+        [ present ]
+        bi*
+    ] with-datastack* ;
+
+M: method-renderer row-value drop first ;
+
+M: method-renderer column-titles drop { "" "Method" "Count" } ;
+
+: <profiler-model> ( values profiler -- model )
+    [ [ filter-counts ] <arrow> ] [ sort>> ] bi* <sort> ;
+
+: <words-model> ( profiler -- model )
+    [
+        [ words>> ] [ vocab>> ] bi
+        [
+            [
+                [ first vocabulary>> ]
+                [ vocab-name ]
+                bi* =
+            ] when*
+        ] <search>
+    ] keep <profiler-model> ;
+
+: <profiler-table> ( model renderer -- table )
+    [ dup [ first present ] when ] <search-table>
+        [ invoke-primary-operation ] >>action ;
+
+: <profiler-filter-model> ( counts profiler -- model' )
+    [ <model> ] dip <profiler-model> [ f prefix ] <arrow> ;
+
+: <vocabs-model> ( profiler -- model )
+    [ vocab-counters [ [ vocab ] dip ] assoc-map ] dip
+    <profiler-filter-model> ;
+
+: <generic-model> ( profiler -- model )
+    [ generic-counters ] dip <profiler-filter-model> ;
+
+: <class-model> ( profiler -- model )
+    [ class-counters ] dip <profiler-filter-model> ;
+
+: method-matches? ( method generic class -- ? )
+    [ first ] 2dip
+    [ drop dup [ subwords memq? ] [ 2drop t ] if ]
+    [ nip dup [ swap "method-class" word-prop = ] [ 2drop t ] if ]
+    3bi and ;
+
+: <methods-model> ( profiler -- model )
+    [
+        [ method-counters <model> ] dip
+        [ generic>> ] [ class>> ] bi 3array <product>
+        [ first3 '[ _ _ method-matches? ] filter ] <arrow>
+    ] keep <profiler-model> ;
+
+: sort-by-name ( obj1 obj2 -- <=> )
+    [ first name>> ] compare ;
+
+: sort-by-call-count ( obj1 obj2 -- <=> )
+    [ second ] compare invert-comparison ;
+
+: sort-options ( -- alist )
+    {
+        { [ sort-by-name ] "by name" }
+        { [ sort-by-call-count ] "by call count" }
+    } ;
+
+: <sort-options> ( model -- gadget )
+    <shelf>
+        +baseline+ >>align
+        { 5 5 } >>gap
+        "Sort by:" <label> add-gadget
+        swap sort-options <radio-buttons> horizontal >>orientation add-gadget ;
+
+: <profiler-tool-bar> ( profiler -- gadget )
+    <shelf>
+        1/2 >>align
+        { 5 5 } >>gap
+        swap
+        [ <toolbar> add-gadget ]
+        [ sort>> <sort-options> add-gadget ] bi ;
+
+:: <words-tab> ( profiler -- gadget )
+    horizontal <track>
+        { 3 3 } >>gap
+        profiler vocabs>> vocab-renderer <profiler-table>
+            profiler vocab>> >>selected-value
+            10 >>min-rows
+            10 >>max-rows
+        "Vocabularies" <labeled-gadget>
+    1/2 track-add
+        profiler <words-model> word-renderer <profiler-table>
+            10 >>min-rows
+            10 >>max-rows
+        "Words" <labeled-gadget>
+    1/2 track-add ;
+
+:: <methods-tab> ( profiler -- gadget )
+    vertical <track>
+        { 3 3 } >>gap
+        horizontal <track>
+            { 3 3 } >>gap
+            profiler <generic-model> word-renderer <profiler-table>
+                profiler generic>> >>selected-value
+            "Generic words" <labeled-gadget>
+        1/2 track-add
+            profiler <class-model> word-renderer <profiler-table>
+                profiler class>> >>selected-value
+            "Classes" <labeled-gadget>
+        1/2 track-add
+    1/2 track-add
+        profiler methods>> method-renderer <profiler-table>
+            5 >>min-rows
+            5 >>max-rows
+            40 >>min-cols
+        "Methods" <labeled-gadget>
+    1/2 track-add ;
+
+: <selection-model> ( -- model ) { f 0 } <model> ;
+
+: <profiler-gadget> ( -- profiler )
+    vertical profiler-gadget new-track
+        { 5 5 } >>gap
+        [ sort-by-name ] <model> >>sort
+        all-words counters <model> >>words
+        <selection-model> >>vocab
+        dup <vocabs-model> >>vocabs
+        <selection-model> >>generic
+        <selection-model> >>class
+        dup <methods-model> >>methods
+        dup <profiler-tool-bar> { 3 3 } <filled-border> f track-add
+        <tabbed-gadget>
+            over <words-tab> "Words" add-tab
+            over <methods-tab> "Methods" add-tab
+        1 track-add ;
+
+: profiler-help ( -- ) "ui-profiler" com-browse ;
 
 \ profiler-help H{ { +nullary+ t } } define-command
 
 profiler-gadget "toolbar" f {
-    { f com-full-profile }
-    { f com-vocabs-profile }
-    { f com-method-profile }
     { T{ key-down f f "F1" } profiler-help }
 } define-command-map
 
-GENERIC: profiler-presentation ( obj -- quot )
-
-M: usage-profile profiler-presentation
-    word>> '[ _ usage-profile. ] ;
-
-M: vocab-profile profiler-presentation
-    vocab>> '[ _ vocab-profile. ] ;
-
-M: f profiler-presentation
-    drop [ vocabs-profile. ] ;
+: profiler-window ( -- )
+    <profiler-gadget> "Profiling results" open-status-window ;
 
-M: profiler-gadget call-tool* ( obj gadget -- )
-    swap profiler-presentation with-profiler-pane ;
+MAIN: profiler-window
\ No newline at end of file
diff --git a/basis/ui/tools/search/authors.txt b/basis/ui/tools/search/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/ui/tools/search/search-tests.factor b/basis/ui/tools/search/search-tests.factor
deleted file mode 100644 (file)
index 4f239ba..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-USING: assocs ui.tools.search help.topics io.pathnames io.styles
-kernel namespaces sequences source-files threads
-tools.test ui.gadgets ui.gestures vocabs accessors
-vocabs.loader words tools.test.ui debugger calendar ;
-IN: ui.tools.search.tests
-
-[ f ] [
-    "no such word with this name exists, certainly"
-    f f <definition-search>
-    T{ key-down f { C+ } "x" } swap search-gesture
-] unit-test
-
-: assert-non-empty ( obj -- ) empty? f assert= ;
-
-: update-live-search ( search -- seq )
-    dup [
-        300 milliseconds sleep
-        list>> control-value
-    ] with-grafted-gadget ;
-
-: test-live-search ( gadget quot -- ? )
-    [ update-live-search dup assert-non-empty ] dip all? ;
-
-[ t ] [
-    "swp" all-words f <definition-search>
-    [ word? ] test-live-search
-] unit-test
-
-[ t ] [
-    "" all-words t <definition-search>
-    dup [
-        { "set-word-prop" } over field>> set-control-value
-        300 milliseconds sleep
-        search-value \ set-word-prop eq?
-    ] with-grafted-gadget
-] unit-test
-
-[ t ] [
-    "quot" <help-search>
-    [ link? ] test-live-search
-] unit-test
-
-[ t ] [
-    "factor" source-files get keys <source-file-search>
-    [ pathname? ] test-live-search
-] unit-test
-
-[ t ] [
-    "kern" <vocab-search>
-    [ vocab-spec? ] test-live-search
-] unit-test
-
-[ t ] [
-    "a" { "a" "b" "aa" } <history-search>
-    [ input? ] test-live-search
-] unit-test
diff --git a/basis/ui/tools/search/search.factor b/basis/ui/tools/search/search.factor
deleted file mode 100644 (file)
index 9d248e2..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs help help.topics io.pathnames io.styles
-kernel models models.delay models.filter namespaces prettyprint
-quotations sequences sorting source-files definitions strings
-tools.completion tools.crossref classes.tuple vocabs words
-vocabs.loader tools.vocabs unicode.case calendar locals
-ui.tools.interactor ui.tools.listener ui.tools.workspace
-ui.commands ui.gadgets ui.gadgets.editors ui.gadgets.lists
-ui.gadgets.scrollers ui.gadgets.tracks ui.gadgets.borders
-ui.gestures ui.operations ui ;
-IN: ui.tools.search
-
-TUPLE: live-search < track field list ;
-
-: search-value ( live-search -- value )
-    list>> list-value ;
-
-: search-gesture ( gesture live-search -- operation/f )
-    search-value object-operations
-    [ operation-gesture = ] with find nip ;
-
-M: live-search handle-gesture ( gesture live-search -- ? )
-    tuck search-gesture dup [
-        over find-workspace hide-popup
-        [ search-value ] dip invoke-command f
-    ] [
-        2drop t
-    ] if ;
-
-: find-live-search ( gadget -- search )
-    [ live-search? ] find-parent ;
-
-: find-search-list ( gadget -- list )
-    find-live-search list>> ;
-
-TUPLE: search-field < editor ;
-
-: <search-field> ( -- gadget )
-    search-field new-editor ;
-
-search-field H{
-    { T{ key-down f f "UP" } [ find-search-list select-previous ] }
-    { T{ key-down f f "DOWN" } [ find-search-list select-next ] }
-    { T{ key-down f f "PAGE_UP" } [ find-search-list list-page-up ] }
-    { T{ key-down f f "PAGE_DOWN" } [ find-search-list list-page-down ] }
-    { T{ key-down f f "RET" } [ find-search-list invoke-value-action ] }
-} set-gestures
-
-: <search-model> ( live-search producer -- filter )
-    [
-        field>> model>>
-        ui-running? [ 1/5 seconds <delay> ] when
-    ] dip [ "\n" join ] prepend <filter> ;
-
-: init-search-model ( live-search seq limited? -- live-search )
-    [ 2drop ]
-    [ [ limited-completions ] [ completions ] ? curry <search-model> ] 3bi
-    >>model ; inline
-
-: <search-list> ( presenter live-search -- list )
-    [ [ find-workspace hide-popup ] ] [ ] [ model>> ] tri* <list> ;
-
-:: <live-search> ( string seq limited? presenter -- gadget )
-    { 0 1 } live-search new-track
-        <search-field> >>field
-        seq limited? init-search-model
-        presenter over <search-list> >>list
-        dup field>> 1 <border> { 1 1 } >>fill f track-add
-        dup list>> <scroller> 1 track-add
-        string over field>> set-editor-string
-        dup field>> end-of-document ;
-
-M: live-search focusable-child* field>> ;
-
-M: live-search pref-dim* drop { 400 200 } ;
-
-: current-word ( workspace -- string )
-    listener>> input>> selected-word ;
-
-: definition-candidates ( words -- candidates )
-    [ dup synopsis >lower ] { } map>assoc sort-values ;
-
-: <definition-search> ( string words limited? -- gadget )
-    [ definition-candidates ] dip [ synopsis ] <live-search> ;
-
-: word-candidates ( words -- candidates )
-    [ dup name>> >lower ] { } map>assoc ;
-
-: <word-search> ( string words limited? -- gadget )
-    [ word-candidates ] dip [ synopsis ] <live-search> ;
-
-: com-words ( workspace -- )
-    dup current-word all-words t <word-search>
-    "Word search" show-titled-popup ;
-
-: show-vocab-words ( workspace vocab -- )
-    [ "" swap words natural-sort f <word-search> ]
-    [ "Words in " swap vocab-name append ]
-    bi show-titled-popup ;
-
-: show-word-usage ( workspace word -- )
-    [ "" swap smart-usage f <definition-search> ]
-    [ "Words and methods using " swap name>> append ]
-    bi show-titled-popup ;
-
-: help-candidates ( seq -- candidates )
-    [ dup >link swap article-title >lower ] { } map>assoc
-    sort-values ;
-
-: <help-search> ( string -- gadget )
-    all-articles help-candidates
-    f [ article-title ] <live-search> ;
-
-: com-search ( workspace -- )
-    "" <help-search> "Help search" show-titled-popup ;
-
-: source-file-candidates ( seq -- candidates )
-    [ dup <pathname> swap >lower ] { } map>assoc ;
-
-: <source-file-search> ( string files -- gadget )
-    source-file-candidates
-    f [ string>> ] <live-search> ;
-
-: all-source-files ( -- seq )
-    source-files get keys natural-sort ;
-
-: com-sources ( workspace -- )
-    "" all-source-files <source-file-search>
-    "Source file search" show-titled-popup ;
-
-: show-vocab-files ( workspace vocab -- )
-    [ "" swap vocab-files <source-file-search> ]
-    [ "Source files in " swap vocab-name append ]
-    bi show-titled-popup ;
-
-: vocab-candidates ( -- candidates )
-    all-vocabs-seq [ dup vocab-name >lower ] { } map>assoc ;
-
-: <vocab-search> ( string -- gadget )
-    vocab-candidates f [ vocab-name ] <live-search> ;
-
-: com-vocabs ( workspace -- )
-    dup current-word <vocab-search>
-    "Vocabulary search" show-titled-popup ;
-
-: history-candidates ( seq -- candidates )
-    [ dup <input> swap >lower ] { } map>assoc ;
-
-: <history-search> ( string seq -- gadget )
-    history-candidates
-    f [ string>> ] <live-search> ;
-
-: listener-history ( listener -- seq )
-    input>> history>> <reversed> ;
-
-: com-history ( workspace -- )
-    "" over listener>> listener-history <history-search>
-    "History search" show-titled-popup ;
-
-workspace "toolbar" f {
-    { T{ key-down f { C+ } "p" } com-history }
-    { T{ key-down f f "TAB" } com-words }
-    { T{ key-down f { C+ } "u" } com-vocabs }
-    { T{ key-down f { C+ } "e" } com-sources }
-    { T{ key-down f { C+ } "h" } com-search }
-} define-command-map
diff --git a/basis/ui/tools/search/summary.txt b/basis/ui/tools/search/summary.txt
deleted file mode 100644 (file)
index af5dcef..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Support for graphical completion popups
index 2caea234801e0f05de7b010d02ac6566ca13c38a..9e63be09ab3f5fb36abf2da281b011231024555c 100644 (file)
@@ -1,12 +1,24 @@
-USING: editors help.markup help.syntax summary inspector io
-io.styles listener parser prettyprint tools.profiler
-tools.walker ui.commands ui.gadgets.editors ui.gadgets.panes
-ui.gadgets.presentations ui.gadgets.slots ui.operations
-ui.tools.browser ui.tools.interactor ui.tools.inspector
-ui.tools.listener ui.tools.operations ui.tools.profiler
-ui.tools.walker ui.tools.workspace vocabs ;
+USING: editors help.markup help.syntax summary inspector io io.styles
+listener parser prettyprint tools.profiler tools.walker ui.commands
+ui.gadgets.panes ui.gadgets.presentations ui.operations
+ui.tools.operations ui.tools.profiler ui.tools.common vocabs ;
 IN: ui.tools
 
+ARTICLE: "starting-ui-tools" "Starting the UI tools"
+"The UI tools start automatically where possible:"
+{ $list
+    { "On Windows, the tools start when the Factor executable is run." }
+    { "On X11, the tools start if the " { $snippet "DISPLAY" } " environment variable is set." }
+    { "On Mac OS X, the tools start if the " { $snippet "Factor.app" } " application bundle is run." }
+}
+"In all cases, passing the " { $snippet "-run=listener" } " command line switch starts the terminal listener instead. The UI can be started from the terminal by issuing the following command:"
+{ $code "USE: threads" "[ \"ui.tools\" run ] in-thread" } ;
+
+ARTICLE: "ui-shortcuts" "UI tool keyboard shortcuts"
+"Every UI tool has its own set of keyboard shortcuts; press " { $snippet "F1" } " inside a tool to see help. Some common shortcuts are also supported by all tools:"
+{ $command-map tool "tool-switching" }
+{ $command-map tool "common" } ;
+
 ARTICLE: "ui-presentations" "Presentations in the UI"
 "A " { $emphasis "presentation" } " is a graphical view of an object which is directly linked to the object in some way. The help article links you see in the documentation browser are presentations; and if you " { $link see } " a word in the UI listener, all words in the definition will themselves be presentations."
 $nl
@@ -16,54 +28,18 @@ $nl
 $nl
 "Clicking and holding the right mouse button on a presentation displays a popup menu listing available operations."
 $nl
-"Presentation gadgets can be constructed directly using the " { $link <presentation> } " word, and they can also be written to " { $link pane } " gadgets using the " { $link write-object } " word." ;
-
-ARTICLE: "ui-listener" "UI listener"
-"The graphical listener is based around the terminal listener (" { $link "listener" } ") and adds the following features:"
-{ $list
-    "Input history"
-    { "Completion (see " { $link "ui-completion" } ")" }
-    { "Clickable presentations (see " { $link "ui-presentations" } ")" }
-}
-{ $command-map listener-gadget "toolbar" }
-{ $command-map interactor "interactor" }
-{ $command-map source-editor "word" }
-{ $command-map interactor "quotation" }
-{ $heading "Editing commands" }
-"The text editing commands are standard; see " { $link "gadgets-editors" } "."
-{ $heading "Implementation" }
-"Listeners are instances of " { $link listener-gadget } ". The listener consists of an output area (instance of " { $link pane } ") and an input area (instance of " { $link interactor } ")." ;
-
-ARTICLE: "ui-inspector" "UI inspector"
-"The graphical inspector builds on the terminal inspector (see " { $link "inspector" } ") and provides in-place editing of slot values."
-$nl
-"To display an object in the UI inspector, use the " { $link inspect } " word from the UI listener, or right-click a presentation and choose " { $strong "Inspect" } " from the menu that appears."
-$nl
-"When the UI inspector is running, all of the terminal inspector words are available, such as " { $link &at } " and " { $link &put } ". Changing slot values using terminal inspector words automatically updates the UI inspector display."
-$nl
-"Slots can also be edited graphically. Clicking the ellipsis to the left of the slot's textual representation displays a slot editor gadget. A text representation of the object can be edited in the slot editor. The parser is used to turn the text representation back into an object. Keep in mind that some structure is lost in the conversion; see " { $link "prettyprint-limitations" } "."
-$nl
-"The slot editor's text editing commands are standard; see " { $link "gadgets-editors" } "."
-$nl
-"The slot editor has a toolbar containing various commands."
-{ $command-map slot-editor "toolbar" }
-{ $command-map inspector-gadget "multi-touch" }
-"The following commands are also available."
-{ $command-map source-editor "word" } ;
-
-ARTICLE: "ui-browser" "UI browser"
-"The browser is used to display Factor code, documentation, and vocabularies."
-{ $command-map browser-gadget "toolbar" }
-{ $command-map browser-gadget "multi-touch" }
-"Browsers are instances of " { $link browser-gadget } "." ;
+"For more about presentation gadgets, see " { $link "ui.gadgets.presentations" } "." ;
 
 ARTICLE: "ui-profiler" "UI profiler" 
 "The graphical profiler is based on the terminal profiler (see " { $link "profiling" } ") and adds more convenient browsing of profiler results."
 $nl
 "To use the profiler, enter a piece of code in the listener input area and press " { $operation com-profile } "."
 $nl
-"Vocabulary and word presentations in the profiler pane can be clicked on to show profiler results pertaining to the object in question. Clicking a vocabulary in the profiler yields the same output as the " { $link vocab-profile. } " word, and clicking a word yields the same output as the " { $link usage-profile. } " word. Consult " { $link "profiling" } " for details."
-{ $command-map profiler-gadget "toolbar" } ;
+"Clicking on a vocabulary in the vocabulary list narrows down the word list to only include words from that vocabulary. The sorting options control the order of elements in the vocabulary and word lists. The search fields narrow down the list to only include words or vocabularies whose names contain a substring."
+$nl
+"Consult " { $link "profiling" } " for details about the profiler itself."
+{ $command-map profiler-gadget "toolbar" }
+"The profiler is an instance of " { $link profiler-gadget } "." ;
 
 ARTICLE: "ui-cocoa" "Functionality specific to Mac OS X"
 "On Mac OS X, the Factor UI offers additional features which integrate with this operating system."
@@ -76,49 +52,16 @@ $nl
 
 ;
 
-ARTICLE: "ui-completion-words" "Word completion popup"
-"Clicking a word in the word completion popup displays the word definition in the " { $link "ui-browser" } ". Pressing " { $snippet "RET" } " with a word selected inserts the word name in the listener, along with a " { $link POSTPONE: USE: } " declaration (if necessary)."
-{ $operations \ $operations } ;
-
-ARTICLE: "ui-completion-vocabs" "Vocabulary completion popup"
-"Clicking a vocabulary in the vocabulary completion popup displays a list of words in the vocabulary in another " { $link "ui-completion-words" } ". Pressing " { $snippet "RET" } " adds the vocabulary to the current search path, just as if you invoked " { $link POSTPONE: USE: } "."
-{ $operations "kernel" vocab } ;
-
-ARTICLE: "ui-completion-sources" "Source file completion popup"
-"The source file completion popup lists all source files which have been previously loaded by " { $link run-file } ". Clicking a source file or pressing " { $snippet "RET" } " opens the source file in your editor with " { $link edit } "."
-{ $operations P" " } ;
-
-ARTICLE: "ui-completion" "UI completion popups"
-"Completion popups allow fast access to aspects of the environment. Completion popups can be invoked by clicking the row of buttons along the bottom of the workspace, or via keyboard commands:"
-{ $command-map workspace "toolbar" }
-"A completion popup instantly updates the list of completions as keys are typed. The list of completions can be navigated from the keyboard with the " { $snippet "UP" } " and " { $snippet "DOWN" } " arrow keys. Every completion has a " { $emphasis "primary action" } " and " { $emphasis "secondary action" } ". The primary action is invoked when clicking a completion, and the secondary action is invoked on the currently-selected completion when pressing " { $snippet "RET" } "."
-$nl
-"The primary and secondary actions, along with additional keyboard shortcuts, are documented for some completion popups in the below sections."
-{ $subsection "ui-completion-words" }
-{ $subsection "ui-completion-vocabs" }
-{ $subsection "ui-completion-sources" } ;
-
-ARTICLE: "ui-workspace-keys" "UI keyboard shortcuts"
-"See " { $link "gesture-differences" } " to find out how your platform's modifier keys map to modifiers in the Factor UI."
-{ $command-map workspace "tool-switching" }
-{ $command-map workspace "scrolling" }
-{ $command-map workspace "workflow" }
-{ $command-map workspace "multi-touch" } ;
-
 ARTICLE: "ui-tools" "UI developer tools"
-"The Factor development environment can seem rather different from what you are used to, because it is very simple and powerful.."
+"The " { $vocab-link "ui.tools" } " vocabulary hierarchy implements a collection of simple developer tools."
 $nl
-"To take full advantage of the UI, you should be using a supported text editor. See " { $link "editor" } "."
-{ $subsection "ui-workspace-keys" }
+"To take full advantage of the UI tools, you should be using a supported text editor. See " { $link "editor" } "."
+{ $subsection "ui-shortcuts" }
 { $subsection "ui-presentations" }
-{ $subsection "ui-completion" }
-{ $heading "Tools" }
-"A single-window " { $emphasis "workspace" } " contains the most frequently-used tools:"
 { $subsection "ui-listener" }
 { $subsection "ui-browser" }
 { $subsection "ui-inspector" }
 { $subsection "ui-profiler" }
-"Additional tools:"
 { $subsection "ui-walker" }
 { $subsection "ui.tools.deploy" }
 "Platform-specific features:"
diff --git a/basis/ui/tools/tools-tests.factor b/basis/ui/tools/tools-tests.factor
deleted file mode 100644 (file)
index 5ce9e4c..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-USING: ui.tools ui.tools.interactor ui.tools.listener
-ui.tools.search ui.tools.workspace kernel models namespaces
-sequences tools.test ui.gadgets ui.gadgets.buttons
-ui.gadgets.labelled ui.gadgets.presentations
-ui.gadgets.menus ui.gadgets.scrollers vocabs tools.test.ui ui accessors ;
-IN: ui.tools.tests
-
-[ f ]
-[
-    <gadget> 0 <model> >>model <workspace-tabs> children>> empty?
-] unit-test
-
-[ ] [ <workspace> "w" set ] unit-test
-[ ] [ "w" get com-scroll-up ] unit-test
-[ ] [ "w" get com-scroll-down ] unit-test
-[ t ] [
-    "w" get book>> children>>
-    [ tool-scroller ] map sift [ scroller? ] all?
-] unit-test
-[ ] [ "w" get hide-popup ] unit-test
-[ ] [ <gadget> "w" get show-popup ] unit-test
-[ ] [ "w" get hide-popup ] unit-test
-
-[ ] [
-    <gadget> "w" get show-popup
-    <gadget> "w" get show-popup
-    "w" get hide-popup
-] unit-test
-
-[ ] [ <workspace> [ ] with-grafted-gadget ] unit-test
-
-"w" get [
-
-    [ ] [ "w" get "kernel" vocab show-vocab-words ] unit-test
-
-    [ ] [ notify-queued ] unit-test
-
-    [ ] [ "w" get popup>> content>>
-    list>> gadget-child "p" set ] unit-test
-
-    [ t ] [ "p" get presentation? ] unit-test
-
-    [ ] [
-        "p" get [ object>> ] [ dup hook>> curry ] bi
-        <operations-menu> gadget-child gadget-child "c" set
-    ] unit-test
-
-    [ ] [ notify-queued ] unit-test
-
-    [ t ] [ "c" get button? ] unit-test
-
-    [ ] [
-        "w" get listener>> input>>
-        3 handle-parse-error
-    ] unit-test
-
-    [ ] [ notify-queued ] unit-test
-] with-grafted-gadget
index 9927f9e5ae9353683012f132d177cab5d3105b38..203953db1a7b13f2935022878f99e738b1f57e50 100644 (file)
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs debugger ui.tools.workspace
-ui.tools.operations ui.tools.traceback ui.tools.browser
-ui.tools.inspector ui.tools.listener ui.tools.profiler
-ui.tools.operations inspector io kernel math models namespaces
-prettyprint quotations sequences ui ui.commands ui.gadgets
-ui.gadgets.books ui.gadgets.buttons ui.gadgets.labelled
-ui.gadgets.scrollers ui.gadgets.tracks ui.gadgets.worlds
-ui.gadgets.presentations ui.gestures words vocabs.loader
-tools.test tools.vocabs ui.gadgets.buttons ui.gadgets.status-bar
-mirrors fry ;
+USING: memory system kernel tools.vocabs ui.tools.operations
+ui.tools.listener ui.tools.browser ui.tools.common
+ui.tools.walker ui.commands ui.gestures ui ui.private ;
 IN: ui.tools
 
-: <workspace-tabs> ( workspace -- tabs )
-    model>>
-        "tool-switching" workspace command-map commands>>
-        [ command-string ] { } assoc>map <enum> >alist
-    <toggle-buttons> ;
+: main ( -- )
+    restore-windows? [ restore-windows ] [ listener-window ] if ;
 
-: <workspace-book> ( workspace -- gadget )
-        <gadget>
-        <browser-gadget>
-        <inspector-gadget>
-        <profiler-gadget>
-    4array
-    swap model>> <book> ;
-  
-: <workspace> ( -- workspace )
-    { 0 1 } workspace new-track
-        0 <model> >>model
-        <listener-gadget> >>listener
-        dup <workspace-book> >>book
+MAIN: main
 
-        dup <workspace-tabs> f track-add
-        dup book>> 0 track-add
-        dup listener>> 1 track-add
-        add-toolbar ;
+\ refresh-all H{ { +nullary+ t } { +listener+ t } } define-command
 
-: resize-workspace ( workspace -- )
-    dup sizes>> over control-value 0 = [
-        0 over set-second
-        1 swap set-third
-    ] [
-        2/3 over set-second
-        1/3 swap set-third
-    ] if relayout ;
+\ save H{ { +nullary+ t } } define-command
 
-M: workspace model-changed
-    nip
-    dup listener>> output>> scroll>bottom
-    dup resize-workspace
-    request-focus ;
+: com-exit ( -- ) 0 exit ;
 
-[ workspace-window ] ui-hook set-global
+\ com-exit H{ { +nullary+ t } } define-command
 
-: select-tool ( workspace n -- ) swap book>> model>> set-model ;
-
-: com-listener ( workspace -- ) 0 select-tool ;
-
-: com-browser ( workspace -- ) 1 select-tool ;
-
-: com-inspector ( workspace -- ) 2 select-tool ;
-
-: com-profiler ( workspace -- ) 3 select-tool ;
-
-workspace "tool-switching" f {
-    { T{ key-down f { A+ } "1" } com-listener }
-    { T{ key-down f { A+ } "2" } com-browser }
-    { T{ key-down f { A+ } "3" } com-inspector }
-    { T{ key-down f { A+ } "4" } com-profiler }
-} define-command-map
-
-workspace "multi-touch" f {
-    { T{ zoom-out-action } com-listener }
-    { T{ up-action } refresh-all }
+tool "tool-switching" f {
+    { T{ key-down f { A+ } "l" } show-listener }
+    { T{ key-down f { A+ } "L" } listener-window }
+    { T{ key-down f { A+ } "b" } show-browser }
+    { T{ key-down f { A+ } "B" } browser-window }
 } define-command-map
 
-\ workspace-window
-H{ { +nullary+ t } } define-command
-
-\ refresh-all
-H{ { +nullary+ t } { +listener+ t } } define-command
-
-workspace "workflow" f {
-    { T{ key-down f { C+ } "n" } workspace-window }
-    { T{ key-down f f "ESC" } hide-popup }
+tool "common" f {
+    { T{ key-down f { A+ } "s" } save }
+    { T{ key-down f { A+ } "w" } close-window }
+    { T{ key-down f { A+ } "q" } com-exit }
     { T{ key-down f f "F2" } refresh-all }
-} define-command-map
-
-[
-    <workspace> dup "Factor workspace" open-status-window
-] workspace-window-hook set-global
-
-: inspect-continuation ( traceback -- )
-    control-value '[ _ inspect ] call-listener ;
-
-traceback-gadget "toolbar" f {
-    { T{ key-down f f "v" } variables }
-    { T{ key-down f f "n" } inspect-continuation }
-} define-command-map
+} define-command-map
\ No newline at end of file
index 90f1e601c7fa740b43beb58ab28a58844f1904e7..affad4d3e39420e16c2acdb5c62e567eba1fd3b6 100644 (file)
@@ -1,56 +1,81 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors continuations kernel models namespaces
-       prettyprint ui ui.commands ui.gadgets ui.gadgets.labelled assocs
-       ui.gadgets.tracks ui.gadgets.buttons ui.gadgets.panes
-       ui.gadgets.status-bar ui.gadgets.scrollers ui.gestures sequences
-       hashtables inspector ;
-
+USING: accessors continuations kernel models namespaces arrays
+fry prettyprint ui ui.commands ui.gadgets ui.gadgets.labeled assocs
+ui.gadgets.tracks ui.gadgets.buttons ui.gadgets.panes
+ui.gadgets.status-bar ui.gadgets.scrollers ui.gadgets.borders
+ui.gadgets.tables ui.gestures sequences inspector
+models.arrow fonts ;
+QUALIFIED-WITH: ui.tools.inspector i
 IN: ui.tools.traceback
 
+TUPLE: stack-entry object string ;
+
+: <stack-entry> ( object -- stack-entry )
+    dup unparse-short stack-entry boa ;
+
+SINGLETON: stack-entry-renderer
+
+M: stack-entry-renderer row-columns drop string>> 1array ;
+
+M: stack-entry-renderer row-value drop object>> ;
+
+: <stack-table> ( model -- table )
+    [ [ <stack-entry> ] map ] <arrow> stack-entry-renderer <table>
+        10 >>min-rows
+        10 >>max-rows
+        40 >>min-cols
+        40 >>max-cols
+        monospace-font >>font
+        [ i:inspector ] >>action
+        t >>single-click? ;
+
+: <stack-display> ( model quot title -- gadget )
+    [ '[ dup _ when ] <arrow> <stack-table> <scroller> ] dip
+    <labeled-gadget> ;
+
 : <callstack-display> ( model -- gadget )
     [ [ call>> callstack. ] when* ]
-    t "Call stack" <labelled-pane> ;
+    <pane-control> t >>scrolls? <scroller>
+    "Call stack" <labeled-gadget> ;
 
 : <datastack-display> ( model -- gadget )
-    [ [ data>> stack. ] when* ]
-    t "Data stack" <labelled-pane> ;
+    [ data>> ] "Data stack" <stack-display> ;
 
 : <retainstack-display> ( model -- gadget )
-    [ [ retain>> stack. ] when* ]
-    t "Retain stack" <labelled-pane> ;
+    [ retain>> ] "Retain stack" <stack-display> ;
 
 TUPLE: traceback-gadget < track ;
 
-M: traceback-gadget pref-dim* drop { 550 600 } ;
-
 : <traceback-gadget> ( model -- gadget )
-    { 0 1 } traceback-gadget new-track
-        swap >>model
-
-    dup model>>
-        { 1 0 } <track>
-            over <datastack-display> 1/2 track-add
-            swap <retainstack-display> 1/2 track-add
-        1/3 track-add
-
-    dup model>> <callstack-display> 2/3 track-add
-
+    [
+        vertical traceback-gadget new-track
+        { 3 3 } >>gap
+    ] dip
+    [ >>model ]
+    [
+        [ vertical <track> { 3 3 } >>gap ] dip
+        [
+            [ horizontal <track> { 3 3 } >>gap ] dip
+            [ <datastack-display> 1/2 track-add ]
+            [ <retainstack-display> 1/2 track-add ] bi
+            1/3 track-add
+        ]
+        [ <callstack-display> 2/3 track-add ] bi
+        { 3 3 } <filled-border> 1 track-add
+    ] bi
     add-toolbar ;
 
-: <namestack-display> ( model -- gadget )
-    [ [ name>> namestack. ] when* ]
-    <pane-control> ;
-
-: <variables-gadget> ( model -- gadget )
-    <namestack-display>
-    <limited-scroller>
-        { 400 400 } >>min-dim
-        { 400 400 } >>max-dim ;
-
 : variables ( traceback -- )
-    model>> <variables-gadget>
-    "Dynamic variables" open-status-window ;
+    model>> [ dup [ name>> vars-in-scope ] when ] <arrow> i:inspect-model ;
 
 : traceback-window ( continuation -- )
     <model> <traceback-gadget> "Traceback" open-status-window ;
+
+: inspect-continuation ( traceback -- )
+    control-value i:inspector ;
+
+traceback-gadget "toolbar" f {
+    { T{ key-down f f "v" } variables }
+    { T{ key-down f f "n" } inspect-continuation }
+} define-command-map
\ No newline at end of file
index fb0ce0adf24e1c2cd8ad53b388b97dd233300b8d..011e3b4866f1ccc24546173ddd4302e7624a6258 100644 (file)
@@ -36,6 +36,7 @@ $nl
 "Walkers are instances of " { $link walker-gadget } "."\r
 { $subsection "ui-walker-step" }\r
 { $subsection "breakpoints" }\r
-{ $command-map walker-gadget "toolbar" } ;\r
+{ $command-map walker-gadget "toolbar" }\r
+{ $command-map walker-gadget "multitouch" } ;\r
 \r
 ABOUT: "ui-walker"\r
index e6643698c7c26415782855b9f35c2c103318a1d6..1f427d9405b8defa1fd33640c52a9fef4b528056 100644 (file)
@@ -1,14 +1,14 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors kernel concurrency.messaging inspector
 ui.tools.listener ui.tools.traceback ui.gadgets.buttons
 ui.gadgets.status-bar ui.gadgets.tracks ui.commands ui.gadgets
-models models.filter ui.tools.workspace ui.gestures
+models models.arrow ui.tools.browser ui.tools.common ui.gestures
 ui.gadgets.labels ui threads namespaces make tools.walker assocs
 combinators fry ;
 IN: ui.tools.walker
 
-TUPLE: walker-gadget < track
+TUPLE: walker-gadget < tool
 status continuation thread
 traceback
 closing? ;
@@ -53,10 +53,10 @@ M: walker-gadget focusable-child*
     ] "" make ;
 
 : <thread-status> ( model thread -- gadget )
-    '[ _ walker-state-string ] <filter> <label-control> ;
+    '[ _ walker-state-string ] <arrow> <label-control> ;
 
 : <walker-gadget> ( status continuation thread -- gadget )
-    { 0 1 } walker-gadget new-track
+    vertical walker-gadget new-track
         swap >>thread
         swap >>continuation
         swap >>status
@@ -66,7 +66,7 @@ M: walker-gadget focusable-child*
         dup status>> self <thread-status> f track-add
         dup traceback>> 1 track-add ;
     
-: walker-help ( -- ) "ui-walker" help-window ;
+: walker-help ( -- ) "ui-walker" com-browse ;
 
 \ walker-help H{ { +nullary+ t } } define-command
 
@@ -81,6 +81,15 @@ walker-gadget "toolbar" f {
     { T{ key-down f f "F1" } walker-help }
 } define-command-map
 
+walker-gadget "multitouch" f {
+    { left-action com-back }
+    { right-action com-step }
+    { up-action com-out }
+    { down-action com-into }
+    { zoom-out-action close-window }
+    { zoom-in-action com-abandon }
+} define-command-map
+
 : walker-for-thread? ( thread gadget -- ? )
     {
         { [ dup walker-gadget? not ] [ 2drop f ] }
diff --git a/basis/ui/tools/workspace/authors.txt b/basis/ui/tools/workspace/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/ui/tools/workspace/summary.txt b/basis/ui/tools/workspace/summary.txt
deleted file mode 100644 (file)
index f7e3245..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Graphical development environment
diff --git a/basis/ui/tools/workspace/tags.txt b/basis/ui/tools/workspace/tags.txt
deleted file mode 100644 (file)
index ef1aab0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-tools
diff --git a/basis/ui/tools/workspace/workspace-tests.factor b/basis/ui/tools/workspace/workspace-tests.factor
deleted file mode 100644 (file)
index 49b14cd..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-IN: ui.tools.workspace.tests
-USING: tools.test ui.tools ;
-
-\ <workspace> must-infer
diff --git a/basis/ui/tools/workspace/workspace.factor b/basis/ui/tools/workspace/workspace.factor
deleted file mode 100644 (file)
index 3b689ee..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: classes continuations help help.topics kernel models
-sequences assocs arrays namespaces accessors math.vectors fry ui
-ui.backend ui.tools.debugger ui.gadgets ui.gadgets.books
-ui.gadgets.buttons ui.gadgets.labelled ui.gadgets.panes
-ui.gadgets.scrollers ui.gadgets.tracks ui.gadgets.worlds
-ui.gadgets.presentations ui.gadgets.status-bar ui.commands
-ui.gestures ;
-IN: ui.tools.workspace
-
-TUPLE: workspace < track book listener popup ;
-
-: find-workspace ( gadget -- workspace ) [ workspace? ] find-parent ;
-
-SYMBOL: workspace-window-hook
-
-: workspace-window* ( -- workspace ) workspace-window-hook get call ;
-
-: workspace-window ( -- ) workspace-window* drop ;
-
-GENERIC: call-tool* ( arg tool -- )
-
-GENERIC: tool-scroller ( tool -- scroller )
-
-M: gadget tool-scroller drop f ;
-
-: find-tool ( class workspace -- index tool )
-    book>> children>> [ class eq? ] with find ;
-
-: show-tool ( class workspace -- tool )
-    [ find-tool swap ] keep book>> model>>
-    set-model ;
-
-: get-workspace* ( quot -- workspace )
-    '[ dup workspace? _ [ drop f ] if ] find-window
-    [ dup raise-window gadget-child ]
-    [ workspace-window* ] if* ; inline
-
-: get-workspace ( -- workspace ) [ drop t ] get-workspace* ;
-
-: call-tool ( arg class -- )
-    get-workspace show-tool call-tool* ;
-
-: get-tool ( class -- gadget )
-    get-workspace find-tool nip ;
-
-: <help-pane> ( topic -- pane )
-    <pane> [ [ help ] with-pane ] keep ;
-
-: help-window ( topic -- )
-    [
-        <help-pane> <limited-scroller>
-            { 550 700 } >>max-dim
-    ] [ article-title ] bi
-    open-window ;
-
-: hide-popup ( workspace -- )
-    dup popup>> track-remove
-    f >>popup
-    request-focus ;
-
-: show-popup ( gadget workspace -- )
-    dup hide-popup
-    over >>popup
-    over f track-add drop
-    request-focus ;
-
-: show-titled-popup ( workspace gadget title -- )
-    [ find-workspace hide-popup ] <closable-gadget>
-    swap show-popup ;
-
-: debugger-popup ( error workspace -- )
-    swap dup compute-restarts
-    [ find-workspace hide-popup ] <debugger>
-    "Error" show-titled-popup ;
-
-SYMBOL: workspace-dim
-
-{ 600 700 } workspace-dim set-global
-
-M: workspace pref-dim* call-next-method workspace-dim get vmax ;
-
-M: workspace focusable-child*
-    dup popup>> [ ] [ listener>> ] ?if ;
-
-: workspace-page ( workspace -- gadget )
-    book>> current-page ;
-
-M: workspace tool-scroller ( workspace -- scroller )
-    workspace-page tool-scroller ;
-
-: com-scroll-up ( workspace -- )
-    tool-scroller [ scroll-up-page ] when* ;
-
-: com-scroll-down ( workspace -- )
-    tool-scroller [ scroll-down-page ] when* ;
-
-workspace "scrolling"
-"The current tool's scroll pane can be scrolled from the keyboard."
-{
-    { T{ key-down f { C+ } "PAGE_UP" } com-scroll-up }
-    { T{ key-down f { C+ } "PAGE_DOWN" } com-scroll-down }
-} define-command-map
index 7a012aa3e001891530b7022b5ad4263443533c9f..63c656205c9d410fcc1a17b5d759aae3d82aa324 100644 (file)
@@ -19,8 +19,9 @@ TUPLE: node value children ;
             nip ,
         ] [
             [
-                2dup children>> swap first head-slice %
-                tuck traverse-step traverse-to-path
+                [ children>> swap first head-slice % ]
+                [ tuck traverse-step traverse-to-path ]
+                2bi
             ] make-node
         ] if
     ] if ;
@@ -33,8 +34,8 @@ TUPLE: node value children ;
             nip ,
         ] [
             [
-                2dup traverse-step traverse-from-path
-                tuck children>> swap first 1+ tail-slice %
+                [ traverse-step traverse-from-path ]
+                [ tuck children>> swap first 1+ tail-slice % ] 2bi
             ] make-node
         ] if
     ] if ;
@@ -77,7 +78,7 @@ DEFER: (gadget-subtree)
     [ (gadget-subtree) ] { } make ;
 
 M: node gadget-text*
-    dup children>> swap value>> gadget-seq-text ;
+    [ children>> ] [ value>> ] bi gadget-seq-text ;
 
 : gadget-text-range ( frompath topath gadget -- str )
     gadget-subtree gadget-text ;
index 5c0085bc45b40c13ed53037ced3d48375c38943b..d08dea299edafd4284ec09aeda793d8111997f7d 100644 (file)
@@ -1,6 +1,8 @@
 USING: help.markup help.syntax strings quotations debugger
-io.styles namespaces ui.backend ui.gadgets ui.gadgets.worlds
-ui.gadgets.tracks ui.gadgets.packs ui.gadgets.grids math.geometry.rect colors ;
+namespaces ui.backend ui.gadgets ui.gadgets.worlds
+ui.gadgets.tracks ui.gadgets.packs ui.gadgets.grids
+ui.gadgets.private math.rectangles colors ui.text fonts
+kernel ui.private ;
 IN: ui
 
 HELP: windows
@@ -36,10 +38,13 @@ HELP: unregister-window
 { $description "Removes a window from the global " { $link windows } " variable." }
 { $notes "This word should only be called only by the UI backend, and not user code." } ;
 
-HELP: ui
-{ $description "Starts the Factor UI." } ;
+HELP: (with-ui)
+{ $values { "quot" quotation } }
+{ $contract "Starts the Factor UI." }
+{ $notes "This is a low-level word; user code should call " { $link with-ui } " instead." } ;
 
 HELP: start-ui
+{ $values { "quot" quotation } }
 { $description "Called by the UI backend to initialize the platform-independent parts of UI. This word should be called after the backend is ready to start displaying new windows, and before the event loop starts." } ;
 
 HELP: (open-window)
@@ -57,22 +62,17 @@ HELP: with-ui
 { $notes "This combinator should be used in the " { $link POSTPONE: MAIN: } " word of a vocabulary, in order for the vocabulary to work when run from the UI listener (" { $snippet "\"my-app\" run" } " and the command line (" { $snippet "./factor -run=my-app" } ")." }
 { $examples "The " { $vocab-link "hello-ui" } " vocabulary implements a simple UI application which uses this combinator." } ;
 
+HELP: beep
+{ $description "Plays the system beep sound." } ;
+
 ARTICLE: "ui-glossary" "UI glossary"
 { $table
     { "color" { "an instance of " { $link color } } }
     { "dimension" "a pair of integers denoting pixel size on screen" }
-    { "font specifier"
-        { "an array of three elements:"
-            { $list
-                { "font family - one of " { $snippet "serif" } ", " { $snippet "sans-serif" } " or " { $snippet "monospace" } }
-                { "font style - one of " { $link plain } ", " { $link bold } ", " { $link italic } " or " { $link bold-italic } }
-                "font size in points"
-            }
-        }
-    }
+    { "font" { "an instance of " { $link font } } }
     { "gadget" { "a graphical element which responds to user input. Gadgets are tuples which (directly or indirectly) inherit from " { $link gadget } "." } }
     { "label specifier" { "a string, " { $link f } " or a gadget. See " { $link "ui.gadgets.buttons" } } }
-    { "orientation specifier" { "one of " { $snippet "{ 0 1 }" } " or " { $snippet "{ 1 0 }" } ", with the former denoting vertical orientation and the latter denoting horizontal. Using a vector instead of symbolic constants allows these values to be directly useful in co-ordinate calculations" } }
+    { "orientation specifier" { "one of " { $link horizontal } " or " { $link vertical } } }
     { "point" "a pair of integers denoting a pixel location on screen" }
 } ;
 
@@ -84,25 +84,25 @@ ARTICLE: "building-ui" "Building user interfaces"
 { $subsection "ui-layouts" }
 { $subsection "gadgets" }
 { $subsection "ui-windows" }
+{ $subsection "ui.gadgets.status-bar" }
 { $see-also "models" } ;
 
 ARTICLE: "gadgets" "Pre-made UI gadgets"
 { $subsection "ui.gadgets.labels" }
-{ $subsection "gadgets-polygons" }
 { $subsection "ui.gadgets.borders" }
-{ $subsection "ui.gadgets.labelled" }
+{ $subsection "ui.gadgets.labeled" }
 { $subsection "ui.gadgets.buttons" }
 { $subsection "ui.gadgets.sliders" }
 { $subsection "ui.gadgets.scrollers" }
-{ $subsection "gadgets-editors" }
+{ $subsection "ui.gadgets.editors" }
 { $subsection "ui.gadgets.menus" }
 { $subsection "ui.gadgets.panes" }
 { $subsection "ui.gadgets.presentations" }
-{ $subsection "ui.gadgets.lists" } ;
+{ $subsection "ui.gadgets.tables" } ;
 
 ARTICLE: "ui-geometry" "Gadget geometry"
 "The " { $link gadget } " class inherits from the " { $link rect } " class, and thus all gadgets have a bounding box:"
-{ $subsection "math.geometry.rect" }
+{ $subsection "math.rectangles" }
 "Word for converting from a child gadget's co-ordinate system to a parent's:"
 { $subsection relative-loc }
 { $subsection screen-loc }
@@ -131,7 +131,7 @@ ARTICLE: "ui-backend" "Developing UI backends"
 "UI backends may implement the " { $link "clipboard-protocol" } "." ;
 
 ARTICLE: "ui-backend-init" "UI initialization and the event loop"
-"An UI backend is required to define a method on the " { $link ui } " word. This word should contain backend initialization, together with some boilerplate:"
+"An UI backend is required to define a method on the " { $link (with-ui) } " word. This word should contain backend initialization, together with some boilerplate:"
 { $code
     "IN: shells"
     ""
@@ -143,7 +143,7 @@ ARTICLE: "ui-backend-init" "UI initialization and the event loop"
 }
 "The above word must call the following:"
 { $subsection start-ui }
-"The " { $link ui } " word must not return until the event loop has stopped and the UI has been shut down." ;
+"The " { $link (with-ui) } " word must not return until the event loop has stopped and the UI has been shut down." ;
 
 ARTICLE: "ui-backend-windows" "UI backend window management"
 "The high-level " { $link open-window } " word eventually calls a low-level word which you must implement:"
@@ -227,26 +227,17 @@ ARTICLE: "new-gadgets" "Implementing new gadgets"
 $nl
 "Bare gadgets can be constructed directly, which is useful if all you need is a custom appearance with no further behavior (see " { $link "ui-pen-protocol" } "):"
 { $subsection <gadget> }
-"New gadgets are defined as subclasses of an existing gadget type, perhaps even " { $link gadget } " itself. A parametrized constructor should be used to construct subclasses:"
-{ $subsection new-gadget }
+"New gadgets are defined as subclasses of an existing gadget type, perhaps even " { $link gadget } " itself. Direct subclasses of " { $link gadget } " can be constructed using " { $link new } ", however some subclasses may define their own parametrized constructors (see " { $link "parametrized-constructors" } ")."
+$nl
 "Further topics:"
 { $subsection "ui-gestures" }
 { $subsection "ui-paint" }
 { $subsection "ui-control-impl" }
 { $subsection "clipboard-protocol" }
+{ $subsection "ui.gadgets.line-support" }
 { $see-also "ui-layout-impl" } ;
 
 ARTICLE: "starting-ui" "Starting the UI"
-"The UI starts automatically where possible:"
-{ $list
-    { "On Windows, the UI starts when the Factor executable is run." }
-    { "On X11, the UI starts if the " { $snippet "DISPLAY" } " environment variable is set." }
-    { "On Mac OS X, the UI starts if the " { $snippet "Factor.app" } " application bundle is run." }
-}
-"In all cases, passing the " { $snippet "-run=listener" } " command line switch starts the terminal listener instead. The UI can be started from the terminal listener using a word:"
-{ $subsection ui }
-"To run the terminal listener and the UI simultaneously, start the UI in a new thread:"
-{ $code "USING: threads ui ;" "[ ui ] in-thread" }
 "The main word of a vocabulary implementing a UI application should use a combinator to ensure that the application works when run from the command line as well as in the UI listener:"
 { $subsection with-ui } ;
 
index 15999d128b081ac41f6f46ecc5a7ff0c275df247..4b4bf9d9eebb3186805a879c957e5baaa98db8e0 100644 (file)
@@ -1,4 +1,5 @@
 IN: ui.tests
-USING: ui tools.test ;
+USING: ui ui.private tools.test ;
 
 \ open-window must-infer
+\ update-ui must-infer
\ No newline at end of file
index 769dc9c64e608eaed67313d9f4680778fa567439..42885aecb70c7bb6145a4757aa41200b36c62b8c 100644 (file)
@@ -1,12 +1,15 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays assocs io kernel math models namespaces make
-dlists deques sequences threads sequences words ui.gadgets
-ui.gadgets.worlds ui.gadgets.tracks ui.gestures ui.backend
-ui.render continuations init combinators hashtables
-concurrency.flags sets accessors calendar call ;
+USING: arrays assocs io kernel math models namespaces make dlists
+deques sequences threads sequences words continuations init call
+combinators hashtables concurrency.flags sets accessors calendar fry
+destructors ui.gadgets ui.gadgets.private ui.gadgets.worlds
+ui.gadgets.tracks ui.gestures ui.backend ui.render ui.text
+ui.text.private ;
 IN: ui
 
+<PRIVATE
+
 ! Assoc mapping aliens to gadgets
 SYMBOL: windows
 
@@ -35,8 +38,8 @@ SYMBOL: windows
 
 : focus-gestures ( new old -- )
     drop-prefix <reversed>
-    T{ lose-focus } swap each-gesture
-    T{ gain-focus } swap each-gesture ;
+    lose-focus swap each-gesture
+    gain-focus swap each-gesture ;
 
 : focus-world ( world -- )
     t >>focused?
@@ -55,26 +58,22 @@ M: world graft*
 : reset-world ( world -- )
     #! This is used when a window is being closed, but also
     #! when restoring saved worlds on image startup.
-    [ fonts>> clear-assoc ]
-    [ unfocus-world ]
-    [ f >>handle drop ] tri ;
+    f >>handle unfocus-world ;
 
 : (ungraft-world) ( world -- )
-    [ free-fonts ]
-    [ hand-clicked close-global ]
-    [ hand-gadget close-global ] tri ;
+    {
+        [ handle>> select-gl-context ]
+        [ text-handle>> dispose ]
+        [ images>> [ dispose ] when* ]
+        [ hand-clicked close-global ]
+        [ hand-gadget close-global ]
+    } cleave ;
 
 M: world ungraft*
     [ (ungraft-world) ]
     [ handle>> (close-window) ]
     [ reset-world ] tri ;
 
-: find-window ( quot -- world )
-    windows get values
-    [ gadget-child swap call ] with find-last nip ; inline
-
-SYMBOL: ui-hook
-
 : init-ui ( -- )
     <dlist> \ graft-queue set-global
     <dlist> \ layout-queue set-global
@@ -94,15 +93,12 @@ SYMBOL: ui-hook
     children>> [ restore-gadget ] each ;
 
 : restore-world ( world -- )
-    dup reset-world restore-gadget ;
-
-: restore-windows ( -- )
-    windows get [ values ] keep delete-all
-    [ restore-world ] each
-    forget-rollover ;
-
-: restore-windows? ( -- ? )
-    windows get empty? not ;
+    {
+        [ reset-world ]
+        [ init-text-rendering ]
+        [ f >>images drop ]
+        [ restore-gadget ]
+    } cleave ;
 
 : update-hand ( world -- )
     dup hand-world get-global eq?
@@ -119,28 +115,15 @@ SYMBOL: ui-hook
 : redraw-worlds ( seq -- )
     [ dup update-hand draw-world ] each ;
 
-: notify ( gadget -- )
-    dup graft-state>>
-    [ first { f f } { t t } ? >>graft-state ] keep
-    {
-        { { f t } [ dup activate-control graft* ] }
-        { { t f } [ dup deactivate-control ungraft* ] }
-    } case ;
-
-: notify-queued ( -- )
-    graft-queue [ notify ] slurp-deque ;
-
 : send-queued-gestures ( -- )
     gesture-queue [ send-queued-gesture notify-queued ] slurp-deque ;
 
 : update-ui ( -- )
     [
-        [
-            notify-queued
-            layout-queued
-            redraw-worlds
-            send-queued-gestures
-        ] call( -- )
+        notify-queued
+        layout-queued
+        redraw-worlds
+        send-queued-gestures
     ] [ ui-error ] recover ;
 
 SYMBOL: ui-thread
@@ -149,9 +132,17 @@ SYMBOL: ui-thread
     t \ ui-running set-global
     [ f \ ui-running set-global ] [ ] cleanup ; inline
 
+PRIVATE>
+
+: find-window ( quot -- world )
+    windows get values
+    [ gadget-child swap call ] with find-last nip ; inline
+
 : ui-running? ( -- ? )
     \ ui-running get-global ;
 
+<PRIVATE
+
 : update-ui-loop ( -- )
     [ ui-running? ui-thread get-global self eq? and ]
     [ ui-notify-flag get lower-flag update-ui ]
@@ -161,6 +152,21 @@ SYMBOL: ui-thread
     [ self ui-thread set-global update-ui-loop ]
     "UI update" spawn drop ;
 
+: start-ui ( quot -- )
+    call notify-ui-thread start-ui-thread ;
+
+: restore-windows ( -- )
+    [
+        windows get [ values ] [ delete-all ] bi
+        [ restore-world ] each
+        forget-rollover
+    ] (with-ui) ;
+
+: restore-windows? ( -- ? )
+    windows get empty? not ;
+
+PRIVATE>
+
 : open-world-window ( world -- )
     dup pref-dim >>dim dup relayout graft ;
 
@@ -181,30 +187,12 @@ HOOK: close-window ui-backend ( gadget -- )
 M: object close-window
     find-world [ ungraft ] when* ;
 
-: start-ui ( -- )
-    restore-windows? [
-        restore-windows
-    ] [
-        init-ui ui-hook get call
-    ] if
-    notify-ui-thread start-ui-thread ;
-
 [
     f \ ui-running set-global
     <flag> ui-notify-flag set-global
 ] "ui" add-init-hook
 
-HOOK: ui ui-backend ( -- )
-
-MAIN: ui
-
 : with-ui ( quot -- )
-    ui-running? [
-        call
-    ] [
-        f windows set-global
-        [
-            ui-hook set
-            ui
-        ] with-scope
-    ] if ;
+    ui-running? [ call ] [ '[ init-ui @ ] (with-ui) ] if ;
+
+HOOK: beep ui-backend ( -- )
\ No newline at end of file
diff --git a/basis/ui/windows/authors.txt b/basis/ui/windows/authors.txt
deleted file mode 100755 (executable)
index 7c1b2f2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Doug Coleman
diff --git a/basis/ui/windows/tags.txt b/basis/ui/windows/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
diff --git a/basis/ui/windows/windows.factor b/basis/ui/windows/windows.factor
deleted file mode 100755 (executable)
index 3b4bcd6..0000000
+++ /dev/null
@@ -1,585 +0,0 @@
-! Copyright (C) 2005, 2006 Doug Coleman.
-! Portions copyright (C) 2007, 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types alien.strings arrays assocs ui
-ui.gadgets ui.backend ui.clipboards ui.gadgets.worlds
-ui.gestures ui.event-loop io kernel math math.vectors namespaces
-make sequences strings vectors words windows.kernel32
-windows.gdi32 windows.user32 windows.opengl32 windows.messages
-windows.types windows.nt windows threads libc combinators fry
-combinators.short-circuit continuations command-line shuffle
-opengl ui.render ascii math.bitwise locals accessors
-math.geometry.rect math.order ascii calendar io.encodings.utf16n
-;
-IN: ui.windows
-
-SINGLETON: windows-ui-backend
-
-: crlf>lf ( str -- str' )
-    CHAR: \r swap remove ;
-
-: lf>crlf ( str -- str' )
-    [ [ dup CHAR: \n = [ CHAR: \r , ] when , ] each ] "" make ;
-
-: enum-clipboard ( -- seq )
-    0 [ EnumClipboardFormats win32-error dup dup 0 > ] [ ] produce 2nip ;
-
-: with-clipboard ( quot -- )
-    f OpenClipboard win32-error=0/f
-    call
-    CloseClipboard win32-error=0/f ; inline
-
-: paste ( -- str )
-    [
-        CF_UNICODETEXT IsClipboardFormatAvailable zero? [
-            ! nothing to paste
-            ""
-        ] [
-            CF_UNICODETEXT GetClipboardData dup win32-error=0/f
-            dup GlobalLock dup win32-error=0/f
-            GlobalUnlock win32-error=0/f
-            utf16n alien>string
-        ] if
-    ] with-clipboard
-    crlf>lf ;
-
-: copy ( str -- )
-    lf>crlf [
-        utf16n string>alien
-        EmptyClipboard win32-error=0/f
-        GMEM_MOVEABLE over length 1+ GlobalAlloc
-            dup win32-error=0/f
-    
-        dup GlobalLock dup win32-error=0/f
-        swapd byte-array>memory
-        dup GlobalUnlock win32-error=0/f
-        CF_UNICODETEXT swap SetClipboardData win32-error=0/f
-    ] with-clipboard ;
-
-TUPLE: pasteboard ;
-C: <pasteboard> pasteboard
-
-M: pasteboard clipboard-contents drop paste ;
-M: pasteboard set-clipboard-contents drop copy ;
-
-: init-clipboard ( -- )
-    <pasteboard> clipboard set-global
-    <clipboard> selection set-global ;
-
-TUPLE: win-base hDC hRC ;
-TUPLE: win < win-base hWnd world title ;
-TUPLE: win-offscreen < win-base hBitmap bits ;
-C: <win> win
-C: <win-offscreen> win-offscreen
-
-SYMBOLS: msg-obj class-name-ptr mouse-captured ;
-
-: style ( -- n ) WS_OVERLAPPEDWINDOW ; inline
-: ex-style ( -- n ) WS_EX_APPWINDOW WS_EX_WINDOWEDGE bitor ; inline
-
-: get-RECT-top-left ( RECT -- x y )
-    [ RECT-left ] keep RECT-top ;
-
-: get-RECT-dimensions ( RECT -- x y width height )
-    [ get-RECT-top-left ] keep
-    [ RECT-right ] keep [ RECT-left - ] keep
-    [ RECT-bottom ] keep RECT-top - ;
-
-: handle-wm-paint ( hWnd uMsg wParam lParam -- )
-    #! wParam and lParam are unused
-    #! only paint if width/height both > 0
-    3drop window relayout-1 yield ;
-
-: handle-wm-size ( hWnd uMsg wParam lParam -- )
-    2nip
-    [ lo-word ] keep hi-word 2array
-    dup { 0 0 } = [ 2drop ] [ swap window (>>dim) ] if ;
-
-: handle-wm-move ( hWnd uMsg wParam lParam -- )
-    2nip
-    [ lo-word ] keep hi-word 2array
-    swap window (>>window-loc) ;
-
-CONSTANT: wm-keydown-codes
-    H{
-        { 8 "BACKSPACE" }
-        { 9 "TAB" }
-        { 13 "RET" }
-        { 27 "ESC" }
-        { 33 "PAGE_UP" }
-        { 34 "PAGE_DOWN" }
-        { 35 "END" }
-        { 36 "HOME" }
-        { 37 "LEFT" }
-        { 38 "UP" }
-        { 39 "RIGHT" }
-        { 40 "DOWN" }
-        { 45 "INSERT" }
-        { 46 "DELETE" }
-        { 112 "F1" }
-        { 113 "F2" }
-        { 114 "F3" }
-        { 115 "F4" }
-        { 116 "F5" }
-        { 117 "F6" }
-        { 118 "F7" }
-        { 119 "F8" }
-        { 120 "F9" }
-        { 121 "F10" }
-        { 122 "F11" }
-        { 123 "F12" }
-    }
-
-: key-state-down? ( key -- ? )
-    GetKeyState 16 bit? ;
-
-: left-shift? ( -- ? ) VK_LSHIFT key-state-down? ;
-: left-ctrl? ( -- ? ) VK_LCONTROL key-state-down? ;
-: left-alt? ( -- ? ) VK_LMENU key-state-down? ;
-: right-shift? ( -- ? ) VK_RSHIFT key-state-down? ;
-: right-ctrl? ( -- ? ) VK_RCONTROL key-state-down? ;
-: right-alt? ( -- ? ) VK_RMENU key-state-down? ;
-: shift? ( -- ? ) left-shift? right-shift? or ;
-: ctrl? ( -- ? ) left-ctrl? right-ctrl? or ;
-: alt? ( -- ? ) left-alt? right-alt? or ;
-: caps-lock? ( -- ? ) VK_CAPITAL GetKeyState zero? not ;
-
-: key-modifiers ( -- seq )
-    [
-        shift? [ S+ , ] when
-        ctrl? [ C+ , ] when
-        alt? [ A+ , ] when
-    ] { } make [ empty? not ] keep f ? ;
-
-CONSTANT: exclude-keys-wm-keydown
-    H{
-        { 16 "SHIFT" }
-        { 17 "CTRL" }
-        { 18 "ALT" }
-        { 20 "CAPS-LOCK" }
-    }
-
-! Values are ignored
-CONSTANT: exclude-keys-wm-char
-    H{
-        { 8 "BACKSPACE" }
-        { 9 "TAB" }
-        { 13 "RET" }
-        { 27 "ESC" }
-    }
-
-: exclude-key-wm-keydown? ( n -- ? )
-    exclude-keys-wm-keydown key? ;
-
-: exclude-key-wm-char? ( n -- ? )
-    exclude-keys-wm-char key? ;
-
-: keystroke>gesture ( n -- mods sym )
-    wm-keydown-codes at* [ key-modifiers swap ] [ drop f f ] if ;
-
-: send-key-gesture ( sym action? quot hWnd -- )
-    [ [ key-modifiers ] 3dip call ] dip
-    window propagate-key-gesture ; inline
-
-: send-key-down ( sym action? hWnd -- )
-    [ [ <key-down> ] ] dip send-key-gesture ;
-
-: send-key-up ( sym action? hWnd -- )
-    [ [ <key-up> ] ] dip send-key-gesture ;
-
-: key-sym ( wParam -- string/f action? )
-    {
-        {
-            [ dup LETTER? ]
-            [ shift? caps-lock? xor [ CHAR: a + CHAR: A - ] unless 1string f ]
-        }
-        { [ dup digit? ] [ 1string f ] }
-        [ wm-keydown-codes at t ]
-    } cond ;
-
-:: handle-wm-keydown ( hWnd uMsg wParam lParam -- )
-    wParam exclude-key-wm-keydown? [
-        wParam key-sym over [
-            dup ctrl? alt? xor or [
-                hWnd send-key-down
-            ] [ 2drop ] if
-        ] [ 2drop ] if
-    ] unless ;
-
-:: handle-wm-char ( hWnd uMsg wParam lParam -- )
-    wParam exclude-key-wm-char? [
-        ctrl? alt? xor [
-            wParam 1string
-            [ f hWnd send-key-down ]
-            [ hWnd window user-input ] bi
-        ] unless
-    ] unless ;
-
-:: handle-wm-keyup ( hWnd uMsg wParam lParam -- )
-    wParam exclude-key-wm-keydown? [
-        wParam key-sym over [
-            hWnd send-key-up
-        ] [ 2drop ] if
-    ] unless ;
-
-:: set-window-active ( hwnd uMsg wParam lParam ? -- n )
-    ? hwnd window (>>active?)
-    hwnd uMsg wParam lParam DefWindowProc ;
-
-: handle-wm-syscommand ( hWnd uMsg wParam lParam -- n )
-    {
-        { [ over SC_MINIMIZE = ] [ f set-window-active ] }
-        { [ over SC_RESTORE = ] [ t set-window-active ] }
-        { [ over SC_MAXIMIZE = ] [ t set-window-active ] }
-        { [ dup alpha? ] [ 4drop 0 ] }
-        { [ t ] [ DefWindowProc ] }
-    } cond ;
-
-: cleanup-window ( handle -- )
-    dup title>> [ free ] when*
-    dup hRC>> wglDeleteContext win32-error=0/f
-    dup hWnd>> swap hDC>> ReleaseDC win32-error=0/f ;
-
-M: windows-ui-backend (close-window)
-    dup hWnd>> unregister-window
-    dup cleanup-window
-    hWnd>> DestroyWindow win32-error=0/f ;
-
-: handle-wm-close ( hWnd uMsg wParam lParam -- )
-    3drop window ungraft ;
-
-: handle-wm-set-focus ( hWnd uMsg wParam lParam -- )
-    3drop window [ focus-world ] when* ;
-
-: handle-wm-kill-focus ( hWnd uMsg wParam lParam -- )
-    3drop window [ unfocus-world ] when* ;
-
-: message>button ( uMsg -- button down? )
-    {
-        { WM_LBUTTONDOWN   [ 1 t ] }
-        { WM_LBUTTONUP     [ 1 f ] }
-        { WM_MBUTTONDOWN   [ 2 t ] }
-        { WM_MBUTTONUP     [ 2 f ] }
-        { WM_RBUTTONDOWN   [ 3 t ] }
-        { WM_RBUTTONUP     [ 3 f ] }
-
-        { WM_NCLBUTTONDOWN [ 1 t ] }
-        { WM_NCLBUTTONUP   [ 1 f ] }
-        { WM_NCMBUTTONDOWN [ 2 t ] }
-        { WM_NCMBUTTONUP   [ 2 f ] }
-        { WM_NCRBUTTONDOWN [ 3 t ] }
-        { WM_NCRBUTTONUP   [ 3 f ] }
-    } case ;
-
-! If the user clicks in the window border ("non-client area")
-! Windows sends us an NC[LMR]BUTTONDOWN message; but if the
-! mouse is subsequently released outside the NC area, we receive
-! a [LMR]BUTTONUP message and Factor can get confused. So we
-! ignore BUTTONUP's that are a result of an NC*BUTTONDOWN.
-SYMBOL: nc-buttons
-
-: handle-wm-ncbutton ( hWnd uMsg wParam lParam -- )
-    2drop nip
-    message>button nc-buttons get
-    swap [ push ] [ delete ] if ;
-
-: >lo-hi ( WORD -- array ) [ lo-word ] [ hi-word ] bi 2array ;
-
-: mouse-wheel ( wParam -- array ) >lo-hi [ sgn neg ] map ;
-
-: mouse-event>gesture ( uMsg -- button )
-    key-modifiers swap message>button
-    [ <button-down> ] [ <button-up> ] if ;
-
-:: prepare-mouse ( hWnd uMsg wParam lParam -- button coordinate world )
-    uMsg mouse-event>gesture
-    lParam >lo-hi
-    hWnd window ;
-
-: set-capture ( hwnd -- )
-    mouse-captured get [
-        drop
-    ] [
-        [ SetCapture drop ] keep
-        mouse-captured set
-    ] if ;
-
-: release-capture ( -- )
-    ReleaseCapture win32-error=0/f
-    mouse-captured off ;
-
-: handle-wm-buttondown ( hWnd uMsg wParam lParam -- )
-    [
-        over set-capture
-        dup message>button drop nc-buttons get delete
-    ] 2dip prepare-mouse send-button-down ;
-
-: handle-wm-buttonup ( hWnd uMsg wParam lParam -- )
-    mouse-captured get [ release-capture ] when
-    pick message>button drop dup nc-buttons get member? [
-        nc-buttons get delete 4drop
-    ] [
-        drop prepare-mouse send-button-up
-    ] if ;
-
-: make-TRACKMOUSEEVENT ( hWnd -- alien )
-    "TRACKMOUSEEVENT" <c-object> [ set-TRACKMOUSEEVENT-hwndTrack ] keep
-    "TRACKMOUSEEVENT" heap-size over set-TRACKMOUSEEVENT-cbSize ;
-
-: handle-wm-mousemove ( hWnd uMsg wParam lParam -- )
-    2nip
-    over make-TRACKMOUSEEVENT
-    TME_LEAVE over set-TRACKMOUSEEVENT-dwFlags
-    0 over set-TRACKMOUSEEVENT-dwHoverTime
-    TrackMouseEvent drop
-    >lo-hi swap window move-hand fire-motion ;
-
-:: handle-wm-mousewheel ( hWnd uMsg wParam lParam -- )
-    wParam mouse-wheel hand-loc get hWnd window send-wheel ;
-
-: handle-wm-cancelmode ( hWnd uMsg wParam lParam -- )
-    #! message sent if windows needs application to stop dragging
-    4drop release-capture ;
-
-: handle-wm-mouseleave ( hWnd uMsg wParam lParam -- )
-    #! message sent if mouse leaves main application 
-    4drop forget-rollover ;
-
-SYMBOL: wm-handlers
-
-H{ } clone wm-handlers set-global
-
-: add-wm-handler ( quot wm -- )
-    dup array?
-    [ [ execute add-wm-handler ] with each ]
-    [ wm-handlers get-global set-at ] if ;
-
-[ handle-wm-close 0                  ] WM_CLOSE add-wm-handler
-[ 4dup handle-wm-paint DefWindowProc ] WM_PAINT add-wm-handler
-
-[ handle-wm-size 0 ] WM_SIZE add-wm-handler
-[ handle-wm-move 0 ] WM_MOVE add-wm-handler
-
-[ 4dup handle-wm-keydown DefWindowProc ] { WM_KEYDOWN WM_SYSKEYDOWN } add-wm-handler
-[ 4dup handle-wm-char DefWindowProc    ] { WM_CHAR WM_SYSCHAR }       add-wm-handler
-[ 4dup handle-wm-keyup DefWindowProc   ] { WM_KEYUP WM_SYSKEYUP }     add-wm-handler
-
-[ handle-wm-syscommand   ] WM_SYSCOMMAND add-wm-handler
-[ handle-wm-set-focus 0  ] WM_SETFOCUS add-wm-handler
-[ handle-wm-kill-focus 0 ] WM_KILLFOCUS add-wm-handler
-
-[ handle-wm-buttondown 0 ] WM_LBUTTONDOWN add-wm-handler
-[ handle-wm-buttondown 0 ] WM_MBUTTONDOWN add-wm-handler
-[ handle-wm-buttondown 0 ] WM_RBUTTONDOWN add-wm-handler
-[ handle-wm-buttonup 0   ] WM_LBUTTONUP   add-wm-handler
-[ handle-wm-buttonup 0   ] WM_MBUTTONUP   add-wm-handler
-[ handle-wm-buttonup 0   ] WM_RBUTTONUP   add-wm-handler
-
-[ 4dup handle-wm-ncbutton DefWindowProc ]
-{ WM_NCLBUTTONDOWN WM_NCMBUTTONDOWN WM_NCRBUTTONDOWN
-WM_NCLBUTTONUP WM_NCMBUTTONUP WM_NCRBUTTONUP }
-add-wm-handler
-
-[ nc-buttons get-global delete-all DefWindowProc ]
-{ WM_EXITSIZEMOVE WM_EXITMENULOOP } add-wm-handler
-
-[ handle-wm-mousemove 0  ] WM_MOUSEMOVE  add-wm-handler
-[ handle-wm-mousewheel 0 ] WM_MOUSEWHEEL add-wm-handler
-[ handle-wm-cancelmode 0 ] WM_CANCELMODE add-wm-handler
-[ handle-wm-mouseleave 0 ] WM_MOUSELEAVE add-wm-handler
-
-SYMBOL: trace-messages?
-
-! return 0 if you handle the message, else just let DefWindowProc return its val
-: ui-wndproc ( -- object )
-    "uint" { "void*" "uint" "long" "long" } "stdcall" [
-        pick
-        trace-messages? get-global [ dup windows-message-name name>> print flush ] when
-        wm-handlers get-global at* [ call ] [ drop DefWindowProc ] if
-     ] alien-callback ;
-
-: peek-message? ( msg -- ? ) f 0 0 PM_REMOVE PeekMessage zero? ;
-
-M: windows-ui-backend do-events
-    msg-obj get-global
-    dup peek-message? [ drop ui-wait ] [
-        [ TranslateMessage drop ]
-        [ DispatchMessage drop ] bi
-    ] if ;
-
-: register-wndclassex ( -- class )
-    "WNDCLASSEX" <c-object>
-    f GetModuleHandle
-    class-name-ptr get-global
-    pick GetClassInfoEx zero? [
-        "WNDCLASSEX" heap-size over set-WNDCLASSEX-cbSize
-        { CS_HREDRAW CS_VREDRAW CS_OWNDC } flags over set-WNDCLASSEX-style
-        ui-wndproc over set-WNDCLASSEX-lpfnWndProc
-        0 over set-WNDCLASSEX-cbClsExtra
-        0 over set-WNDCLASSEX-cbWndExtra
-        f GetModuleHandle over set-WNDCLASSEX-hInstance
-        f GetModuleHandle "fraptor" utf16n string>alien LoadIcon
-        over set-WNDCLASSEX-hIcon
-        f IDC_ARROW LoadCursor over set-WNDCLASSEX-hCursor
-
-        class-name-ptr get-global over set-WNDCLASSEX-lpszClassName
-        RegisterClassEx dup win32-error=0/f
-    ] when ;
-
-: adjust-RECT ( RECT -- )
-    style 0 ex-style AdjustWindowRectEx win32-error=0/f ;
-
-: make-RECT ( world -- RECT )
-    [ window-loc>> dup ] [ rect-dim ] bi v+
-    "RECT" <c-object>
-    over first over set-RECT-right
-    swap second over set-RECT-bottom
-    over first over set-RECT-left
-    swap second over set-RECT-top ;
-
-: default-position-RECT ( RECT -- )
-    dup get-RECT-dimensions [ 2drop ] 2dip
-    CW_USEDEFAULT + pick set-RECT-bottom
-    CW_USEDEFAULT + over set-RECT-right
-    CW_USEDEFAULT over set-RECT-left
-    CW_USEDEFAULT swap set-RECT-top ;
-
-: make-adjusted-RECT ( rect -- RECT )
-    make-RECT
-    dup get-RECT-top-left [ zero? ] both? swap
-    dup adjust-RECT
-    swap [ dup default-position-RECT ] when ;
-
-: create-window ( rect -- hwnd )
-    make-adjusted-RECT
-    [ class-name-ptr get-global f ] dip
-    [
-        [ ex-style ] 2dip
-        { WS_CLIPSIBLINGS WS_CLIPCHILDREN style } flags
-    ] dip get-RECT-dimensions
-    f f f GetModuleHandle f CreateWindowEx dup win32-error=0/f ;
-
-: show-window ( hWnd -- )
-    dup SW_SHOW ShowWindow drop ! always succeeds
-    dup SetForegroundWindow drop
-    SetFocus drop ;
-
-: init-win32-ui ( -- )
-    V{ } clone nc-buttons set-global
-    "MSG" malloc-object msg-obj set-global
-    "Factor-window" utf16n malloc-string class-name-ptr set-global
-    register-wndclassex drop
-    GetDoubleClickTime milliseconds double-click-timeout set-global ;
-
-: cleanup-win32-ui ( -- )
-    class-name-ptr get-global [ dup f UnregisterClass drop free ] when*
-    msg-obj get-global [ free ] when*
-    f class-name-ptr set-global
-    f msg-obj set-global ;
-
-: setup-pixel-format ( hdc flags -- )
-    32 make-pfd [ ChoosePixelFormat dup win32-error=0/f ] 2keep
-    swapd SetPixelFormat win32-error=0/f ;
-
-: get-dc ( hWnd -- hDC ) GetDC dup win32-error=0/f ;
-
-: get-rc ( hDC -- hRC )
-    dup wglCreateContext dup win32-error=0/f
-    [ wglMakeCurrent win32-error=0/f ] keep ;
-
-: setup-gl ( hwnd -- hDC hRC )
-    get-dc dup windowed-pfd-dwFlags setup-pixel-format dup get-rc ;
-
-M: windows-ui-backend (open-window) ( world -- )
-    [ create-window [ setup-gl ] keep ] keep
-    [ f <win> ] keep
-    [ swap hWnd>> register-window ] 2keep
-    dupd (>>handle)
-    hWnd>> show-window ;
-
-M: win-base select-gl-context ( handle -- )
-    [ hDC>> ] keep hRC>> wglMakeCurrent win32-error=0/f
-    GdiFlush drop ;
-
-M: win-base flush-gl-context ( handle -- )
-    hDC>> SwapBuffers win32-error=0/f ;
-
-: (bitmap-info) ( dim -- BITMAPINFO )
-    "BITMAPINFO" <c-object> [
-        BITMAPINFO-bmiHeader {
-            [ nip "BITMAPINFOHEADER" heap-size swap set-BITMAPINFOHEADER-biSize ]
-            [ [ first ] dip set-BITMAPINFOHEADER-biWidth ]
-            [ [ second ] dip set-BITMAPINFOHEADER-biHeight ]
-            [ nip 1 swap set-BITMAPINFOHEADER-biPlanes ]
-            [ nip 32 swap set-BITMAPINFOHEADER-biBitCount ]
-            [ nip BI_RGB swap set-BITMAPINFOHEADER-biCompression ]
-            [ [ first2 * 4 * ] dip set-BITMAPINFOHEADER-biSizeImage ]
-            [ nip 72 swap set-BITMAPINFOHEADER-biXPelsPerMeter ]
-            [ nip 72 swap set-BITMAPINFOHEADER-biYPelsPerMeter ]
-            [ nip 0 swap set-BITMAPINFOHEADER-biClrUsed ]
-            [ nip 0 swap set-BITMAPINFOHEADER-biClrImportant ]
-        } 2cleave
-    ] keep ;
-
-: make-offscreen-dc-and-bitmap ( dim -- hDC hBitmap bits )
-    f CreateCompatibleDC
-    dup rot (bitmap-info) DIB_RGB_COLORS f <void*>
-    [ f 0 CreateDIBSection ] keep *void*
-    [ 2dup SelectObject drop ] dip ;
-
-: setup-offscreen-gl ( dim -- hDC hRC hBitmap bits )
-    make-offscreen-dc-and-bitmap [
-        [ dup offscreen-pfd-dwFlags setup-pixel-format ]
-        [ get-rc ] bi
-    ] 2dip ;
-
-M: windows-ui-backend (open-offscreen-buffer) ( world -- )
-    dup dim>> setup-offscreen-gl <win-offscreen>
-    >>handle drop ;
-M: windows-ui-backend (close-offscreen-buffer) ( handle -- )
-    [ hDC>> DeleteDC drop ]
-    [ hBitmap>> DeleteObject drop ] bi ;
-
-! Windows 32-bit bitmaps don't actually use the alpha byte of
-! each pixel; it's left as zero
-
-: (make-opaque) ( byte-array -- byte-array' )
-    [ length 4 / ]
-    [ '[ 255 swap 4 * 3 + _ set-nth ] each ]
-    [ ] tri ;
-
-: (opaque-pixels) ( world -- pixels )
-    [ handle>> bits>> ] [ dim>> first2 * 4 * ] bi
-    memory>byte-array (make-opaque) ;
-
-M: windows-ui-backend offscreen-pixels ( world -- alien w h )
-    [ (opaque-pixels) ] [ dim>> first2 ] bi ;
-
-M: windows-ui-backend raise-window* ( world -- )
-    handle>> [
-        hWnd>> SetFocus drop
-    ] when* ;
-
-M: windows-ui-backend set-title ( string world -- )
-    handle>>
-    dup title>> [ free ] when*
-    [ utf16n malloc-string ] dip
-    2dup (>>title)
-    hWnd>> WM_SETTEXT 0 roll alien-address SendMessage drop ;
-
-M: windows-ui-backend ui
-    [
-        [
-            init-clipboard
-            init-win32-ui
-            start-ui
-            event-loop
-        ] [ cleanup-win32-ui ] [ ] cleanup
-    ] ui-running ;
-
-M: windows-ui-backend beep ( -- )
-    0 MessageBeep drop ;
-
-windows-ui-backend ui-backend set-global
-
-[ "ui" ] main-vocab-hook set-global
diff --git a/basis/ui/x11/authors.txt b/basis/ui/x11/authors.txt
deleted file mode 100755 (executable)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/ui/x11/tags.txt b/basis/ui/x11/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable
index 892379dc899adcbbf8a8431111287350ddb53d42..602d9555ea64c26d775f0057cd8b3140b0f1c43f 100644 (file)
@@ -151,8 +151,8 @@ TUPLE: compose-state i str char after last-class ;
 
 DEFER: compose-iter
 
-: try-noncombining ( char state -- state )
-    tuck char>> swap combine-chars
+: try-noncombining ( state char -- state )
+    [ drop ] [ [ char>> ] dip combine-chars ] 2bi
     [ >>char to f >>last-class compose-iter ] when* ; inline
 
 : compose-iter ( state -- state )
@@ -161,7 +161,7 @@ DEFER: compose-iter
             { f [ drop ] }
             { 0 [
                 over last-class>>
-                [ drop ] [ swap try-noncombining ] if ] }
+                [ drop ] [ try-noncombining ] if ] }
             [ try-compose to compose-iter ]
         } case
     ] when* ; inline recursive
index eaf8056c451028ec1da1c46fde4a038519239c28..f0ee13dd382c205cd55806fc3097a290463cc5ee 100644 (file)
@@ -54,12 +54,12 @@ IN: validators
     ] if ;
 
 : v-regexp ( str what regexp -- str )
-    [ over ] dip matches?
-    [ drop ] [ "invalid " prepend throw ] if ;
+    3dup nip matches?
+    [ 2drop ] [ drop "invalid " prepend throw ] if ;
 
 : v-email ( str -- str )
     #! From http://www.regular-expressions.info/email.html
-    60 v-max-length
+    320 v-max-length
     "e-mail"
     R' [A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}'i
     v-regexp ;
index 0e1a907ca76d0da1038738f74435ddbef1f57f37..af828c9145c61f00dc6b72eba13d0148e3226d0c 100644 (file)
@@ -1,6 +1,6 @@
-USING: alien alien.c-types windows.com.syntax windows.ole32\r
-windows.types continuations kernel alien.syntax libc\r
-destructors accessors ;\r
+USING: alien alien.c-types alien.destructors windows.com.syntax\r
+windows.ole32 windows.types continuations kernel alien.syntax\r
+libc destructors accessors ;\r
 IN: windows.com\r
 \r
 LIBRARY: ole32\r
@@ -42,10 +42,4 @@ COM-INTERFACE: IDropTarget IUnknown {00000122-0000-0000-C000-000000000046}
 : with-com-interface ( interface quot -- )\r
     over [ slip ] [ com-release ] [ ] cleanup ; inline\r
 \r
-TUPLE: com-destructor interface disposed ;\r
-M: com-destructor dispose* interface>> com-release ;\r
-\r
-: &com-release ( interface -- interface )\r
-    dup f com-destructor boa &dispose drop ;\r
-: |com-release ( interface -- interface )\r
-    dup f com-destructor boa |dispose drop ;\r
+DESTRUCTOR: com-release\r
index c86cde23d9afcb9b65ad5d77716e8311f8953794..a014a56ea03219afd101af339f8b9536aa767bb5 100755 (executable)
@@ -87,9 +87,9 @@ unless
     if ;
 
 : (thunked-quots) ( quots iunknown-methods thunk -- {thunk,quot}s )
-    [ '[ _ '[ @ com-unwrap ] [ swap 2array ] curry map ] ]
-    [ '[ _                   [ swap 2array ] curry map ] ] bi bi*
-    swap append ;
+    [ '[ @ com-unwrap ] [ swap 2array ] curry map ]
+    [                   [ swap 2array ] curry map ] bi-curry bi*
+    prepend ;
 
 : compile-alien-callback ( word return parameters abi quot -- word )
     '[ _ _ _ _ alien-callback ]
index be9f8cf7a9769491b91a5849cc4119ae2548e4c6..9619ae0bee3f1e252a04f94a81fa8bd3256947a0 100644 (file)
@@ -42,9 +42,11 @@ IN: x11.windows
 : auto-position ( window loc -- )
     { 0 0 } = [ drop ] [ set-size-hints ] if ;
 
+: >xy ( pair -- x y ) first2 [ >integer ] bi@ ;
+
 : create-window ( loc dim visinfo -- window )
     pick [
-        [ [ [ dpy get root get ] dip first2 ] dip { 1 1 } vmax first2 0 ] dip
+        [ [ [ dpy get root get ] dip >xy ] dip { 1 1 } vmax >xy 0 ] dip
         [ XVisualInfo-depth InputOutput ] keep
         [ XVisualInfo-visual create-window-mask ] keep
         window-attributes XCreateWindow
index 2ab9ff98dd7b8ff0e2abbdeca263c0df9d703544..532c1db29f4e3bf44fbc2c4c3daf6a63baa5dcc5 100644 (file)
@@ -26,8 +26,7 @@ MACRO: drop-input ( quot -- newquot )
     infer in>> '[ _ ndrop ] ;
 
 : fails? ( quot -- ? )
-    [ '[ _ drop-output f ] ]
-    [ '[ drop _ drop-input t ] ] bi recover ; inline
+    [ drop-output f ] [ nip drop-input t ] bi-curry recover ; inline
 
 : well-formed? ( uri -- answer )
     [ file>xml ] fails? "not-wf" "valid" ? ;
index 23fb7a50749870709603ca0ad7d53c745cf72496..421c2a2b5db7fc7c705dbec8f487a03b4fad4a77 100644 (file)
@@ -15,10 +15,10 @@ IN: xml.writer.tests
 [ "ns:foo" ] [ T{ name { space "ns" } { main "foo" } } name>string ] unit-test
 
 : reprints-as ( to from -- )
-     [ '[ _ ] ] [ '[ _ string>xml xml>string ] ] bi* unit-test ;
+     [ ] [ string>xml xml>string ] bi-curry* unit-test ;
 
 : pprint-reprints-as ( to from -- )
-     [ '[ _ ] ] [ '[ _ string>xml pprint-xml>string ] ] bi* unit-test ;
+     [ ] [ string>xml pprint-xml>string ] bi-curry* unit-test ;
 
 : reprints-same ( string -- ) dup reprints-as ;
 
index 5a880fa5a96d0fec125f4ca9b6e1c94aefb94f77..e4063b733cdd61b6fe42d968ad44f0a3f526e540 100644 (file)
@@ -74,3 +74,15 @@ cell 8 = [
 [ f ] [ DLL" fadfasdfsada" dll-valid? ] unit-test
 
 [ f ] [ "does not exist" DLL" fadsfasfdsaf" dlsym ] unit-test
+
+SYMBOL: initialize-test
+
+f initialize-test set-global
+
+[ 31337 ] [ initialize-test [ 31337 ] initialize-alien ] unit-test
+
+[ 31337 ] [ initialize-test [ 69 ] initialize-alien ] unit-test
+
+[ ] [ initialize-test get BAD-ALIEN >>alien drop ] unit-test
+
+[ 7575 ] [ initialize-test [ 7575 ] initialize-alien ] unit-test
\ No newline at end of file
index 52e9cd0f30a8980edebe19e70920d4e53db585fd..83665778f1aa416d2d02d8788b634bd9b4936555 100644 (file)
@@ -86,3 +86,17 @@ ERROR: alien-invoke-error library symbol ;
 SYMBOL: callbacks
 
 [ H{ } clone callbacks set-global ] "alien" add-init-hook
+
+<PRIVATE
+
+TUPLE: expiry-check object alien ;
+
+: recompute-value? ( check -- ? )
+    dup [ alien>> expired? ] [ drop t ] if ;
+
+PRIVATE>
+
+: initialize-alien ( symbol quot -- )
+    swap dup get-global dup recompute-value?
+    [ drop [ call dup 31337 <alien> expiry-check boa ] dip set-global ]
+    [ 2nip object>> ] if ; inline
\ No newline at end of file
index fdaa02e6c42cd4e8815cdc3181271f0de49f63d3..c4deddae3949d97fa1104782cfba7d4e25fe1cde 100755 (executable)
@@ -71,7 +71,7 @@ PRIVATE>
 
 : assoc-partition ( assoc quot -- true-assoc false-assoc )
     [ (assoc-each) partition ] [ drop ] 2bi
-    tuck [ assoc-like ] 2bi@ ; inline
+    [ assoc-like ] curry bi@ ; inline
 
 : assoc-any? ( assoc quot -- ? )
     assoc-find 2nip ; inline
index f5dbe6242ab954c4f023278871f984b737e5ac39..b13bc1bfa256ae5d6accb74c37bce36bf70ad281 100755 (executable)
@@ -251,9 +251,9 @@ M: tuple-class update-class
     3bi ;
 
 : tuple-class-unchanged? ( class superclass slots -- ? )
-    [ over ] dip
     [ [ superclass ] [ bootstrap-word ] bi* = ]
-    [ [ "slots" word-prop ] dip = ] 2bi* and ;
+    [ [ "slots" word-prop ] dip = ]
+    bi-curry* bi and ;
 
 : valid-superclass? ( class -- ? )
     [ tuple-class? ] [ tuple eq? ] bi or ;
index 28658d67d779c62ffe47a3424735721f3db3b523..d5bd0da663b5b2e581657f0e632c914f5413583b 100644 (file)
@@ -4,7 +4,7 @@ kernel.private accessors eval ;
 IN: continuations.tests
 
 : (callcc1-test)
-    swap 1- tuck swap ?push
+    [ 1- dup ] dip ?push
     over 0 = [ "test-cc" get continue-with ] when
     (callcc1-test) ;
 
index c592ef6c92e21e7ad03fe9d6fe015b560c2a15ee..316add54c0bf4b37912bd933becf9f77ea6f9de9 100644 (file)
@@ -9,9 +9,13 @@ USING: effects tools.test prettyprint accessors sequences ;
 [ 2 ] [ (( a b -- c )) in>> length ] unit-test
 [ 1 ] [ (( a b -- c )) out>> length ] unit-test
 
-
+[ "(( object -- object ))" ] [ { f } { f } <effect> unparse ] unit-test
 [ "(( a b -- c d ))" ] [ { "a" "b" } { "c" "d" } <effect> unparse ] unit-test
 [ "(( -- c d ))" ] [ { } { "c" "d" } <effect> unparse ] unit-test
 [ "(( a b -- ))" ] [ { "a" "b" } { } <effect> unparse ] unit-test
 [ "(( -- ))" ] [ { } { } <effect> unparse ] unit-test
 [ "(( a b -- c ))" ] [ (( a b -- c )) unparse ] unit-test
+
+[ { "x" "y" } ] [ { "y" "x" } (( a b -- b a )) shuffle ] unit-test
+[ { "y" "x" "y" } ] [ { "y" "x" } (( a b -- a b a )) shuffle ] unit-test
+[ { } ] [ { "y" "x" } (( a b -- )) shuffle ] unit-test
\ No newline at end of file
index 77afa496cc35b88a045288cfd606e9123dd9e183..d21132aebb7b9e37c7dcb5f84f535792fba000dd 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel math math.parser namespaces make sequences strings
 words assocs combinators accessors arrays ;
@@ -24,6 +24,7 @@ TUPLE: effect { in read-only } { out read-only } { terminated? read-only } ;
 
 GENERIC: effect>string ( obj -- str )
 M: string effect>string ;
+M: object effect>string drop "object" ;
 M: word effect>string name>> ;
 M: integer effect>string number>string ;
 M: pair effect>string first2 [ effect>string ] bi@ ": " glue ;
@@ -57,11 +58,8 @@ M: effect clone
 : split-shuffle ( stack shuffle -- stack1 stack2 )
     in>> length cut* ;
 
-: load-shuffle ( stack shuffle -- )
-    in>> [ set ] 2each ;
-
-: shuffled-values ( shuffle -- values )
-    out>> [ get ] map ;
+: shuffle-mapping ( effect -- mapping )
+    [ out>> ] [ in>> ] bi [ index ] curry map ;
 
 : shuffle ( stack shuffle -- newstack )
-    [ [ load-shuffle ] keep shuffled-values ] with-scope ;
+    shuffle-mapping swap nths ;
index 66f2da7191515435d9d05fd7eac3d53b06209015..738c011a48586225161e8de283fb725a885cd41c 100644 (file)
@@ -33,10 +33,11 @@ PREDICATE: math-class < class
 
 : math-upgrade ( class1 class2 -- quot )
     [ math-class-max ] 2keep
-    [ over ] dip (math-upgrade) [
+    [
         (math-upgrade)
         dup empty? [ [ dip ] curry [ ] like ] unless
-    ] dip append ;
+    ] [ (math-upgrade) ]
+    bi-curry* bi append ;
 
 ERROR: no-math-method left right generic ;
 
index f2003641de3408d9b5da2e3dda840fd15a454c5c..fabe2afb4ddf34c15b2ed46ea19915c5e34c92d0 100644 (file)
@@ -42,7 +42,7 @@ SYMBOL: previous
         2drop
     ] [
         over previous get conjoin
-        dup slip
+        [ call ] keep
         [ nip (closure) ] curry assoc-each
     ] if ; inline recursive
 
index e8735afa6aac8feb4c102d8b78f328e0c3b7e278..d8ad1274f219bd909355d6663df407ac2d83bf43 100644 (file)
@@ -61,9 +61,8 @@ M: decoder stream-read1
 : (read) ( n quot -- n string )
     over 0 <string> [
         [
-            slip over
-            [ swapd set-nth-unsafe f ] [ 3drop t ] if
-        ] 2curry find-integer
+            over [ swapd set-nth-unsafe f ] [ 3drop t ] if
+        ] curry compose find-integer
     ] keep ; inline
 
 : finish-read ( n string -- string/f )
@@ -74,7 +73,8 @@ M: decoder stream-read1
     } cond ; inline
 
 M: decoder stream-read
-    tuck >decoder< [ decode-char ] 2curry (read) finish-read fix-read ;
+    [ nip ] [ >decoder< [ decode-char ] 2curry (read) finish-read ] 2bi
+    fix-read ;
 
 M: decoder stream-read-partial stream-read ;
 
old mode 100644 (file)
new mode 100755 (executable)
index a99575b..e30e9be
@@ -22,3 +22,6 @@ IN: io.encodings.utf8.tests
 
 [ { BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 10111111 BIN: 11101111 BIN: 10000000 BIN: 10111111 BIN: 11011111 BIN: 10000000 CHAR: x } ]
 [ { BIN: 101111111000000111111 BIN: 1111000000111111 BIN: 11111000000 CHAR: x } encode-utf8-w/stream ] unit-test
+
+[ 3 ] [ 1 "日本語" >utf8-index ] unit-test
+[ 3 ] [ 9 "日本語" utf8-index> ] unit-test
old mode 100644 (file)
new mode 100755 (executable)
index 8030d62..aca36c8
@@ -1,7 +1,7 @@
 ! Copyright (C) 2006, 2008 Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: math kernel sequences sbufs vectors growable io continuations
-namespaces io.encodings combinators strings ;
+USING: math math.order kernel sequences sbufs vectors growable io
+continuations namespaces io.encodings combinators strings ;
 IN: io.encodings.utf8
 
 ! Decoding UTF-8
@@ -30,9 +30,9 @@ SINGLETON: utf8
 : begin-utf8 ( stream byte -- stream char )
     {
         { [ dup -7 shift zero? ] [ ] }
-        { [ dup -5 shift BIN: 110 number= ] [ double ] }
-        { [ dup -4 shift BIN: 1110 number= ] [ triple ] }
-        { [ dup -3 shift BIN: 11110 number= ] [ quadruple ] }
+        { [ dup -5 shift BIN: 110 = ] [ double ] }
+        { [ dup -4 shift BIN: 1110 = ] [ triple ] }
+        { [ dup -3 shift BIN: 11110 = ] [ quadruple ] }
         [ drop replacement-char ]
     } cond ; inline
 
@@ -71,3 +71,20 @@ M: utf8 encode-char
     drop swap char>utf8 ;
 
 PRIVATE>
+
+: code-point-length ( n -- x )
+    log2 {
+        { [ dup 0 7 between? ] [ 1 ] }
+        { [ dup 8 11 between? ] [ 2 ] }
+        { [ dup 12 16 between? ] [ 3 ] }
+        { [ dup 17 21 between? ] [ 4 ] }
+    } cond nip ;
+
+: code-point-offsets ( string -- indices )
+    0 [ code-point-length + ] accumulate swap suffix ;
+
+: utf8-index> ( n string -- n' )
+    code-point-offsets [ <= ] with find drop ;
+
+: >utf8-index ( n string -- n' )
+    code-point-offsets nth ;
\ No newline at end of file
index f5ad6e533b317754b6b23b2b23a1a05ea58c2ea5..733283d2982f791d40dda509a735ee71b0722687 100644 (file)
@@ -1,4 +1,4 @@
-USING: help.markup help.syntax io.backend io.files strings
+USING: help.markup help.syntax io.backend io.files io.directories strings
 sequences ;
 IN: io.pathnames
 
@@ -60,7 +60,15 @@ HELP: pathname
 
 HELP: normalize-path
 { $values { "str" "a pathname string" } { "newstr" "a new pathname string" } }
-{ $description "Called by words such as " { $link <file-reader> } " and " { $link <file-writer> } " to prepare a pathname before passing it to underlying code." } ;
+{ $description "Prepends the " { $link current-directory } " to the pathname, resolves a " { $snippet "resource:" } " prefix, if present, and performs any platform-specific pathname normalization." }
+{ $notes "High-level words, such as " { $link <file-reader> } " and " { $link delete-file } " call this word for you. It only needs to be called directly when passing pathnames to C functions or external processes. This is because Factor does not use the operating system's notion of a current directory, and instead maintains its own dynamically-scoped " { $link current-directory } " variable." }
+{ $examples
+  "For example, if you create a file named " { $snippet "data.txt" } " in the current directory, and wish to pass it to a process, you must normalize it:"
+  { $code
+    "\"1 2 3\" \"data.txt\" ascii set-file-contents"
+    "\"munge\" \"data.txt\" normalize-path 2array run-process"
+  }
+} ;
 
 HELP: canonicalize-path
 { $values { "path" "a pathname string" } { "path'" "a new pathname string" } }
@@ -74,24 +82,21 @@ HELP: home
 { $values { "dir" string } }
 { $description "Outputs the user's home directory." } ;
 
-ARTICLE: "pathname-normalization" "Pathname normalization"
-"Words that take a pathname should normalize the pathname by calling " { $link normalize-path } ".When normalizing a pathname, the input pathname is either absolute or relative to the " { $link current-directory } ". If absolute, such as the root directories " { $snippet "/" } " or " { $snippet "c:\\" } ", the pathname is left alone, while if relative, the current directory is prepended to the pathname. If a pathname begins with the magic string " { $snippet "resource:" } ", this string is replaced with the Factor directory. On Windows, all pathnames, absolute and relative, are converted to Unicode pathamess." ;
-
 ARTICLE: "io.pathnames" "Pathname manipulation"
-{ $subsection "pathname-normalization" }
-"Literal pathnames:"
-{ $subsection POSTPONE: P" }
 "Pathname manipulation:"
-{ $subsection normalize-path }
-{ $subsection canonicalize-path }
 { $subsection parent-directory }
 { $subsection file-name }
 { $subsection last-path-separator }
 { $subsection path-components }
 { $subsection prepend-path }
 { $subsection append-path }
+{ $subsection canonicalize-path }
 "Pathname presentations:"
 { $subsection pathname }
-{ $subsection <pathname> } ;
+{ $subsection <pathname> }
+"Literal pathnames:"
+{ $subsection POSTPONE: P" }
+"Low-level word:"
+{ $subsection normalize-path } ;
 
 ABOUT: "io.pathnames"
diff --git a/core/io/streams/string/authors.txt b/core/io/streams/string/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/core/io/streams/string/string-docs.factor b/core/io/streams/string/string-docs.factor
deleted file mode 100644 (file)
index b87e5ca..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-USING: help.markup help.syntax io strings quotations sequences ;
-IN: io.streams.string
-
-ARTICLE: "io.streams.string" "String streams"
-"String streams:"
-{ $subsection <string-reader> }
-{ $subsection <string-writer> }
-"Utility combinators:"
-{ $subsection with-string-reader }
-{ $subsection with-string-writer } ;
-
-ABOUT: "io.streams.string"
-
-HELP: <string-writer>
-{ $values { "stream" "an output stream" } }
-{ $description "Creates an output stream that collects text into a string buffer. The contents of the buffer can be obtained by executing " { $link >string } "." } ;
-
-HELP: with-string-writer
-{ $values { "quot" quotation } { "str" string } }
-{ $description "Calls the quotation in a new dynamic scope with " { $link output-stream } " rebound to a new string writer. The accumulated string is output when the quotation returns." } ;
-
-HELP: <string-reader>
-{ $values { "str" string } { "stream" "an input stream" } }
-{ $description "Creates a new stream for reading " { $snippet "str" } " from beginning to end." }
-{ $notes "The implementation exploits the ability of string buffers to respond to the input stream protocol by reading characters from the end of the buffer." } ;
-
-HELP: with-string-reader
-{ $values { "str" string } { "quot" quotation } }
-{ $description "Calls the quotation in a new dynamic scope with " { $link input-stream } " rebound to an input stream reading " { $snippet "str" } " from beginning to end." } ;
diff --git a/core/io/streams/string/string-tests.factor b/core/io/streams/string/string-tests.factor
deleted file mode 100644 (file)
index 967c0d4..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-USING: io.streams.string io kernel arrays namespaces make
-tools.test ;
-IN: io.streams.string.tests
-
-[ "line 1" CHAR: l ]
-[
-    "line 1\nline 2\nline 3" <string-reader>
-    dup stream-readln swap stream-read1
-]
-unit-test
-
-[ f ]
-[ "" <string-reader> stream-readln ]
-unit-test
-
-[ "xyzzy" ] [ [ "xyzzy" write ] with-string-writer ] unit-test
-
-[ "a" ] [ 1 "abc" <string-reader> stream-read ] unit-test
-[ "ab" ] [ 2 "abc" <string-reader> stream-read ] unit-test
-[ "abc" ] [ 3 "abc" <string-reader> stream-read ] unit-test
-[ "abc" ] [ 4 "abc" <string-reader> stream-read ] unit-test
-[ "abc" f ] [
-    3 "abc" <string-reader> [ stream-read ] keep stream-read1
-] unit-test
-
-[
-    {
-        { "It seems " CHAR: J }
-        { "obs has lost h" CHAR: i }
-        { "s grasp on reality again.\n" f }
-    }
-] [
-    [
-        "It seems Jobs has lost his grasp on reality again.\n"
-        <string-reader> [
-            "J" read-until 2array ,
-            "i" read-until 2array ,
-            "X" read-until 2array ,
-        ] with-input-stream
-    ] { } make
-] unit-test
-
-[ "hello" "hi" ] [
-    "hello\nhi" <string-reader>
-    dup stream-readln
-    2 rot stream-read
-] unit-test
-
-[ "hello" "hi" ] [
-    "hello\r\nhi" <string-reader>
-    dup stream-readln
-    2 rot stream-read
-] unit-test
-
-[ "hello" "hi" ] [
-    "hello\rhi" <string-reader>
-    dup stream-readln
-    2 rot stream-read
-] unit-test
diff --git a/core/io/streams/string/string.factor b/core/io/streams/string/string.factor
deleted file mode 100644 (file)
index 73bf5f5..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-! Copyright (C) 2003, 2009 Slava Pestov, Daniel Ehrenberg.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors io kernel math namespaces sequences sbufs
-strings generic splitting continuations destructors sequences.private
-io.streams.plain io.encodings math.order growable io.streams.sequence ;
-IN: io.streams.string
-
-<PRIVATE
-
-SINGLETON: null-encoding
-
-M: null-encoding decode-char drop stream-read1 ;
-
-PRIVATE>
-
-M: growable dispose drop ;
-
-M: growable stream-write1 push ;
-M: growable stream-write push-all ;
-M: growable stream-flush drop ;
-
-: <string-writer> ( -- stream )
-    512 <sbuf> ;
-
-: with-string-writer ( quot -- str )
-    <string-writer> swap [ output-stream get ] compose with-output-stream*
-    >string ; inline
-
-! New implementation
-
-TUPLE: string-reader { underlying string read-only } { i array-capacity } ;
-
-M: string-reader stream-read-partial stream-read ;
-M: string-reader stream-read sequence-read ;
-M: string-reader stream-read1 sequence-read1 ;
-M: string-reader stream-read-until sequence-read-until ;
-M: string-reader dispose drop ;
-
-: <string-reader> ( str -- stream )
-    0 string-reader boa null-encoding <decoder> ;
-
-: with-string-reader ( str quot -- )
-    [ <string-reader> ] dip with-input-stream ; inline
-
-INSTANCE: growable plain-writer
diff --git a/core/io/streams/string/summary.txt b/core/io/streams/string/summary.txt
deleted file mode 100644 (file)
index 2567c6a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Reading and writing strings as streams
index 800bc86b6696edffb1aceb1181707678edeca8a0..9c5d6f56ea22a4642683575dd715dba38e0afaed 100644 (file)
@@ -446,6 +446,133 @@ HELP: 2tri@
     }
 } ;
 
+HELP: bi-curry
+{ $values { "x" object } { "p" { $quotation "( x -- ... )" } } { "q" { $quotation "( x -- ... )" } } { "p'" { $snippet "[ x p ]" } } { "q'" { $snippet "[ x q ]" } } }
+{ $description "Partially applies " { $snippet "p" } " and " { $snippet "q" } " to " { $snippet "x" } "." }
+{ $notes
+  "The following two lines are equivalent:"
+  { $code
+    "[ p ] [ q ] bi-curry [ call ] bi@"
+    "[ p ] [ q ] bi"
+  }
+  "Higher-arity variants of " { $link bi } " can be built from " { $link bi-curry } ":"
+  { $code
+    "[ p ] [ q ] bi-curry bi == [ p ] [ q ] 2bi"
+    "[ p ] [ q ] bi-curry bi-curry bi == [ p ] [ q ] 3bi"
+  }
+  "The combination " { $snippet "bi-curry bi*" } " cannot be expressed with the non-currying dataflow combinators alone; it is equivalent to a stack shuffle preceding " { $link 2bi* } ":"
+  { $code
+    "[ p ] [ q ] bi-curry bi*"
+    "[ swap ] keep [ p ] [ q ] 2bi*"
+  }
+  "To put it another way, " { $snippet "bi-curry bi*" } " handles the case where you have three values " { $snippet "a b c" } " on the stack, and you wish to apply " { $snippet "p" } " to " { $snippet "a c" } " and " { $snippet "q" } " to " { $snippet "b c" } "."
+} ;
+
+HELP: tri-curry
+{ $values
+  { "x" object }
+  { "p" { $quotation "( x -- ... )" } }
+  { "q" { $quotation "( x -- ... )" } }
+  { "r" { $quotation "( x -- ... )" } }
+  { "p'" { $snippet "[ x p ]" } }
+  { "q'" { $snippet "[ x q ]" } }
+  { "r'" { $snippet "[ x r ]" } }
+}
+{ $description "Partially applies " { $snippet "p" } ", " { $snippet "q" } " and " { $snippet "r" } " to " { $snippet "x" } "." }
+{ $notes
+  "The following two lines are equivalent:"
+  { $code
+    "[ p ] [ q ] [ r ] tri-curry [ call ] tri@"
+    "[ p ] [ q ] [ r ] tri"
+  }
+  "Higher-arity variants of " { $link tri } " can be built from " { $link tri-curry } ":"
+  { $code
+    "[ p ] [ q ] [ r ] tri-curry tri == [ p ] [ q ] [ r ] 2tri"
+    "[ p ] [ q ] [ r ] tri-curry tri-curry bi == [ p ] [ q ] [ r ] 3tri"
+  }
+  "The combination " { $snippet "tri-curry tri*" } " cannot be expressed with the non-currying dataflow combinators alone; it handles the case where you have four values " { $snippet "a b c d" } " on the stack, and you wish to apply " { $snippet "p" } " to " { $snippet "a d" } ", " { $snippet "q" } " to " { $snippet "b d" } " and " { $snippet "r" } " to " { $snippet "c d" } "." } ;
+
+HELP: bi-curry*
+{ $values { "x" object } { "y" object } { "p" { $quotation "( x -- ... )" } } { "q" { $quotation "( y -- ... )" } } { "p'" { $snippet "[ x p ]" } } { "q'" { $snippet "[ y q ]" } } }
+{ $description "Partially applies " { $snippet "p" } " to " { $snippet "x" } ", and " { $snippet "q" } " to " { $snippet "y" } "." }
+{ $notes
+  "The following two lines are equivalent:"
+  { $code
+    "[ p ] [ q ] bi-curry* [ call ] bi@"
+    "[ p ] [ q ] bi*"
+  }
+  "The combination " { $snippet "bi-curry* bi" } " is equivalent to a stack shuffle preceding " { $link 2bi* } ":"
+  { $code
+    "[ p ] [ q ] bi-curry* bi"
+    "[ over ] dip [ p ] [ q ] 2bi*"
+  }
+  "In other words, " { $snippet "bi-curry* bi" } " handles the case where you have the three values " { $snippet "a b c" } " on the stack, and you wish to apply " { $snippet "p" } " to " { $snippet "a b" } " and " { $snippet "q" } " to " { $snippet "a c" } "."
+  $nl
+  "The combination " { $snippet "bi-curry* bi*" } " is equivalent to a stack shuffle preceding " { $link 2bi* } ":"
+  { $code
+    "[ p ] [ q ] bi-curry* bi*"
+    "[ swap ] dip [ p ] [ q ] 2bi*"
+  }
+  "In other words, " { $snippet "bi-curry* bi*" } " handles the case where you have the four values " { $snippet "a b c d" } " on the stack, and you wish to apply " { $snippet "p" } " to " { $snippet "a c" } " and " { $snippet "q" } " to " { $snippet "b d" } "."
+  
+} ;
+
+HELP: tri-curry*
+{ $values
+  { "x" object }
+  { "y" object }
+  { "z" object }
+  { "p" { $quotation "( x -- ... )" } }
+  { "q" { $quotation "( y -- ... )" } }
+  { "r" { $quotation "( z -- ... )" } }
+  { "p'" { $snippet "[ x p ]" } }
+  { "q'" { $snippet "[ y q ]" } }
+  { "r'" { $snippet "[ z r ]" } }
+}
+{ $description "Partially applies " { $snippet "p" } " to " { $snippet "x" } ", " { $snippet "q" } " to " { $snippet "y" } " and " { $snippet "r" } " to " { $snippet "z" } "." }
+{ $notes
+  "The following two lines are equivalent:"
+  { $code
+    "[ p ] [ q ] [ r ] tri-curry* [ call ] tri@"
+    "[ p ] [ q ] [ r ] tri*"
+  }
+  "The combination " { $snippet "tri-curry* tri" } " is equivalent to a stack shuffle preceding " { $link 2tri* } ":"
+  { $code
+    "[ p ] [ q ] [ r ] tri-curry* tri"
+    "[ [ over ] dip over ] dip [ p ] [ q ] [ r ] 2tri*"
+  }
+} ;
+
+HELP: bi-curry@
+{ $values { "x" object } { "y" object } { "q" { $quotation "( obj -- ... )" } } { "p'" { $snippet "[ x q ]" } } { "q'" { $snippet "[ y q ]" } } }
+{ $description "Partially applies " { $snippet "q" } " to " { $snippet "x" } " and " { $snippet "y" } "." }
+{ $notes
+  "The following two lines are equivalent:"
+  { $code
+    "[ q ] bi-curry@"
+    "[ q ] [ q ] bi-curry*"
+  }
+} ;
+
+HELP: tri-curry@
+{ $values
+  { "x" object }
+  { "y" object }
+  { "z" object }
+  { "q" { $quotation "( obj -- ... )" } }
+  { "p'" { $snippet "[ x q ]" } }
+  { "q'" { $snippet "[ y q ]" } }
+  { "r'" { $snippet "[ z q ]" } }
+}
+{ $description "Partially applies " { $snippet "q" } " to " { $snippet "x" } ", " { $snippet "y" } " and " { $snippet "z" } "." }
+{ $notes
+  "The following two lines are equivalent:"
+  { $code
+    "[ q ] tri-curry@"
+    "[ q ] [ q ] [ q ] tri-curry*"
+  }
+} ;
+
 HELP: if
 { $values { "?" "a generalized boolean" } { "true" quotation } { "false" quotation } }
 { $description "If " { $snippet "cond" } " is " { $link f } ", calls the " { $snippet "false" } " quotation. Otherwise calls the " { $snippet "true" } " quotation."
@@ -844,15 +971,61 @@ $nl
 { $subsection 2keep }
 { $subsection 3keep } ;
 
+ARTICLE: "curried-dataflow" "Curried dataflow combinators"
+"Curried cleave combinators:"
+{ $subsection bi-curry }
+{ $subsection tri-curry }
+"Curried spread combinators:"
+{ $subsection bi-curry* }
+{ $subsection tri-curry* }
+"Curried apply combinators:"
+{ $subsection bi-curry@ }
+{ $subsection tri-curry@ }
+{ $see-also "dataflow-combinators" } ;
+
+ARTICLE: "compositional-examples" "Examples of compositional combinator usage"
+"Consider printing the same message ten times:"
+{ $code ": print-10 ( -- ) 10 [ \"Hello, world.\" print ] times ;" }
+"if we wanted to abstract out the message into a parameter, we could keep it on the stack between iterations:"
+{ $code ": print-10 ( message -- ) 10 [ dup print ] times drop ;" }
+"However, keeping loop-invariant values on the stack doesn't always work out nicely. For example, a word to subtract a value from each element of a sequence:"
+{ $code ": subtract-n ( seq n -- seq' ) swap [ over - ] map nip ;" }
+"Three shuffle words are required to pass the value around. Instead, the loop-invariant value can be partially applied to a quotation using " { $link curry } ", yielding a new quotation that is passed to " { $link map } ":"
+{ $example
+  "USING: kernel math prettyprint sequences ;"
+  ": subtract-n ( seq n -- seq' ) [ - ] curry map ;"
+  "{ 10 20 30 } 5 subtract-n ."
+  "{ 5 15 25 }"
+}
+"Now consider the word that is dual to the one above; instead of subtracting " { $snippet "n" } " from each stack element, it subtracts each element from " { $snippet "n" } "."
+$nl
+"One way to write this is with a pair of " { $link swap } "s:"
+{ $code ": n-subtract ( n seq -- seq' ) swap [ swap - ] curry map ;" }
+"Since this pattern comes up often, " { $link with } " encapsulates it:"
+{ $example
+  "USING: kernel math prettyprint sequences ;"
+  ": n-subtract ( n seq -- seq' ) [ - ] with map ;"
+  "30 { 10 20 30 } n-subtract ."
+  "{ 20 10 0 }"
+}
+{ $see-also "fry.examples" } ;
+
 ARTICLE: "compositional-combinators" "Compositional combinators"
-"Quotations can be composed using efficient quotation-specific operations:"
+"Certain combinators transform quotations to produce a new quotation."
+{ $subsection "compositional-examples" }
+"Fundamental operations:"
 { $subsection curry }
+{ $subsection compose }
+"Derived operations:"
 { $subsection 2curry }
 { $subsection 3curry }
 { $subsection with }
-{ $subsection compose }
 { $subsection prepose }
-"Quotations also implement the sequence protocol, and can be manipulated with sequence words; see " { $link "quotations" } "." ;
+"These operations run in constant time, and in many cases are optimized out altogether by the " { $link "compiler" } ". " { $link "fry" } " are an abstraction built on top of these operations, and code that uses this abstraction is often clearer than direct calls to the below words."
+$nl
+"Curried dataflow combinators can be used to build more complex dataflow by combining cleave, spread and apply patterns in various ways."
+{ $subsection "curried-dataflow" }
+"Quotations also implement the sequence protocol, and can be manipulated with sequence words; see " { $link "quotations" } ". However, such runtime quotation manipulation will not be optimized by the optimizing compiler." ;
 
 ARTICLE: "implementing-combinators" "Implementing combinators"
 "The following pair of words invoke words and quotations reflectively:"
@@ -948,7 +1121,8 @@ ARTICLE: "dataflow-combinators" "Data flow combinators"
 { $subsection "slip-keep-combinators" }
 { $subsection "cleave-combinators" }
 { $subsection "spread-combinators" }
-{ $subsection "apply-combinators" } ;
+{ $subsection "apply-combinators" }
+{ $see-also "curried-dataflow" } ;
 
 ARTICLE: "dataflow" "Data and control flow"
 { $subsection "evaluator" }
index c36e6da19056d11ab1de53bc8821d8f690878532..75341f0204d9026d14518d1ce72b23320e6901d9 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel sequences accessors namespaces math words strings
 io vectors arrays math.parser combinators continuations ;
@@ -23,13 +23,11 @@ TUPLE: lexer text line line-text line-length column ;
     lexer new-lexer ;
 
 : skip ( i seq ? -- n )
-    [ tuck ] dip
-    [ swap CHAR: \s eq? xor ] curry find-from drop
-    [ ] [ length ] ?if ;
+    over length
+    [ [ swap CHAR: \s eq? xor ] curry find-from drop ] dip or ;
 
 : change-lexer-column ( lexer quot -- )
-    swap
-    [ [ column>> ] [ line-text>> ] bi rot call ] keep
+    [ [ column>> ] [ line-text>> ] bi ] prepose keep
     (>>column) ; inline
 
 GENERIC: skip-blank ( lexer -- )
index 269f4fb26bbf4c18a384a4a81c2f84b3052f2202..d3ec6c3e57a2db8943e7479881afd3c1f20ce3f5 100644 (file)
@@ -2,14 +2,57 @@ IN: make
 USING: help.markup help.syntax quotations sequences math.parser
 kernel ;
 
+ARTICLE: "make-philosophy" "Make philosophy"
+{ $heading "When to use make" }
+"Make is useful for complex sequence construction which is hard to express with sequence combinators and various combinations of utility words."
+$nl
+"For example, this example uses " { $link make } " and reads better than a version using utility words:"
+{ $code "[ [ left>> , ] [ \"+\" % center>> % \"-\" % ] [ right , ] tri ] { } make" }
+"compare the above to"
+{ $code "[ center>> \"+\" \"-\" surround ] [ left>> prefix ] [ right suffix ] tri" }
+"The first one has a similar shape to the eventual output array. The second one has an arbitrary structure and uses three different utilities. Furthermore, the second version also constructs two redundant intermediate sequences, and for longer sequences, this extra copying will outweigh any overhead " { $link make } " has due to its use of a dynamic variable to store the sequence being built."
+$nl
+"On the other hand, using " { $link make } " instead of a single call to " { $link surround } " is overkill. The below headings summarize the most important cases where other idioms are more appropriate than " { $link make } "."
+{ $heading "Make versus combinators" }
+"Sometimes, usages of " { $link make } " are better expressed with " { $link "sequences-combinators" } ". For example, instead of calling a combinator with a quotation which executes " { $link , } " exactly once on each iteration, oftena combinator encapsulating that specific idiom exists and can be used."
+$nl
+"For example,"
+{ $code "[ [ 42 * , ] each ] { } make" }
+"is equivalent to"
+{ $code "[ 42 * ] map" }
+"and"
+{ $code "[ [ reverse % ] each ] \"\" make" }
+"is equivalent to"
+{ $code "[ [ reverse ] map concat" }
+{ $heading "Utilities for simple make patterns" }
+"Sometimes, an existing word already implements a specific " { $link make } " usage. For example, " { $link suffix } " is equivalent to the following, with the added caveat that the below example always outputs an array:"
+{ $code "[ , % ] { } make" }
+"The existing utility words can in some cases express intent better than an arbitrary-looking string or " { $link , } " and " { $link % } "."
+{ $heading "Constructing quotations" }
+"Simple quotation construction can often be accomplished using " { $link "fry" } " and " { $link "compositional-combinators" } "."
+$nl
+"For example,"
+{ $code "[ 2 , , \ + , ] [ ] make" }
+"is better expressed as"
+{ $code "'[ 2 _ + ]" } ;
+
 ARTICLE: "namespaces-make" "Making sequences with variables"
 "The " { $vocab-link "make" } " vocabulary implements a facility for constructing sequences by holding an accumulator sequence in a variable. Storing the accumulator sequence in a variable rather than the stack may allow code to be written with less stack manipulation."
+$nl
+"Sequence construction is wrapped in a combinator:"
 { $subsection make }
+"Inside the quotation passed to " { $link make } ", several words accumulate values:"
 { $subsection , }
 { $subsection % }
 { $subsection # }
-"The accumulator sequence can be accessed directly:"
-{ $subsection building } ;
+"The accumulator sequence can be accessed directly from inside a " { $link make } ":"
+{ $subsection building }
+{ $example
+  "USING: make math.parser io ;"
+  "[ \"Language #\" % CHAR: \\s , 5 # ] \"\" make print"
+  "Language # 5"
+}
+{ $subsection "make-philosophy" } ;
 
 ABOUT: "namespaces-make"
 
@@ -27,4 +70,4 @@ HELP: ,
 
 HELP: %
 { $values { "seq" sequence } }
-{ $description "Appends a sequence to the end of the sequence being constructed by " { $link make } "." } ;
+{ $description "Appends a sequence to the end of the sequence being constructed by " { $link make } "." } ;
\ No newline at end of file
index 845fdc0fcf1f2ec402c10629cc5fb0ca9b364026..e88caa77039fb1cb24cc792f5de53754c78a1d88 100644 (file)
@@ -93,7 +93,7 @@ M: bignum (log2) bignum-log2 ;
 
 : pre-scale ( num den -- scale shifted-num scaled-den )
     2dup [ log2 ] bi@ -
-    tuck [ neg 54 + shift ] [ [ scale-denonimator ] dip + ] 2bi*
+    [ neg 54 + shift ] [ [ scale-denonimator ] dip + ] bi-curry bi*
     -rot ; inline
 
 ! Second step: loop
index 412fd325cc71f28dd447a32d4fcfa06f7cae4e92..42786ffc9db8b255e25dfc108ff597c2d7e708a5 100755 (executable)
@@ -66,7 +66,7 @@ PRIVATE>
 
 : ?1+ ( x -- y ) [ 1+ ] [ 0 ] if* ; inline
 
-: rem ( x y -- z ) abs tuck mod over + swap mod ; foldable
+: rem ( x y -- z ) abs [ mod ] [ + ] [ mod ] tri ; foldable
 
 : 2^ ( n -- 2^n ) 1 swap shift ; inline
 
@@ -120,7 +120,7 @@ M: float fp-infinity? ( float -- ? )
 
 : iterate-step ( i n quot -- i n quot )
     #! Apply quot to i, keep i and quot, hide n.
-    swap [ 2dup 2slip ] dip swap ; inline
+    [ nip call ] 3keep ; inline
 
 : iterate-next ( i n quot -- i' n quot ) [ 1+ ] 2dip ; inline
 
@@ -158,7 +158,7 @@ PRIVATE>
     over 0 < [
         2drop f
     ] [
-        2dup 2slip rot [
+        [ call ] 2keep rot [
             drop
         ] [
             [ 1- ] dip find-last-integer
index 616ddef7fc70299d23dfa05c7bdddaca66343760..a7b1e508807893b6492aa0581f78b34b889be838 100644 (file)
@@ -3,7 +3,7 @@ IN: namespaces.tests
 
 H{ } clone "test-namespace" set
 
-: test-namespace ( -- )
+: test-namespace ( -- )
     H{ } clone dup [ namespace = ] bind ;
 
 [ t ] [ test-namespace ] unit-test
@@ -14,6 +14,9 @@ H{ } clone "test-namespace" set
 unit-test
 
 SYMBOL: test-initialize
+
+f test-initialize set-global
+
 test-initialize [ 1 ] initialize
 test-initialize [ 2 ] initialize
 
index 24095fd38203122bcfb9e214148b5a35727715ad..623e2ddcda9a07c08a1918ed86cb0cbd18ce0c9d 100644 (file)
@@ -29,15 +29,7 @@ PRIVATE>
 : dec ( variable -- ) -1 swap +@ ; inline
 : bind ( ns quot -- ) swap >n call ndrop ; inline
 : counter ( variable -- n ) global [ 0 or 1+ dup ] change-at ;
-
-: make-assoc ( quot exemplar -- hash )
-    20 swap new-assoc [ >n call ndrop ] keep ; inline
-
-: with-scope ( quot -- )
-    H{ } clone >n call ndrop ; inline
-
-: with-variable ( value key quot -- )
-    [ associate >n ] dip call ndrop ; inline 
-
-: initialize ( variable quot -- )
-    [ global ] [ [ unless* ] curry ] bi* change-at ;
+: make-assoc ( quot exemplar -- hash ) 20 swap new-assoc [ swap bind ] keep ; inline
+: with-scope ( quot -- ) H{ } clone swap bind ; inline
+: with-variable ( value key quot -- ) [ associate ] dip bind ; inline
+: initialize ( variable quot -- ) [ global ] dip [ unless* ] curry change-at ; inline
\ No newline at end of file
index 971ba245dddbc50790939b6b272f203415f31ac8..cbf8754821bd7ba6627a7fb8c9b22d724726b1fd 100644 (file)
@@ -3,7 +3,7 @@
 USING: arrays definitions generic assocs kernel math namespaces
 sequences strings vectors words words.symbol quotations io
 combinators sorting splitting math.parser effects continuations
-io.files io.streams.string vocabs io.encodings.utf8 source-files
+io.files vocabs io.encodings.utf8 source-files
 classes hashtables compiler.errors compiler.units accessors sets
 lexer vocabs.parser ;
 IN: parser
@@ -26,7 +26,7 @@ t parser-notes set-global
     parser-notes? [
         file get [ path>> write ":" write ] when* 
         lexer get [ line>> number>string write ": " write ] when*
-        "Note: " write dup print
+        "Note:" print dup print
     ] when drop ;
 
 M: parsing-word stack-effect drop (( parsed -- parsed )) ;
@@ -164,6 +164,7 @@ SYMBOL: interactive-vocabs
     "inspector"
     "io"
     "io.files"
+    "io.pathnames"
     "kernel"
     "listener"
     "math"
@@ -178,7 +179,9 @@ SYMBOL: interactive-vocabs
     "strings"
     "syntax"
     "tools.annotations"
+    "tools.apropos"
     "tools.crossref"
+    "tools.disassembler"
     "tools.memory"
     "tools.profiler"
     "tools.test"
index 5f88b981440a4d32a56b357c396c9fb469bb1eff..c171555737eddf6895eab8753cf1bd09a3044d62 100755 (executable)
@@ -502,11 +502,9 @@ HELP: delete-slice
 { $side-effects "seq" } ;
 
 HELP: replace-slice
-{ $values { "new" sequence } { "seq" "a mutable sequence" } { "from" "a non-negative integer" } { "to" "a non-negative integer" } }
+{ $values { "new" sequence } { "seq" sequence } { "from" "a non-negative integer" } { "to" "a non-negative integer" } { "seq'" sequence } }
 { $description "Replaces a range of elements beginning at index " { $snippet "from" } " and ending before index " { $snippet "to" } " with a new sequence." }
-{ $notes "If the " { $snippet "to - from" } " is equal to the length of " { $snippet "new" } ", the sequence remains the same size, and does not have to support resizing. However, if " { $snippet "to - from" } " is not equal to the length of " { $snippet "new" } ", the " { $link set-length } " word is called on " { $snippet "seq" } ", so fixed-size sequences should not be passed in this case." }
-{ $errors "Throws an error if " { $snippet "new" } " contains elements whose types are not permissible in " { $snippet "seq" } "." }
-{ $side-effects "seq" } ;
+{ $errors "Throws an error if " { $snippet "new" } " contains elements whose types are not permissible in " { $snippet "seq" } "." } ;
 
 { push prefix suffix } related-words
 
@@ -1445,7 +1443,9 @@ ARTICLE: "sequences-slices" "Subsequences and slices"
 { $subsection unclip-last-slice }
 { $subsection cut-slice }
 "A utility for words which use slices as iterators:"
-{ $subsection <flat-slice> } ;
+{ $subsection <flat-slice> }
+"Replacing slices with new elements:"
+{ $subsection replace-slice } ;
 
 ARTICLE: "sequences-combinators" "Sequence combinators"
 "Iteration:"
@@ -1553,7 +1553,6 @@ ARTICLE: "sequences-destructive" "Destructive operations"
 { $subsection move }
 { $subsection exchange }
 { $subsection copy }
-{ $subsection replace-slice }
 "Many operations have constructive and destructive variants:"
 { $table
     { "Constructive" "Destructive" }
index dad0ea16d1e3da33056ec46a58663b7cd8dfe2d6..dbbf49ef36f022ed2381651efb6fdeee590b0bc6 100644 (file)
@@ -17,8 +17,8 @@ IN: sequences.tests
 
 [ 5040 ] [ [ 1 2 3 4 5 6 7 ] 1 [ * ] reduce ] unit-test
 
-[ 5040 [ 1 1 2 6 24 120 720 ] ]
-[ [ 1 2 3 4 5 6 7 ] 1 [ * ] accumulate ] unit-test
+[ 5040 { 1 1 2 6 24 120 720 } ]
+[ { 1 2 3 4 5 6 7 } 1 [ * ] accumulate ] unit-test
 
 [ f f ] [ [ ] [ ] find ] unit-test
 [ 0 1 ] [ [ 1 ] [ ] find ] unit-test
@@ -134,28 +134,28 @@ unit-test
 
 [ V{ } ] [ 6 >vector 0 6 pick delete-slice ] unit-test
 
-[ V{ 1 2 "a" "b" 5 6 7 } ] [
-    { "a" "b" } 2 4 V{ 1 2 3 4 5 6 7 } clone
-    [ replace-slice ] keep
+[ { 1 2 "a" "b" 5 6 7 } ] [
+    { "a" "b" } 2 4 { 1 2 3 4 5 6 7 }
+    replace-slice
 ] unit-test
 
-[ V{ 1 2 "a" "b" 6 7 } ] [
-    { "a" "b" } 2 5 V{ 1 2 3 4 5 6 7 } clone
-    [ replace-slice ] keep
+[ { 1 2 "a" "b" 6 7 } ] [
+    { "a" "b" } 2 5 { 1 2 3 4 5 6 7 }
+    replace-slice
 ] unit-test
 
-[ V{ 1 2 "a" "b" 4 5 6 7 } ] [
-    { "a" "b" } 2 3 V{ 1 2 3 4 5 6 7 } clone
-    [ replace-slice ] keep
+[ { 1 2 "a" "b" 4 5 6 7 } ] [
+    { "a" "b" } 2 3 { 1 2 3 4 5 6 7 }
+    replace-slice
 ] unit-test
 
-[ V{ 1 2 3 4 5 6 7 "a" "b" } ] [
-    { "a" "b" } 7 7 V{ 1 2 3 4 5 6 7 } clone
-    [ replace-slice ] keep
+[ { 1 2 3 4 5 6 7 "a" "b" } ] [
+    { "a" "b" } 7 7 { 1 2 3 4 5 6 7 }
+    replace-slice
 ] unit-test
 
-[ V{ "a" 3 } ] [
-    { "a" } 0 2 V{ 1 2 3 } clone [ replace-slice ] keep
+[ { "a" 3 } ] [
+    { "a" } 0 2 { 1 2 3 } replace-slice
 ] unit-test
 
 [ { 1 4 9 } ] [ { 1 2 3 } clone dup [ sq ] change-each ] unit-test
@@ -165,7 +165,7 @@ unit-test
 [ 5 ] [ 1 >bignum "\u000001\u000005\u000007" nth-unsafe ] unit-test
 
 [ SBUF" before&after" ] [
-    "&" 6 11 SBUF" before and after" [ replace-slice ] keep
+    "&" 6 11 SBUF" before and after" replace-slice
 ] unit-test
 
 [ 3 "a" ] [ { "a" "b" "c" "a" "d" } [ "a" = ] find-last ] unit-test
index 19ce3065bf5b996743e998619127bd301b0e5fbd..fb05d331e14e0e9a3418a64bf57cf6a310c125ea 100755 (executable)
@@ -128,8 +128,8 @@ INSTANCE: iota immutable-sequence
     [ first3-unsafe ] [ 3 swap nth-unsafe ] bi ; inline
 
 : exchange-unsafe ( m n seq -- )
-    [ tuck [ nth-unsafe ] 2bi@ ]
-    [ tuck [ set-nth-unsafe ] 2bi@ ] 3bi ; inline
+    [ [ nth-unsafe ] curry bi@ ]
+    [ [ set-nth-unsafe ] curry bi@ ] 3bi ; inline
 
 : (head) ( seq n -- from to seq ) [ 0 ] 2dip swap ; inline
 
@@ -211,7 +211,7 @@ TUPLE: slice
 { seq read-only } ;
 
 : collapse-slice ( m n slice -- m' n' seq )
-    [ from>> ] [ seq>> ] bi [ tuck [ + ] 2bi@ ] dip ; inline
+    [ from>> ] [ seq>> ] bi [ [ + ] curry bi@ ] dip ; inline
 
 ERROR: slice-error from to seq reason ;
 
@@ -286,7 +286,7 @@ INSTANCE: repetition immutable-sequence
 PRIVATE>
 
 : subseq ( from to seq -- subseq )
-    [ check-slice prepare-subseq (copy) ] [ like ] bi ;
+    [ check-slice prepare-subseq (copy) ] keep like ;
 
 : head ( seq n -- headseq ) (head) subseq ;
 
@@ -363,7 +363,7 @@ PRIVATE>
     [ (each) ] dip collect ; inline
 
 : 2nth-unsafe ( n seq1 seq2 -- elt1 elt2 )
-    [ over ] dip [ nth-unsafe ] 2bi@ ; inline
+    [ nth-unsafe ] bi-curry@ bi ; inline
 
 : (2each) ( seq1 seq2 quot -- n quot' )
     [
@@ -372,12 +372,12 @@ PRIVATE>
     ] dip compose ; inline
 
 : 3nth-unsafe ( n seq1 seq2 seq3 -- elt1 elt2 elt3 )
-    [ over ] 2dip [ over ] dip [ nth-unsafe ] 2tri@ ; inline
+    [ nth-unsafe ] tri-curry@ tri ; inline
 
 : (3each) ( seq1 seq2 seq3 quot -- n quot' )
     [
-        [ [ length ] tri@ min min ] 3keep
-        [ 3nth-unsafe ] 3curry
+        [ [ length ] tri@ min min ]
+        [ [ 3nth-unsafe ] 3curry ] 3bi
     ] dip compose ; inline
 
 : finish-find ( i seq -- i elt )
@@ -392,9 +392,6 @@ PRIVATE>
     [ 2drop f f ]
     if ; inline
 
-: (interleave) ( n elt between quot -- )
-    roll 0 = [ nip ] [ swapd 2slip ] if call ; inline
-
 PRIVATE>
 
 : each ( seq quot -- )
@@ -419,7 +416,7 @@ PRIVATE>
     over map-into ; inline
 
 : accumulate ( seq identity quot -- final newseq )
-    swapd [ pick slip ] curry map ; inline
+    swapd [ [ call ] [ 2drop ] 3bi ] curry { } map-as ; inline
 
 : 2each ( seq1 seq2 quot -- )
     (2each) each-integer ; inline
@@ -479,10 +476,7 @@ PRIVATE>
     V{ } clone V{ } clone [ [ push-either ] 3curry ] 2keep ; inline
 
 : partition ( seq quot -- trueseq falseseq )
-    over [ 2pusher [ each ] 2dip ] dip tuck [ like ] 2bi@ ; inline
-
-: interleave ( seq between quot -- )
-    [ (interleave) ] 2curry [ [ length ] keep ] dip 2each ; inline
+    over [ 2pusher [ each ] 2dip ] dip [ like ] curry bi@ ; inline
 
 : accumulator ( quot -- quot' vec )
     V{ } clone [ [ push ] curry compose ] keep ; inline
@@ -502,6 +496,11 @@ PRIVATE>
 : each-index ( seq quot -- )
     prepare-index 2each ; inline
 
+: interleave ( seq between quot -- )
+    swap [ drop ] [ [ 2dip call ] 2curry ] 2bi
+    [ [ 0 = ] 2dip if ] 2curry
+    each-index ; inline
+
 : map-index ( seq quot -- )
     prepare-index 2map ; inline
 
@@ -643,8 +642,6 @@ PRIVATE>
         [ over - ] 2dip move-backward
     ] if ;
 
-PRIVATE>
-
 : open-slice ( shift from seq -- )
     pick 0 = [
         3drop
@@ -654,31 +651,38 @@ PRIVATE>
         set-length
     ] if ;
 
+PRIVATE>
+
 : delete-slice ( from to seq -- )
     check-slice [ over [ - ] dip ] dip open-slice ;
 
 : delete-nth ( n seq -- )
     [ dup 1+ ] dip delete-slice ;
 
-: replace-slice ( new from to seq -- )
-    [ [ [ dup pick length + ] dip - over ] dip open-slice ] keep
-    copy ;
+: snip ( from to seq -- head tail )
+    [ swap head ] [ swap tail ] bi-curry bi* ; inline
+
+: snip-slice ( from to seq -- head tail )
+    [ swap head-slice ] [ swap tail-slice ] bi-curry bi* ; inline
+
+: replace-slice ( new from to seq -- seq' )
+    snip-slice surround ;
 
 : remove-nth ( n seq -- seq' )
-    [ swap head-slice ] [ swap 1+ tail-slice ] 2bi append ;
+    [ [ { } ] dip dup 1+ ] dip replace-slice ;
 
 : pop ( seq -- elt )
     [ length 1- ] [ [ nth ] [ shorten ] 2bi ] bi ;
 
 : exchange ( m n seq -- )
-    pick over bounds-check 2drop 2dup bounds-check 2drop
-    exchange-unsafe ;
+    [ nip bounds-check 2drop ]
+    [ bounds-check 3drop ]
+    [ exchange-unsafe ]
+    3tri ;
 
 : reverse-here ( seq -- )
-    dup length dup 2/ [
-        [ 2dup ] dip
-        tuck - 1- rot exchange-unsafe
-    ] each 2drop ;
+    [ length 2/ ] [ length ] [ ] tri
+    [ [ over - 1- ] dip exchange-unsafe ] 2curry each ;
 
 : reverse ( seq -- newseq )
     [
@@ -707,8 +711,10 @@ PRIVATE>
 
 : join ( seq glue -- newseq )
     [
-        2dup joined-length over new-resizable spin
-        [ dup pick push-all ] [ pick push-all ] interleave drop
+        2dup joined-length over new-resizable [
+            [ [ push-all ] 2curry ] [ [ nip push-all ] 2curry ] 2bi
+            interleave
+        ] keep
     ] keep like ;
 
 : padding ( seq n elt quot -- newseq )
@@ -793,7 +799,7 @@ PRIVATE>
 
 : drop-prefix ( seq1 seq2 -- slice1 slice2 )
     2dup mismatch [ 2dup min-length ] unless*
-    tuck [ tail-slice ] 2bi@ ;
+    [ tail-slice ] curry bi@ ;
 
 : unclip ( seq -- rest first )
     [ rest ] [ first-unsafe ] bi ;
@@ -824,38 +830,50 @@ PRIVATE>
     [ but-last-slice ] [ peek ] bi ; inline
 
 : <flat-slice> ( seq -- slice )
-    dup slice? [ { } like ] when 0 over length rot <slice> ;
+    dup slice? [ { } like ] when
+    [ drop 0 ] [ length ] [ ] tri <slice> ;
     inline
 
-: trim-head-slice ( seq quot -- slice )
-    over [ [ not ] compose find drop ] dip swap
-    [ tail-slice ] [ dup length tail-slice ] if* ; inline
+<PRIVATE
     
+: (trim-head) ( seq quot -- seq n )
+    over [ [ not ] compose find drop ] dip
+    [ length or ] keep swap ; inline
+
+: (trim-tail) ( seq quot -- seq n )
+    over [ [ not ] compose find-last drop ?1+ ] dip
+    swap ; inline
+
+PRIVATE>
+
+: trim-head-slice ( seq quot -- slice )
+    (trim-head) tail-slice ; inline
+
 : trim-head ( seq quot -- newseq )
-    over [ trim-head-slice ] dip like ; inline
+    (trim-head) tail ; inline
 
 : trim-tail-slice ( seq quot -- slice )
-    over [ [ not ] compose find-last drop ] dip swap
-    [ 1+ head-slice ] [ 0 head-slice ] if* ; inline
+    (trim-tail) head-slice ; inline
 
 : trim-tail ( seq quot -- newseq )
-    over [ trim-tail-slice ] dip like ; inline
+    (trim-tail) head ; inline
 
 : trim-slice ( seq quot -- slice )
     [ trim-head-slice ] [ trim-tail-slice ] bi ; inline
 
 : trim ( seq quot -- newseq )
-    over [ trim-slice ] dip like ; inline
+    [ trim-slice ] [ drop ] 2bi like ; inline
 
 : sum ( seq -- n ) 0 [ + ] binary-reduce ;
 
 : product ( seq -- n ) 1 [ * ] binary-reduce ;
 
-: infimum ( seq -- n ) dup first [ min ] reduce ;
+: infimum ( seq -- n ) [ ] [ min ] map-reduce ;
 
-: supremum ( seq -- n ) dup first [ max ] reduce ;
+: supremum ( seq -- n ) [ ] [ max ] map-reduce ;
 
-: sigma ( seq quot -- n ) [ 0 ] 2dip [ rot slip + ] curry each ; inline
+: sigma ( seq quot -- n )
+    [ 0 ] 2dip [ dip + ] curry [ swap ] prepose each ; inline
 
 : count ( seq quot -- n ) [ 1 0 ? ] compose sigma ; inline
 
index bdc5a5ba07adebfd917f4b0b4204376e277a5e86..840fe628e0a52dbba67707b277bb459a1ce467ac 100644 (file)
@@ -42,11 +42,11 @@ $nl
     "    \"alice@bigcorp.com\" >>from"
     "send-email"
 }
-"This is because " { $link swap } " is easier to understand than " { $link tuck } ":"
+"The above has less shuffling than the writer version:"
 { $code
     "<email>"
-    "    tuck (>>subject)"
-    "    tuck (>>to)"
+    "    [ (>>subject) ] keep"
+    "    [ (>>to) ] keep"
     "    \"alice@bigcorp.com\" over (>>from)"
     "send-email"
 }
index 043505759e310657768aa6902ab220be979ce96e..30ecb70ed9f4335219bf05445411b01eb37459da 100644 (file)
@@ -137,9 +137,9 @@ TUPLE: merge
         [ drop nip nth ] dip push
     ] [
         [
-            [ tuck [ nth-unsafe ] 2bi@ 2dup ] dip call +gt+ eq?
+            [ [ nth-unsafe ] curry bi@ 2dup ] dip call +gt+ eq?
             [ swap ] when
-        ] dip tuck [ push ] 2bi@
+        ] dip [ push ] curry bi@
     ] if ; inline
 
 : sort-pairs ( merge quot -- )
index 7ecc967e9ee35a61c72a1fb9b66d39c91ee2aead..c8441ba3b0a2bf65605720ee4f50f0a66aa1d976 100644 (file)
@@ -31,9 +31,8 @@ uses definitions ;
     source-files get [ nip xref-source ] assoc-each ;
 
 : record-form ( quot source-file -- )
-    tuck unxref-source
-    quot-uses keys >>uses
-    xref-source ;
+    [ quot-uses keys ] dip
+    [ unxref-source ] [ (>>uses) ] [ xref-source ] tri ;
 
 : record-definitions ( file -- )
     new-definitions get >>definitions drop ;
index e31a25b687f981d581afb76cfba310556db64611..6d833c792e86b17ea5b3dc513f0dba643c65b5e7 100644 (file)
@@ -4,35 +4,46 @@ USING: kernel math make strings arrays vectors sequences
 sets math.order accessors ;
 IN: splitting
 
+<PRIVATE
+
+: ?chomp ( seq begin tester chopper -- newseq ? )
+    [ [ 2dup ] dip call ] dip
+    [ [ length ] dip call t ] curry
+    [ drop f ] if ; inline
+
+PRIVATE>
+
 : ?head ( seq begin -- newseq ? )
-    2dup head? [ length tail t ] [ drop f ] if ;
+    [ head? ] [ tail ] ?chomp ;
 
 : ?head-slice ( seq begin -- newseq ? )
-    2dup head? [ length tail-slice t ] [ drop f ] if ;
+    [ head? ] [ tail-slice ] ?chomp ;
 
 : ?tail ( seq end -- newseq ? )
-    2dup tail? [ length head* t ] [ drop f ] if ;
+    [ tail? ] [ head* ] ?chomp ;
 
 : ?tail-slice ( seq end -- newseq ? )
-    2dup tail? [ length head-slice* t ] [ drop f ] if ;
+    [ tail? ] [ head-slice* ] ?chomp ;
 
-: (split1) ( seq subseq -- start end ? )
-    tuck swap start dup
-    [ swap [ drop ] [ length + ] 2bi t ]
-    [ 2drop f f f ]
-    if ;
+<PRIVATE
+
+: (split1) ( seq subseq quot -- before after )
+    [
+        swap [
+            [ drop length ] [ start dup ] 2bi
+            [ [ nip ] [ + ] 2bi t ]
+            [ 2drop f f f ]
+            if
+        ] keep swap
+    ] dip [ 2nip f ] if ; inline
+
+PRIVATE>
 
 : split1 ( seq subseq -- before after )
-    [ drop ] [ (split1) ] 2bi
-    [ [ over ] dip [ head ] [ tail ] 2bi* ]
-    [ 2drop f ]
-    if ;
+    [ snip ] (split1) ;
 
 : split1-slice ( seq subseq -- before-slice after-slice )
-    [ drop ] [ (split1) ] 2bi
-    [ [ over ] dip [ head-slice ] [ tail-slice ] 2bi* ]
-    [ 2drop f ]
-    if ;
+    [ snip-slice ] (split1) ;
 
 : split1-last ( seq subseq -- before after )
     [ <reversed> ] bi@ split1 [ reverse ] bi@
@@ -49,9 +60,12 @@ IN: splitting
 
 : split, ( seq separators -- ) 0 rot (split) ;
 
-: split ( seq separators -- pieces ) [ split, ] { } make ;
+: split ( seq separators -- pieces )
+    [ split, ] { } make ;
+
+GENERIC: string-lines ( str -- seq )
 
-: string-lines ( str -- seq )
+M: string string-lines
     dup "\r\n" intersects? [
         "\n" split [
             but-last-slice [
index 035622454f62d7127218a470dafe0e0d220c8016..31b8516675200e7303e93d37fe663c56f18b5111 100644 (file)
@@ -485,8 +485,13 @@ HELP: CHAR:
 HELP: "
 { $syntax "\"string...\"" }
 { $values { "string" "literal and escaped characters" } }
-{ $description "Reads from the input string until the next occurrence of " { $link POSTPONE: " } ", and appends the resulting string to the parse tree. String literals cannot span multiple lines. Strings containing the " { $link POSTPONE: " } " character and various other special characters can be read by inserting escape sequences." }
-{ $examples { $example "USE: io" "\"Hello\\nworld\" print" "Hello\nworld" } } ;
+{ $description "Reads from the input string until the next occurrence of " { $link POSTPONE: " } ", and appends the resulting string to the parse tree. String literals cannot span multiple lines. Strings containing the " { $link POSTPONE: " } " character and various other special characters can be read by inserting " { $link "escape" } "." }
+{ $examples
+  "A string with a newline in it:"
+  { $example "USE: io" "\"Hello\\nworld\" print" "Hello\nworld" }
+  "A string with a named Unicode code point:"
+  { $example "USE: io" "\"\\u{greek-capital-letter-sigma}\" print" "\u{greek-capital-letter-sigma}" }
+} ;
 
 HELP: SBUF"
 { $syntax "SBUF\" string... \"" }
index 43a391e46a1968701b0583d0256f3598bfd96fcd..c27ea4fd8fbd02eedb92d6a6ce220b5f445831f3 100755 (executable)
@@ -109,10 +109,9 @@ compiled-generic-crossref [ H{ } clone ] initialize
 
 : compiled-xref ( word dependencies generic-dependencies -- )
     [ [ drop crossref? ] { } assoc-filter-as f like ] bi@
-    [ over ] dip
     [ "compiled-uses" compiled-crossref (compiled-xref) ]
     [ "compiled-generic-uses" compiled-generic-crossref (compiled-xref) ]
-    2bi* ;
+    bi-curry* bi ;
 
 : (compiled-unxref) ( word word-prop variable -- )
     [ [ [ dupd word-prop ] dip get remove-vertex* ] 2curry ]
index 8319a2d8d9d824a7b54a98415fe4c065ec264ded..83d83221fdb2b7414f22a7cd340e55327bb64c48 100644 (file)
@@ -237,7 +237,7 @@ USING: math.parser
     [wlet | update-value-label [ ! ( -- )
               BEHAVIOUR weight>> truncate-number number>string
               VALUE-LABEL
-              set-label-string ] |
+              (>>string) ] |
 
       update-value-label
       
@@ -275,7 +275,7 @@ USING: math.parser
     [wlet | update-value-label [ ( -- )
               BOIDS-GADGET boids>> length number>string
               VALUE-LABEL
-              set-label-string ] |
+              (>>string) ] |
 
       update-value-label
       
index 6ed8c1220cada5ff06bddf3b30effce3a2d6867f..69c21b10f7a0ce3046e4b976ad9dd823546b96f6 100755 (executable)
@@ -1,49 +1,49 @@
-! Copyright (C) 2006, 2008 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel math math.functions math.parser models
-       models.filter models.range models.compose sequences ui
-       ui.gadgets ui.gadgets.frames ui.gadgets.labels ui.gadgets.packs
-       ui.gadgets.sliders ui.render math.geometry.rect accessors
-       ui.gadgets.grids colors ;
+models.arrow models.range models.product sequences ui
+ui.gadgets ui.gadgets.frames ui.gadgets.labels ui.gadgets.packs
+ui.gadgets.sliders ui.render math.rectangles accessors
+ui.gadgets.grids colors ;
 IN: color-picker
 
 ! Simple example demonstrating the use of models.
 
-: <color-slider> ( model -- gadget )
-    <x-slider> 1 >>line ;
-
 TUPLE: color-preview < gadget ;
 
 : <color-preview> ( model -- gadget )
     color-preview new-gadget
-      swap        >>model
-      { 100 100 } >>dim ;
+        swap >>model
+        { 100 100 } >>dim ;
 
 M: color-preview model-changed
     swap value>> >>interior relayout-1 ;
 
 : <color-model> ( model -- model )
-    [ first3 [ 256 /f ] tri@ 1 <rgba> <solid> ] <filter> ;
+    [ first3 [ 256 /f ] tri@ 1 <rgba> <solid> ] <arrow> ;
+
+: <color-slider> ( model -- gadget )
+    horizontal <slider> 1 >>line ;
 
-: <color-sliders> ( -- model gadget )
+: <color-sliders> ( -- gadget model )
     3 [ 0 0 0 255 <range> ] replicate
-    dup [ range-model ] map <compose>
-    swap
-    <filled-pile>
-    swap
-      [ <color-slider> add-gadget ] each ;
+    [ <filled-pile> { 5 5 } >>gap [ <color-slider> add-gadget ] reduce ]
+    [ [ range-model ] map <product> ]
+    bi ;
 
 : <color-picker> ( -- gadget )
-  <frame>
-    <color-sliders>
-      swap dup
-      [                               @top    grid-add ]
-      [ <color-model> <color-preview> @center grid-add ]
-      [
-        [ [ truncate number>string ] map " " join ] <filter> <label-control>
-        @bottom grid-add
-      ]
-      tri* ;
+    <frame>
+        { 5 5 } >>gap
+        <color-sliders>
+        [ @top grid-add ]
+        [
+            [ <color-model> <color-preview> @center grid-add ]
+            [
+                [ [ truncate number>string ] map " " join ]
+                <arrow> <label-control>
+                @bottom grid-add
+            ] bi
+        ] bi* ;
 
 : color-picker-window ( -- )
     [ <color-picker> "Color Picker" open-window ] with-ui ;
diff --git a/extra/color-table/authors.txt b/extra/color-table/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/extra/color-table/color-table-tests.factor b/extra/color-table/color-table-tests.factor
new file mode 100644 (file)
index 0000000..69f754d
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test color-table ;
+IN: color-table.tests
diff --git a/extra/color-table/color-table.factor b/extra/color-table/color-table.factor
new file mode 100644 (file)
index 0000000..13a516e
--- /dev/null
@@ -0,0 +1,43 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel accessors combinators.smart sorting.human
+models colors.constants present
+ui ui.gadgets.tables ui.gadgets.scrollers ;
+IN: color-table
+
+! ui.gadgets.tables demo
+SINGLETON: color-renderer
+
+M: color-renderer filled-column
+    drop 0 ;
+
+M: color-renderer column-titles
+    drop { "Name" "Red" "Green" "Blue" } ;
+
+M: color-renderer row-columns
+    drop [
+        dup named-color
+        [ red>> present ]
+        [ green>> present ]
+        [ blue>> present ] tri
+    ] output>array ;
+
+M: color-renderer row-color
+    drop named-color ;
+
+M: color-renderer row-value
+    drop named-color ;
+
+: <color-table> ( -- table )
+    named-colors human-sort <model>
+    color-renderer
+    <table>
+        5 >>gap
+        COLOR: dark-gray >>column-line-color
+        10 >>min-rows
+        10 >>max-rows ;
+
+: color-table-demo ( -- )
+    [ <color-table> <scroller> "Colors" open-window ] with-ui ;
+
+MAIN: color-table-demo
\ No newline at end of file
diff --git a/extra/color-table/tags.txt b/extra/color-table/tags.txt
new file mode 100644 (file)
index 0000000..cb5fc20
--- /dev/null
@@ -0,0 +1 @@
+demos
diff --git a/extra/freetype/authors.txt b/extra/freetype/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/extra/freetype/freetype.factor b/extra/freetype/freetype.factor
new file mode 100644 (file)
index 0000000..06c875b
--- /dev/null
@@ -0,0 +1,199 @@
+! Copyright (C) 2005, 2007 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: alien alien.syntax kernel system combinators ;
+IN: freetype
+
+<< "freetype" {
+    { [ os macosx? ] [ "/usr/X11R6/lib/libfreetype.6.dylib" "cdecl" add-library ] }
+    { [ os windows? ] [ "freetype6.dll" "cdecl" add-library ] }
+    { [ t ] [ drop ] }
+} cond >>
+
+LIBRARY: freetype
+
+TYPEDEF: uchar FT_Byte
+TYPEDEF: void* FT_Bytes
+TYPEDEF: char FT_Char
+TYPEDEF: int FT_Int
+TYPEDEF: int FT_Int32
+TYPEDEF: uint FT_UInt
+TYPEDEF: short FT_Short
+TYPEDEF: ushort FT_UShort
+TYPEDEF: long FT_Long
+TYPEDEF: ulong FT_ULong
+TYPEDEF: uchar FT_Bool
+TYPEDEF: cell FT_Offset
+TYPEDEF: int FT_PtrDist
+TYPEDEF: char FT_String
+TYPEDEF: int FT_Tag
+TYPEDEF: int FT_Error
+TYPEDEF: long FT_Fixed
+TYPEDEF: void* FT_Pointer
+TYPEDEF: long FT_Pos
+TYPEDEF: ushort FT_UFWord
+TYPEDEF: short FT_F2Dot14
+TYPEDEF: long FT_F26Dot6
+
+FUNCTION: FT_Error FT_Init_FreeType ( void* library ) ;
+
+! circular reference between glyph and face
+TYPEDEF: void face
+TYPEDEF: void glyph
+
+C-STRUCT: glyph
+    { "void*" "library" }
+    { "face*" "face" }
+    { "glyph*" "next" }
+    { "FT_UInt" "reserved" }
+    { "void*" "generic" }
+    { "void*" "generic" }
+
+    { "FT_Pos" "width" }
+    { "FT_Pos" "height" }
+
+    { "FT_Pos" "hori-bearing-x" }
+    { "FT_Pos" "hori-bearing-y" }
+    { "FT_Pos" "hori-advance" }
+
+    { "FT_Pos" "vert-bearing-x" }
+    { "FT_Pos" "vert-bearing-y" }
+    { "FT_Pos" "vert-advance" }
+
+    { "FT_Fixed" "linear-hori-advance" }
+    { "FT_Fixed" "linear-vert-advance" }
+    { "FT_Pos" "advance-x" }
+    { "FT_Pos" "advance-y" }
+
+    { "intptr_t" "format" }
+
+    { "int" "bitmap-rows" }
+    { "int" "bitmap-width" }
+    { "int" "bitmap-pitch" }
+    { "void*" "bitmap-buffer" }
+    { "short" "bitmap-num-grays" }
+    { "char" "bitmap-pixel-mode" }
+    { "char" "bitmap-palette-mode" }
+    { "void*" "bitmap-palette" }
+
+    { "FT_Int" "bitmap-left" }
+    { "FT_Int" "bitmap-top" }
+
+    { "short" "n-contours" }
+    { "short" "n-points" }
+
+    { "void*" "points" }
+    { "char*" "tags" }
+    { "short*" "contours" }
+
+    { "int" "outline-flags" }
+
+    { "FT_UInt" "num_subglyphs" }
+    { "void*" "subglyphs" }
+
+    { "void*" "control-data" }
+    { "long" "control-len" }
+
+    { "FT_Pos" "lsb-delta" }
+    { "FT_Pos" "rsb-delta" }
+
+    { "void*" "other" } ;
+
+C-STRUCT: face-size
+    { "face*" "face" }
+    { "void*" "generic" }
+    { "void*" "generic" }
+
+    { "FT_UShort" "x-ppem" }
+    { "FT_UShort" "y-ppem" }
+
+    { "FT_Fixed" "x-scale" }
+    { "FT_Fixed" "y-scale" }
+
+    { "FT_Pos" "ascender" }
+    { "FT_Pos" "descender" }
+    { "FT_Pos" "height" }
+    { "FT_Pos" "max-advance" } ;
+
+C-STRUCT: face
+    { "FT_Long" "num-faces" }
+    { "FT_Long" "index" }
+
+    { "FT_Long" "flags" }
+    { "FT_Long" "style-flags" }
+
+    { "FT_Long" "num-glyphs" }
+
+    { "FT_Char*" "family-name" }
+    { "FT_Char*" "style-name" }
+
+    { "FT_Int" "num-fixed-sizes" }
+    { "void*" "available-sizes" }
+
+    { "FT_Int" "num-charmaps" }
+    { "void*" "charmaps" }
+
+    { "void*" "generic" }
+    { "void*" "generic" }
+
+    { "FT_Pos" "x-min" }
+    { "FT_Pos" "y-min" }
+    { "FT_Pos" "x-max" }
+    { "FT_Pos" "y-max" }
+
+    { "FT_UShort" "units-per-em" }
+    { "FT_Short" "ascender" }
+    { "FT_Short" "descender" }
+    { "FT_Short" "height" }
+
+    { "FT_Short" "max-advance-width" }
+    { "FT_Short" "max-advance-height" }
+
+    { "FT_Short" "underline-position" }
+    { "FT_Short" "underline-thickness" }
+
+    { "glyph*" "glyph" }
+    { "face-size*" "size" }
+    { "void*" "charmap" } ;
+
+C-STRUCT: FT_Bitmap
+    { "int" "rows" }
+    { "int" "width" }
+    { "int" "pitch" }
+    { "void*" "buffer" }
+    { "short" "num_grays" }
+    { "char" "pixel_mode" }
+    { "char" "palette_mode" }
+    { "void*" "palette" } ;
+
+FUNCTION: FT_Error FT_New_Face ( void* library, FT_Char* font, FT_Long index, face* face ) ;
+
+FUNCTION: FT_Error FT_New_Memory_Face ( void* library, FT_Byte* file_base, FT_Long file_size, FT_Long face_index, FT_Face* aface ) ;
+
+FUNCTION: FT_Error FT_Set_Char_Size ( face* face, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt horizontal_dpi, FT_UInt vertical_dpi ) ;
+
+FUNCTION: FT_Error FT_Load_Char ( face* face, FT_ULong charcode, FT_Int32 load_flags ) ;
+
+C-ENUM:
+    FT_RENDER_MODE_NORMAL
+    FT_RENDER_MODE_LIGHT
+    FT_RENDER_MODE_MONO
+    FT_RENDER_MODE_LCD
+    FT_RENDER_MODE_LCD_V ;
+
+C-ENUM:
+    FT_PIXEL_MODE_NONE
+    FT_PIXEL_MODE_MONO
+    FT_PIXEL_MODE_GRAY
+    FT_PIXEL_MODE_GRAY2
+    FT_PIXEL_MODE_GRAY4
+    FT_PIXEL_MODE_LCD
+    FT_PIXEL_MODE_LCD_V ;
+
+FUNCTION: int FT_Render_Glyph ( glyph* slot, int render_mode ) ;
+
+FUNCTION: void FT_Done_Face ( face* face ) ;
+
+FUNCTION: void FT_Done_FreeType ( void* library ) ;
+
+FUNCTION: FT_Long FT_MulFix ( FT_Long a, FT_Long b ) ;
+
diff --git a/extra/freetype/summary.txt b/extra/freetype/summary.txt
new file mode 100644 (file)
index 0000000..48506b0
--- /dev/null
@@ -0,0 +1 @@
+FreeType text rendering library binding
diff --git a/extra/freetype/tags.txt b/extra/freetype/tags.txt
new file mode 100644 (file)
index 0000000..bb863cf
--- /dev/null
@@ -0,0 +1 @@
+bindings
index d13fca28cba040cd61880bce0af7e564ff70048a..c6004a82214493de0283ff7969f42ef84e5852a7 100755 (executable)
@@ -2,7 +2,7 @@ USING: windows.dinput windows.dinput.constants parser
 alien.c-types windows.ole32 namespaces assocs kernel arrays
 vectors windows.kernel32 windows.com windows.dinput shuffle
 windows.user32 windows.messages sequences combinators locals
-math.geometry.rect ui.windows accessors math windows alien
+math.rectangles ui.windows accessors math windows alien
 alien.strings io.encodings.utf16 io.encodings.utf16n
 continuations byte-arrays game-input.dinput.keys-array
 game-input ;
index 61dc8cf77e6a4335a1d203b8a65aeba4f68833f6..faf7056d0270d3a16acfd8e95c222134aec792ce 100644 (file)
@@ -25,7 +25,7 @@ M: gesture-logger user-input*
 
 : gesture-logger ( -- )
     [
-        <scrolling-pane> dup <scroller>
+        <pane> t >>scrolls? dup <scroller>
         "Gesture log" open-window
         <pane-stream> <gesture-logger>
         "Gesture input" open-window
diff --git a/extra/hello-unicode/authors.txt b/extra/hello-unicode/authors.txt
new file mode 100644 (file)
index 0000000..4e80dac
--- /dev/null
@@ -0,0 +1,3 @@
+Slava Pestov
+Daniel Ehrenberg
+Doug Coleman
diff --git a/extra/hello-unicode/hello-unicode-tests.factor b/extra/hello-unicode/hello-unicode-tests.factor
new file mode 100644 (file)
index 0000000..bf9d572
--- /dev/null
@@ -0,0 +1,4 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: tools.test hello-unicode ;
+IN: hello-unicode.tests
diff --git a/extra/hello-unicode/hello-unicode.factor b/extra/hello-unicode/hello-unicode.factor
new file mode 100644 (file)
index 0000000..ef49295
--- /dev/null
@@ -0,0 +1,20 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: ui.gadgets.panes ui.gadgets.borders ui io io.styles ;
+IN: hello-unicode
+
+: <hello-gadget> ( -- gadget )
+    [
+        { { font-size 24 } } [
+            "Hello" print
+            "Grüß dich" print
+            "здравствуйте" print
+            "こんにちは" print
+            "안녕하세요" print
+            "שָׁלוֹם " print
+        ] with-style
+    ] make-pane { 10 10 } <border> ;
+
+: hello-unicode ( -- ) <hello-gadget> "გამარჯობა" open-window ;
+
+MAIN: hello-unicode
\ No newline at end of file
diff --git a/extra/hello-unicode/summary.txt b/extra/hello-unicode/summary.txt
new file mode 100644 (file)
index 0000000..d24c076
--- /dev/null
@@ -0,0 +1 @@
+Modern "Hello world" which demonstrates various Unicode scripts
diff --git a/extra/hello-unicode/tags.txt b/extra/hello-unicode/tags.txt
new file mode 100644 (file)
index 0000000..cb5fc20
--- /dev/null
@@ -0,0 +1 @@
+demos
index 1d4de79f07648e7539953b35435ce92995b0b564..faed31a0e5db95178796e408ddc066e2617e39be 100644 (file)
@@ -16,7 +16,7 @@ M: image-gadget pref-dim*
     [ bitmap>> ] bi glDrawPixels ;
 
 M: image-gadget draw-gadget* ( gadget -- )
-    origin get [ image>> draw-image ] with-translation ;
+    image>> draw-image ;
 
 : <image-gadget> ( image -- gadget )
     \ image-gadget new-gadget
index cd9eea140937d3112b9ab39c0450178ad39544aa..63f91ffc78d236c7bafd187a74c0da23a1dd0dbd 100644 (file)
@@ -1,5 +1,6 @@
 USING: iokit alien alien.syntax alien.c-types kernel
-system core-foundation ;
+system core-foundation core-foundation.data
+core-foundation.dictionaries ;
 IN: iokit.hid
 
 CONSTANT: kIOHIDDeviceKey "IOHIDDevice"
index 12eb6d6e92ed1c91397a35dd44d85a1f5613f5ef..f7ea81c0c227c6bf3bcaff38d1c3360928007c05 100755 (executable)
@@ -1,6 +1,6 @@
 USING: alien.syntax alien.c-types core-foundation
-core-foundation.bundles system combinators kernel sequences
-debugger io accessors ;
+core-foundation.bundles core-foundation.dictionaries system
+combinators kernel sequences debugger io accessors ;
 IN: iokit
 
 <<
index 188095dd2ec56d54952b91c109534861a52897b6..c7a774af3157b969df62f74b7e92bcbf4820a051 100755 (executable)
@@ -67,7 +67,7 @@ CONSTANT: pov-polygons
     pov-polygons [ add-pov-gadget ] assoc-map >>pov ;
 
 : <axis-gadget> ( -- gadget )
-    axis-gadget new-gadget
+    axis-gadget new
     add-pov-gadgets
     black <indicator-gadget> [ >>z-indicator ] [ add-gadget ] bi
     red   <indicator-gadget> [ >>indicator   ] [ add-gadget ] bi
@@ -76,7 +76,7 @@ CONSTANT: pov-polygons
 TUPLE: joystick-demo-gadget < pack axis raxis controller buttons alarm ;
 
 : add-gadget-with-border ( parent child -- parent )
-    2 <border> gray <solid> >>boundary add-gadget ;
+    { 2 2 } <border> gray <solid> >>boundary add-gadget ;
 
 : add-controller-label ( gadget controller -- gadget )
     [ >>controller ] [ product-string <label> add-gadget ] bi ;
@@ -97,7 +97,7 @@ TUPLE: joystick-demo-gadget < pack axis raxis controller buttons alarm ;
     [ (add-button-gadgets) ] 2keep ;
 
 : <joystick-demo-gadget> ( controller -- gadget )
-    joystick-demo-gadget new-gadget
+    joystick-demo-gadget new
     { 0 1 } >>orientation
     swap add-controller-label
     <shelf> add-axis-gadget add-raxis-gadget add-gadget
index acf20f90ab1f3866556e1be2b5e3168cc1dd7f24..8b97fc54b5d98ca93af35fe4909fc9bb75b41b40 100755 (executable)
@@ -151,7 +151,7 @@ TUPLE: key-caps-gadget < gadget keys alarm ;
     [ >>keys ] tri ;
 
 : <key-caps-gadget> ( -- gadget )
-    key-caps-gadget new-gadget
+    key-caps-gadget new
     add-keys-gadgets ;
 
 M: key-caps-gadget pref-dim* drop KEYBOARD-SIZE ;
@@ -174,7 +174,7 @@ M: key-caps-gadget handle-gesture
 : key-caps ( -- )
     [
         open-game-input
-        <key-caps-gadget> 5 <border> "Key Caps" open-window
+        <key-caps-gadget> { 5 5 } <border> "Key Caps" open-window
     ] with-ui ;
 
 MAIN: key-caps
index 8123576f5e9524d0031b21b59b30cccaae47f64e..b7a3235ea8148cd76c8af3191683f0ca970a129b 100755 (executable)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors sequences kernel math io calendar grouping
-calendar.format calendar.model arrays models models.filter
+calendar.format calendar.model arrays models models.arrow
 namespaces ui.gadgets ui.gadgets.labels ui.gadgets.theme ui ;
 IN: lcd
 
@@ -24,8 +24,8 @@ IN: lcd
     3array [ pad-00 ] map ":" join ;
 
 : <time-display> ( timestamp -- gadget )
-    [ hh:mm:ss lcd ] <filter> <label-control>
-    "99:99:99" lcd over set-label-string
+    [ hh:mm:ss lcd ] <arrow> <label-control>
+    "99:99:99" lcd >>string
     monospace-font >>font ;
 
 : time-window ( -- )
index a490a8bbfca064f93ee5e41afce1c1eba42e1011..14bbc5822eeffbd7cf8706ec47b8ba16d47ffe80 100644 (file)
@@ -1,7 +1,7 @@
 ! From http://www.ffconsultancy.com/ocaml/maze/index.html
 USING: sequences namespaces math math.vectors opengl opengl.gl
 arrays kernel random ui ui.gadgets ui.gadgets.canvas ui.render
-math.order math.geometry.rect ;
+math.order math.rectangles ;
 IN: maze
 
 CONSTANT: line-width 8
@@ -53,7 +53,7 @@ TUPLE: maze < canvas ;
 
 : <maze> ( -- gadget ) maze new-canvas ;
 
-: n ( gadget -- n ) rect-dim first2 min line-width /i ;
+: n ( gadget -- n ) dim>> first2 min line-width /i ;
 
 M: maze layout* delete-canvas-dlist ;
 
index fdb53ef2541f2a7360d6c44d2b8f3be7394fa55f..1a77b501f0d561d31721da7d0af6557606901ba3 100644 (file)
@@ -8,7 +8,7 @@ CONSTANT: width 256
 CONSTANT: height 256
 
 : <nehe2-gadget> (  -- gadget )
-  nehe2-gadget new-gadget ;
+  nehe2-gadget new ;
 
 M: nehe2-gadget pref-dim* ( gadget -- dim )
   drop width height 2array ;
index 557655a02917ec83016ba2097fc867063bed2cf9..228107618b43146b31b7b0fa37842400eb9d427a 100644 (file)
@@ -8,7 +8,7 @@ CONSTANT: width 256
 CONSTANT: height 256
 
 : <nehe3-gadget> (  -- gadget )
-  nehe3-gadget new-gadget ;
+  nehe3-gadget new ;
 
 M: nehe3-gadget pref-dim* ( gadget -- dim )
   drop width height 2array ;
index 00308277ea8c6cb933ca90ba03e01f4ff4d84847..63d334510a604459c01a680f6457a38815b54631 100644 (file)
@@ -10,7 +10,7 @@ CONSTANT: height 256
 : redraw-interval ( -- dt ) 10 milliseconds ;
 
 : <nehe4-gadget> (  -- gadget )
-  nehe4-gadget new-gadget
+  nehe4-gadget new
     0.0 >>rtri
     0.0 >>rquad ;
 
index 3723014c83b5e060b889fc4f1e7737dab85acf4b..60662b9e0fc3b35d2147f646bdc520fb47620518 100755 (executable)
@@ -9,7 +9,7 @@ CONSTANT: height 256
 : redraw-interval ( -- dt ) 10 milliseconds ;\r
 \r
 : <nehe5-gadget> (  -- gadget )\r
-  nehe5-gadget new-gadget\r
+  nehe5-gadget new\r
     0.0 >>rtri\r
     0.0 >>rquad ;\r
 \r
index 9f05482b30f75f161d279ccc9ec023a8f8987799..845c39ab75c4aaa2449816463c6362728f2969ed 100755 (executable)
@@ -12,7 +12,7 @@ SYMBOL: last-drag-loc
 TUPLE: demo-gadget < gadget yaw pitch distance ;
 
 : new-demo-gadget ( yaw pitch distance class -- gadget )
-    new-gadget
+    new
         swap >>distance
         swap >>pitch
         swap >>yaw ;
index 7b0d3772a082ecd5987a80d684f185aa4a5241ef..757981bb1132892345ee3b1b0e67b8b985356146 100644 (file)
@@ -1,4 +1,4 @@
-USING: arrays assocs help.markup help.syntax math.geometry.rect quadtrees quotations sequences ;
+USING: arrays assocs help.markup help.syntax math.rectangles quadtrees quotations sequences ;
 IN: quadtrees
 
 ARTICLE: "quadtrees" "Quadtrees"
index 7a17c1fb442e809aff62a3e20d276359471c57d4..993389a4b4acbdea3a0a0f4e2664c2f2717999fb 100644 (file)
@@ -1,5 +1,5 @@
 ! (c) 2009 Joe Groff, see BSD license
-USING: accessors assocs kernel tools.test quadtrees math.geometry.rect sorting ;
+USING: accessors assocs kernel tools.test quadtrees math.rectangles sorting ;
 IN: quadtrees.tests
 
 : unit-bounds ( -- rect ) { -1.0 -1.0 } { 2.0 2.0 } <rect> ;
index d9bdbe4aebc9e27e40490fdf623654fcf7904c02..1a916c74f4aa79ef01c03a29b26982add1842006 100644 (file)
@@ -1,7 +1,6 @@
 ! (c) 2009 Joe Groff, see BSD license
-USING: assocs kernel math.geometry.rect combinators accessors
-math.vectors vectors sequences math math.points math.geometry
-combinators.short-circuit arrays fry ;
+USING: assocs kernel math.rectangles combinators accessors
+math.vectors vectors sequences math combinators.short-circuit arrays fry ;
 IN: quadtrees
 
 TUPLE: quadtree { bounds rect } point value ll lr ul ur leaf? ;
@@ -12,9 +11,9 @@ TUPLE: quadtree { bounds rect } point value ll lr ul ur leaf? ;
         t >>leaf? ;
 
 : rect-ll ( rect -- point ) loc>> ;
-: rect-lr ( rect -- point ) [ loc>> ] [ width  ] bi v+x ;
-: rect-ul ( rect -- point ) [ loc>> ] [ height ] bi v+y ;
-: rect-ur ( rect -- point ) [ loc>> ] [ dim>>  ] bi v+  ;
+: rect-lr ( rect -- point ) [ loc>> ] [ dim>> { 1 0 } v* ] bi v+ ;
+: rect-ul ( rect -- point ) [ loc>> ] [ dim>> { 0 1 } v* ] bi v+ ;
+: rect-ur ( rect -- point ) [ loc>> ] [ dim>>  ] bi v+ ;
 
 : rect-center ( rect -- point ) [ loc>> ] [ dim>> 0.5 v*n ] bi v+ ; inline
 
@@ -100,12 +99,12 @@ DEFER: in-rect*
     dup leaf?>> [ leaf-at-point ] [ node-at-point ] if ;
 
 : (node-in-rect*) ( values rect node -- values )
-    2dup bounds>> intersects? [ in-rect* ] [ 2drop ] if ;
+    2dup bounds>> contains-rect? [ in-rect* ] [ 2drop ] if ;
 : node-in-rect* ( values rect node -- values )
     [ (node-in-rect*) ] with each-quadrant ;
 
 : leaf-in-rect* ( values rect leaf -- values ) 
-    tuck { [ nip point>> ] [ point>> swap intersects? ] } 2&&
+    tuck { [ nip point>> ] [ point>> swap contains-point? ] } 2&&
     [ value>> over push ] [ drop ] if ;
 
 : in-rect* ( values rect tree -- values )
index ba21ba9c84180d87e78e6c25a7cfcf6f5cb33b13..4b2725fd97a2265c3fbfae383878e6f3603c04f0 100755 (executable)
@@ -77,7 +77,7 @@ CONSTANT: stylesheet
 TUPLE: slides < book ;
 
 : <slides> ( slides -- gadget )
-    [ <page> ] map 0 <model> slides new-book ;
+    0 <model> slides new-book [ <page> add-gadget ] reduce ;
 
 : change-page ( book n -- )
     over control-value + over children>> length rem
index 5c819f6e697ea74d78b2f63b31cfaf2db29f9d6f..66f69bb0533d9c88b5426b6dc50cc335c8150506 100644 (file)
@@ -1,12 +1,12 @@
 ! Copyright (C) 2006, 2007, 2008 Alex Chapman
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alarms arrays calendar kernel make math math.geometry.rect math.parser namespaces sequences system tetris.game tetris.gl ui.gadgets ui.gadgets.labels ui.gadgets.worlds ui.gadgets.status-bar ui.gestures ui.render ui ;
+USING: accessors alarms arrays calendar kernel make math math.rectangles math.parser namespaces sequences system tetris.game tetris.gl ui.gadgets ui.gadgets.labels ui.gadgets.worlds ui.gadgets.status-bar ui.gestures ui.render ui ;
 IN: tetris
 
 TUPLE: tetris-gadget < gadget { tetris tetris } { alarm } ;
 
 : <tetris-gadget> ( tetris -- gadget )
-    tetris-gadget new-gadget swap >>tetris ;
+    tetris-gadget new swap >>tetris ;
 
 M: tetris-gadget pref-dim* drop { 200 400 } ;
 
@@ -18,7 +18,7 @@ M: tetris-gadget pref-dim* drop { 200 400 } ;
 
 M: tetris-gadget draw-gadget* ( gadget -- )
     [
-        dup rect-dim [ first ] [ second ] bi rot tetris>> draw-tetris
+        [ dim>> first2 ] [ tetris>> ] bi draw-tetris
     ] keep update-status ;
 
 : new-tetris ( gadget -- gadget )
diff --git a/extra/ui/gadgets/broken/broken.factor b/extra/ui/gadgets/broken/broken.factor
deleted file mode 100644 (file)
index d282e41..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-! Copyright (C) 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: kernel accessors ui ui.gadgets ui.gadgets.buttons ui.render ;
-IN: ui.gadgets.broken
-
-! An intentionally broken gadget -- used to test UI error handling,
-! make sure that one bad gadget doesn't bring the whole system down
-
-: <bad-button> ( -- button )
-    "Click me if you dare"
-    [ "Haha" throw ]
-    <bevel-button> ;
-
-TUPLE: bad-gadget < gadget ;
-
-M: bad-gadget draw-gadget* "Lulz" throw ;
-
-M: bad-gadget pref-dim* drop { 100 100 } ;
-
-: <bad-gadget> ( -- gadget ) bad-gadget new-gadget ;
-
-: bad-gadget-test ( -- )
-    <bad-button> "Test 1" open-window
-    <bad-gadget> "Test 2" open-window ;
-
-MAIN: bad-gadget-test
diff --git a/extra/ui/gadgets/lists/authors.txt b/extra/ui/gadgets/lists/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/extra/ui/gadgets/lists/lists-docs.factor b/extra/ui/gadgets/lists/lists-docs.factor
new file mode 100644 (file)
index 0000000..9003836
--- /dev/null
@@ -0,0 +1,32 @@
+USING: ui.commands help.markup help.syntax ui.gadgets
+ui.gadgets.presentations ui.operations kernel models classes ;
+IN: ui.gadgets.lists
+
+HELP: +secondary+
+{ $description "A key which may be set in the hashtable passed to " { $link define-operation } ". If set to a true value, this operation becomes the default operation performed when " { $snippet "RET" } " is pressed in a " { $link list } " gadget where the current selection is a presentation matching the operation's predicate." } ;
+
+HELP: list
+{ $class-description
+    "A list control is backed by a " { $link model } " holding a sequence of objects, and displays as a list of " { $link presentation } " instances of these objects."
+    $nl
+    "Lists are created by calling " { $link <list> } "."
+    { $command-map list "keyboard-navigation" }
+} ;
+
+HELP: <list>
+{ $values { "hook" { $quotation "( list -- )" } } { "presenter" { $quotation "( object -- label )" } } { "model" model } { "gadget" list } }
+{ $description "Creates a new " { $link list } "."
+$nl
+"The model value must be a sequence. The list displays presentations of elements with labels obtained by applying the " { $snippet "presenter" } " quotation to each object. The " { $snippet "hook" } " quotation is called when a presentation is selected." } ;
+
+HELP: list-value
+{ $values { "list" list } { "object" object } }
+{ $description "Outputs the currently selected list value." } ;
+
+ARTICLE: "ui.gadgets.lists" "List gadgets"
+"The " { $vocab-link "ui.gadgets.lists" } " vocabulary implements lists, which displays a list of presentations (see " { $link "ui.gadgets.presentations" } ")."
+{ $subsection list }
+{ $subsection <list> }
+{ $subsection list-value } ;
+
+ABOUT: "ui.gadgets.lists"
diff --git a/extra/ui/gadgets/lists/lists-tests.factor b/extra/ui/gadgets/lists/lists-tests.factor
new file mode 100644 (file)
index 0000000..bf2ad72
--- /dev/null
@@ -0,0 +1,5 @@
+IN: ui.gadgets.lists.tests
+USING: ui.gadgets.lists models prettyprint math tools.test
+kernel ;
+
+[ ] [ [ drop ] [ 3 + . ] f <model> <list> invoke-value-action ] unit-test
diff --git a/extra/ui/gadgets/lists/lists.factor b/extra/ui/gadgets/lists/lists.factor
new file mode 100644 (file)
index 0000000..a22435a
--- /dev/null
@@ -0,0 +1,128 @@
+! Copyright (C) 2006, 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors math.vectors classes.tuple math.rectangles colors
+kernel sequences models opengl math math.order namespaces
+ui.commands ui.gestures ui.render ui.gadgets
+ui.gadgets.labels ui.gadgets.scrollers
+ui.gadgets.presentations ui.gadgets.viewports ui.gadgets.packs
+ui.gadgets.theme ;
+IN: ui.gadgets.lists
+
+TUPLE: list < pack index presenter color hook ;
+
+: list-theme ( list -- list )
+    selection-color >>color ; inline
+
+: <list> ( hook presenter model -- gadget )
+    list new-gadget
+        { 0 1 } >>orientation
+        1 >>fill
+        0 >>index
+        swap >>model
+        swap >>presenter
+        swap >>hook
+        list-theme ;
+
+: calc-bounded-index ( n list -- m )
+    control-value length 1- min 0 max ;
+
+: bound-index ( list -- )
+    dup index>> over calc-bounded-index >>index drop ;
+
+: list-presentation-hook ( list -- quot )
+    hook>> [ [ list? ] find-parent ] prepend ;
+
+: <list-presentation> ( hook elt presenter -- gadget )
+    keep [ >label text-theme ] dip
+    <presentation>
+    swap >>hook ; inline
+
+: <list-items> ( list -- seq )
+    [ list-presentation-hook ]
+    [ presenter>> ]
+    [ control-value ]
+    tri [
+        [ 2dup ] dip swap <list-presentation>
+    ] map 2nip ;
+
+M: list model-changed
+    nip
+    dup clear-gadget
+    dup <list-items> add-gadgets
+    bound-index ;
+
+: selected-rect ( list -- rect )
+    dup index>> swap children>> ?nth ;
+
+M: list draw-gadget*
+    origin get [
+        dup color>> gl-color
+        selected-rect [
+            dup loc>> [
+                dim>> gl-fill-rect
+            ] with-translation
+        ] when*
+    ] with-translation ;
+
+M: list focusable-child* drop t ;
+
+: list-value ( list -- object )
+    dup index>> swap control-value ?nth ;
+
+: scroll>selected ( list -- )
+    #! We change the rectangle's width to zero to avoid
+    #! scrolling right.
+    [ selected-rect rect-bounds { 0 1 } v* <rect> ] keep
+    scroll>rect ;
+
+: list-empty? ( list -- ? ) control-value empty? ;
+
+: select-index ( n list -- )
+    dup list-empty? [
+        2drop
+    ] [
+        tuck control-value length rem >>index
+        [ relayout-1 ] [ scroll>selected ] bi
+    ] if ;
+
+: select-previous ( list -- )
+    [ index>> 1- ] keep select-index ;
+
+: select-next ( list -- )
+    [ index>> 1+ ] keep select-index ;
+
+: invoke-value-action ( list -- )
+    dup list-empty? [
+        dup hook>> call
+    ] [
+        [ index>> ] keep nth-gadget invoke-secondary
+    ] if ;
+
+: select-gadget ( gadget list -- )
+    tuck children>> index
+    [ swap select-index ] [ drop ] if* ;
+
+: clamp-loc ( point max -- point )
+    vmin { 0 0 } vmax ;
+
+: select-at ( point list -- )
+    [ dim>> clamp-loc ] keep
+    [ pick-up ] keep
+    select-gadget ;
+
+: list-page ( list vec -- )
+    [ dup selected-rect rect-bounds 2 v/n v+ over visible-dim ] dip
+    v* v+ swap select-at ;
+
+: list-page-up ( list -- ) { 0 -1 } list-page ;
+
+: list-page-down ( list -- ) { 0 1 } list-page ;
+
+list "keyboard-navigation" "Lists can be navigated from the keyboard." {
+    { T{ button-down } request-focus }
+    { T{ key-down f f "UP" } select-previous }
+    { T{ key-down f f "DOWN" } select-next }
+    { T{ key-down f f "PAGE_UP" } list-page-up }
+    { T{ key-down f f "PAGE_DOWN" } list-page-down }
+    { T{ key-down f f "RET" } invoke-value-action }
+} define-command-map
diff --git a/extra/ui/gadgets/lists/summary.txt b/extra/ui/gadgets/lists/summary.txt
new file mode 100644 (file)
index 0000000..f0b84e7
--- /dev/null
@@ -0,0 +1 @@
+List gadgets display a keyboard-navigatable list of presentations
index 0113e01ba73884e55f13fa851470f8ac96565f49..62765ec45c20fff783cc92ec24154303c4a80d26 100755 (executable)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.\r
 \r
 USING: accessors kernel fry math math.vectors sequences arrays vectors assocs\r
-       hashtables models models.range models.compose combinators\r
+       hashtables models models.range models.product combinators\r
        ui ui.gadgets ui.gadgets.buttons ui.gadgets.frames ui.gadgets.packs\r
        ui.gadgets.grids ui.gadgets.viewports ui.gadgets.books locals ;\r
 \r
index bd3c0826529cafaf6612aa8e172f7f236bb1d743..1aa892557f92cad6227c8c7a7f1465a01cc3fb0e 100755 (executable)
@@ -1,10 +1,10 @@
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors colors arrays kernel sequences math byte-arrays
-namespaces grouping fry cap images.bitmap
-ui.gadgets ui.gadgets.packs ui.gadgets.borders ui.gadgets.grids
-ui.gadgets.grid-lines ui.gadgets.labels ui.gadgets.buttons
-ui.render ui opengl opengl.gl images images.loader ;
+namespaces grouping fry cap images.bitmap ui.gadgets ui.gadgets.packs
+ui.gadgets.borders ui.gadgets.grids ui.gadgets.grid-lines
+ui.gadgets.labels ui.gadgets.buttons ui.pens ui.pens.solid ui.render
+ui opengl opengl.gl colors.constants images images.loader ;
 IN: ui.render.test
 
 SINGLETON: line-test
@@ -30,8 +30,10 @@ SYMBOL: render-output
 
 : bitmap= ( bitmap1 bitmap2 -- ? )
     [
-        [ [ buffer>> ] [ stride 4 align ] bi group ] [ stride ] bi
-        '[ _ head twiddle ] map
+        dup [ [ height>> ] [ stride ] bi * ] [ array>> length ] bi = [
+            [ [ array>> ] [ stride 4 align ] bi group ] [ stride ] bi
+            '[ _ head twiddle ] map
+        ] unless
     ] bi@ = ;
 
 : check-rendering ( gadget -- )
@@ -57,27 +59,27 @@ M: take-screenshot draw-boundary
     <shelf>
         take-screenshot new >>boundary
         <gadget>
-            black <solid> >>interior
+            COLOR: black <solid> >>interior
             { 98 98 } >>dim
-        1 <border> add-gadget
+        { 1 1 } <border> add-gadget
         <gadget>
-            gray <solid> >>boundary
+            COLOR: gray <solid> >>boundary
             { 94 94 } >>dim
-        3 <border>
-            red <solid> >>boundary
+        { 3 3 } <border>
+            COLOR: red <solid> >>boundary
         add-gadget
             <line-gadget> <line-gadget> <line-gadget> 3array
             <line-gadget> <line-gadget> <line-gadget> 3array
             <line-gadget> <line-gadget> <line-gadget> 3array
         3array <grid>
             { 5 5 } >>gap
-            blue <grid-lines> >>boundary
+            COLOR: blue <grid-lines> >>boundary
         add-gadget
         <gadget>
             { 14 14 } >>dim
-            black <checkmark-paint> >>interior
-            black <solid> >>boundary
-        4 <border>
+            COLOR: black <checkmark-paint> >>interior
+            COLOR: black <solid> >>boundary
+        { 4 4 } <border>
         add-gadget ;
     
 : ui-render-test ( -- )
diff --git a/fonts/Vera.ttf b/fonts/Vera.ttf
deleted file mode 100644 (file)
index 58cd6b5..0000000
Binary files a/fonts/Vera.ttf and /dev/null differ
diff --git a/fonts/VeraBI.ttf b/fonts/VeraBI.ttf
deleted file mode 100644 (file)
index b55eee3..0000000
Binary files a/fonts/VeraBI.ttf and /dev/null differ
diff --git a/fonts/VeraBd.ttf b/fonts/VeraBd.ttf
deleted file mode 100644 (file)
index 51d6111..0000000
Binary files a/fonts/VeraBd.ttf and /dev/null differ
diff --git a/fonts/VeraIt.ttf b/fonts/VeraIt.ttf
deleted file mode 100644 (file)
index cc23c9e..0000000
Binary files a/fonts/VeraIt.ttf and /dev/null differ
diff --git a/fonts/VeraMoBI.ttf b/fonts/VeraMoBI.ttf
deleted file mode 100644 (file)
index 8624542..0000000
Binary files a/fonts/VeraMoBI.ttf and /dev/null differ
diff --git a/fonts/VeraMoBd.ttf b/fonts/VeraMoBd.ttf
deleted file mode 100644 (file)
index 9be6547..0000000
Binary files a/fonts/VeraMoBd.ttf and /dev/null differ
diff --git a/fonts/VeraMoIt.ttf b/fonts/VeraMoIt.ttf
deleted file mode 100644 (file)
index 2404924..0000000
Binary files a/fonts/VeraMoIt.ttf and /dev/null differ
diff --git a/fonts/VeraMono.ttf b/fonts/VeraMono.ttf
deleted file mode 100644 (file)
index 139f0b4..0000000
Binary files a/fonts/VeraMono.ttf and /dev/null differ
diff --git a/fonts/VeraSe.ttf b/fonts/VeraSe.ttf
deleted file mode 100644 (file)
index 4b4ecc6..0000000
Binary files a/fonts/VeraSe.ttf and /dev/null differ
diff --git a/fonts/VeraSeBd.ttf b/fonts/VeraSeBd.ttf
deleted file mode 100644 (file)
index 672bf76..0000000
Binary files a/fonts/VeraSeBd.ttf and /dev/null differ
diff --git a/unmaintained/pango/cairo/cairo.factor b/unmaintained/pango/cairo/cairo.factor
deleted file mode 100644 (file)
index 1ff5328..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-! Copyright (C) 2008 Matthew Willis.
-! See http://factorcode.org/license.txt for BSD license.
-!
-! pangocairo bindings, from pango/pangocairo.h
-USING: cairo.ffi alien.c-types math
-alien.syntax system combinators alien
-memoize
-arrays pango pango.fonts ;
-IN: pango.cairo
-
-<< "pangocairo" {
-    { [ os winnt? ] [ "libpangocairo-1.0-0.dll" ] }
-    { [ os macosx? ] [ "libpangocairo-1.0.0.dylib" ] }
-    { [ os unix? ] [ "libpangocairo-1.0.so" ] }
-} cond "cdecl" add-library >>
-
-LIBRARY: pangocairo
-
-FUNCTION: PangoFontMap*
-pango_cairo_font_map_new  ( ) ;
-
-FUNCTION: PangoFontMap*
-pango_cairo_font_map_new_for_font_type ( cairo_font_type_t fonttype ) ;
-
-FUNCTION: PangoFontMap*
-pango_cairo_font_map_get_default ( ) ;
-
-FUNCTION: cairo_font_type_t
-pango_cairo_font_map_get_font_type ( PangoCairoFontMap* fontmap ) ;
-
-FUNCTION: void
-pango_cairo_font_map_set_resolution ( PangoCairoFontMap* fontmap, double dpi ) ;
-
-FUNCTION: double
-pango_cairo_font_map_get_resolution ( PangoCairoFontMap* fontmap ) ;
-
-FUNCTION: PangoContext*
-pango_cairo_font_map_create_context ( PangoCairoFontMap* fontmap ) ;
-
-FUNCTION: cairo_scaled_font_t*
-pango_cairo_font_get_scaled_font ( PangoCairoFont* font ) ;
-
-! Update a Pango context for the current state of a cairo context
-FUNCTION: void
-pango_cairo_update_context ( cairo_t* cr, PangoContext* context ) ;
-
-FUNCTION: void
-pango_cairo_context_set_font_options ( PangoContext* context, cairo_font_options_t* options ) ;
-
-FUNCTION: cairo_font_options_t*
-pango_cairo_context_get_font_options ( PangoContext* context ) ;
-
-FUNCTION: void
-pango_cairo_context_set_resolution ( PangoContext* context, double dpi ) ;
-
-FUNCTION: double
-pango_cairo_context_get_resolution ( PangoContext* context ) ;
-
-! Convenience
-FUNCTION: PangoLayout*
-pango_cairo_create_layout ( cairo_t* cr ) ;
-
-FUNCTION: void
-pango_cairo_update_layout ( cairo_t* cr, PangoLayout* layout ) ;
-
-! Rendering
-FUNCTION: void
-pango_cairo_show_glyph_string ( cairo_t* cr, PangoFont* font, PangoGlyphString* glyphs ) ;
-
-FUNCTION: void
-pango_cairo_show_layout_line ( cairo_t* cr, PangoLayoutLine* line ) ;
-
-FUNCTION: void
-pango_cairo_show_layout ( cairo_t* cr, PangoLayout* layout ) ;
-
-FUNCTION: void
-pango_cairo_show_error_underline ( cairo_t* cr, double x, double y, double width, double height ) ;
-
-! Rendering to a path
-FUNCTION: void
-pango_cairo_glyph_string_path ( cairo_t* cr, PangoFont* font, PangoGlyphString* glyphs ) ;
-
-FUNCTION: void
-pango_cairo_layout_line_path  ( cairo_t* cr, PangoLayoutLine* line ) ;
-
-FUNCTION: void
-pango_cairo_layout_path ( cairo_t* cr, PangoLayout* layout ) ;
-
-FUNCTION: void
-pango_cairo_error_underline_path ( cairo_t* cr, double x, double y, double width, double height ) ;
-
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-! Higher level words and combinators
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-USING: pango.layouts
-destructors accessors namespaces kernel cairo ;
-
-: (with-pango) ( layout quot -- )
-    >r alien>> pango-layout r> with-variable ; inline
-
-: with-pango-cairo ( quot -- )
-    cr pango_cairo_create_layout swap with-layout ; inline
-
-MEMO: dummy-cairo ( -- cr )
-    CAIRO_FORMAT_ARGB32 0 0 cairo_image_surface_create cairo_create ;
-
-: dummy-pango ( quot -- )
-    >r dummy-cairo cairo r> [ with-pango-cairo ] curry with-variable ; inline
-
-: layout-size ( quot -- dim )
-    [ layout pango-layout-get-pixel-size 2array ] compose dummy-pango ; inline
-
-: show-layout ( -- )
-    cr layout pango_cairo_show_layout ;
-
-: families ( -- families )
-    pango_cairo_font_map_get_default list-families ;
diff --git a/unmaintained/pango/cairo/gadgets/gadgets.factor b/unmaintained/pango/cairo/gadgets/gadgets.factor
deleted file mode 100644 (file)
index a21affc..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-! Copyright (C) 2008 Matthew Willis.
-! See http://factorcode.org/license.txt for BSD license.
-USING: pango.cairo pango.gadgets
-cairo.gadgets arrays namespaces
-fry accessors ui.gadgets
-sequences opengl.gadgets
-kernel pango.layouts ;
-
-IN: pango.cairo.gadgets
-
-TUPLE: pango-cairo-gadget < pango-gadget ;
-
-SINGLETON: pango-cairo-backend
-pango-cairo-backend pango-backend set-global
-
-M: pango-cairo-backend construct-pango
-    pango-cairo-gadget construct-gadget ;
-
-: setup-layout ( gadget -- quot )
-    [ font>> ] [ text>> ] bi
-    '[ , layout-font , layout-text ] ; inline
-
-M: pango-cairo-gadget render* ( gadget -- ) 
-    setup-layout [ layout-size dup ]
-    [ 
-        '[ [ @ show-layout ] with-pango-cairo ]
-    ] bi render-cairo render-bytes* ;
diff --git a/unmaintained/pango/cairo/samples/samples.factor b/unmaintained/pango/cairo/samples/samples.factor
deleted file mode 100644 (file)
index f081650..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-! Copyright (C) 2008 Matthew Willis.
-! See http://factorcode.org/license.txt for BSD license.
-USING: prettyprint sequences ui.gadgets.panes
-pango.cairo.gadgets math kernel cairo cairo.ffi
-pango.cairo pango.gadgets tools.time namespaces assocs
-threads io.backend io.encodings.utf8 io.files ;
-
-IN: pango.cairo.samples
-
-: hello-pango ( -- )
-    "monospace 10" "resource:extra/pango/cairo/gadgets/gadgets.factor"
-    normalize-path utf8 file-contents
-    <pango> gadget. ;
-
-: time-pango ( -- )
-    [ hello-pango ] time ;
-
-MAIN: time-pango
diff --git a/unmaintained/pango/fonts/fonts.factor b/unmaintained/pango/fonts/fonts.factor
deleted file mode 100644 (file)
index d07c712..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-! Copyright (C) 2008 Matthew Willis.
-! See http://factorcode.org/license.txt for BSD license
-USING: pango alien.syntax alien.c-types
-kernel ;
-IN: pango.fonts
-
-LIBRARY: pango
-
-FUNCTION: void
-pango_font_map_list_families ( PangoFontMap* fontmap, PangoFontFamily*** families, int* n_families ) ;
-
-FUNCTION: char*
-pango_font_family_get_name ( PangoFontFamily* family ) ;
-
-FUNCTION: int
-pango_font_family_is_monospace ( PangoFontFamily* family ) ;
-
-FUNCTION: void
-pango_font_family_list_faces ( PangoFontFamily* family, PangoFontFace*** faces, int* n_faces ) ;
-
-FUNCTION: char*
-pango_font_face_get_face_name ( PangoFontFace* face ) ;
-
-FUNCTION: void
-pango_font_face_list_sizes ( PangoFontFace* face, int** sizes, int* n_sizes ) ;
-
-: list-families ( PangoFontMap* -- PangoFontFamily*-seq )
-    0 <int> 0 <int> [ pango_font_map_list_families ] 2keep
-    *int swap *void* [ swap c-void*-array> ] [ g_free ] bi ;
-
-: list-faces ( PangoFontFamily* -- PangoFontFace*-seq )
-    0 <int> 0 <int> [ pango_font_family_list_faces ] 2keep
-    *int swap *void* [ swap c-void*-array> ] [ g_free ] bi ;
-
-: list-sizes ( PangoFontFace* -- ints )
-    0 <int> 0 <int> [ pango_font_face_list_sizes ] 2keep
-    *int swap *void* [ swap c-int-array> ] [ g_free ] bi ;
-
-: monospace? ( PangoFontFamily* -- ? )
-    pango_font_family_is_monospace 1 = ;
diff --git a/unmaintained/pango/ft2/ft2.factor b/unmaintained/pango/ft2/ft2.factor
deleted file mode 100644 (file)
index bb34bdd..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-USING: alien alien.c-types
-math kernel byte-arrays freetype
-opengl.gadgets accessors pango
-ui.gadgets memoize
-arrays sequences libc opengl.gl
-system combinators alien.syntax
-pango.layouts ;
-IN: pango.ft2
-
-<< "pangoft2" {
-    { [ os winnt? ] [ "libpangocairo-1.0-0.dll" ] }
-    { [ os macosx? ] [ "libpangocairo-1.0.0.dylib" ] }
-    { [ os unix? ] [ "libpangoft2-1.0.so" ] }
-} cond "cdecl" add-library >>
-
-LIBRARY: pangoft2
-
-FUNCTION: PangoFontMap*
-pango_ft2_font_map_new ( ) ;
-
-FUNCTION: PangoContext*
-pango_ft2_font_map_create_context ( PangoFT2FontMap* fontmap ) ;
-
-FUNCTION: void
-pango_ft2_render_layout ( FT_Bitmap* bitmap, PangoLayout* layout, int x, int y ) ;
-
-: 4*-ceil ( n -- k*4 )
-    3 + 4 /i 4 * ;
-
-: <ft-bitmap> ( width height -- ft-bitmap )
-    swap dup
-    2dup * 4*-ceil
-    "uchar" malloc-array
-    256
-    FT_PIXEL_MODE_GRAY
-    "FT_Bitmap" <c-object> dup >r
-    {
-        [ set-FT_Bitmap-pixel_mode ]
-        [ set-FT_Bitmap-num_grays  ]
-        [ set-FT_Bitmap-buffer     ]
-        [ set-FT_Bitmap-pitch      ]
-        [ set-FT_Bitmap-width      ]
-        [ set-FT_Bitmap-rows       ]
-    } cleave r> ;
-
-: render-layout ( layout -- dims alien )
-    [ 
-        pango-layout-get-pixel-size
-        2array dup 2^-bounds first2 <ft-bitmap> dup
-    ] [ 0 0 pango_ft2_render_layout ] bi FT_Bitmap-buffer ;
-
-MEMO: ft2-context ( -- PangoContext* )
-    pango_ft2_font_map_new pango_ft2_font_map_create_context ;
-
-: with-ft2-layout ( quot -- )
-    ft2-context pango_layout_new swap with-layout ; inline
diff --git a/unmaintained/pango/ft2/gadgets/gadgets.factor b/unmaintained/pango/ft2/gadgets/gadgets.factor
deleted file mode 100644 (file)
index 43ddc95..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-! Copyright (C) 2008 Matthew Willis.
-! See http://factorcode.org/license.txt for BSD license.
-USING: pango.ft2 pango.gadgets opengl.gadgets
-accessors kernel opengl.gl libc
-sequences namespaces ui.gadgets pango.layouts ;
-IN: pango.ft2.gadgets
-
-TUPLE: pango-ft2-gadget < pango-gadget ;
-
-SINGLETON: pango-ft2-backend
-pango-ft2-backend pango-backend set-global
-
-M: pango-ft2-backend construct-pango
-    pango-ft2-gadget construct-gadget ;
-
-M: pango-ft2-gadget render*
-    [
-        [ text>> layout-text ] [ font>> layout-font ] bi
-        layout render-layout
-    ] with-ft2-layout [ GL_ALPHA render-bytes* ] keep free ;
diff --git a/unmaintained/pango/gadgets/gadgets.factor b/unmaintained/pango/gadgets/gadgets.factor
deleted file mode 100644 (file)
index f9442a4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-! Copyright (C) 2008 Matthew Willis.
-! See http://factorcode.org/license.txt for BSD license.
-USING: opengl.gadgets kernel
-arrays
-accessors ;
-
-IN: pango.gadgets
-
-TUPLE: pango-gadget < texture-gadget text font ;
-
-M: pango-gadget cache-key* [ font>> ] [ text>> ] bi 2array ;
-
-SYMBOL: pango-backend
-HOOK: construct-pango pango-backend ( -- gadget )
-
-: <pango> ( font text -- gadget )
-    construct-pango
-        swap >>text
-        swap >>font ;
diff --git a/unmaintained/pango/layouts/layouts.factor b/unmaintained/pango/layouts/layouts.factor
deleted file mode 100644 (file)
index 71317ce..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-USING: alien alien.c-types 
-math
-destructors accessors namespaces
-pango kernel ;
-IN: pango.layouts
-
-: pango-layout-get-pixel-size ( layout -- width height )
-    0 <int> 0 <int> [ pango_layout_get_pixel_size ] 2keep
-    [ *int ] bi@ ;
-
-TUPLE: pango-layout alien ;
-C: <pango-layout> pango-layout
-M: pango-layout dispose ( alien -- ) alien>> g_object_unref ;
-
-: layout ( -- pango-layout ) pango-layout get ;
-
-: (with-layout) ( pango-layout quot -- )
-    >r alien>> pango-layout r> with-variable ; inline
-
-: with-layout ( layout quot -- )
-    >r <pango-layout> r> [ (with-layout) ] curry with-disposal ; inline
-
-: layout-font ( str -- )
-    pango_font_description_from_string
-    dup zero? [ "pango: not a valid font." throw ] when
-    layout over pango_layout_set_font_description
-    pango_font_description_free ;
-
-: layout-text ( str -- )
-    layout swap -1 pango_layout_set_text ;
diff --git a/unmaintained/pango/pango.factor b/unmaintained/pango/pango.factor
deleted file mode 100644 (file)
index be5c257..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-! Copyright (C) 2008 Matthew Willis.
-! See http://factorcode.org/license.txt for BSD license
-USING: system
-alien.c-types alien.syntax alien combinators ;
-IN: pango
-
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-! Helpful functions from other parts of pango
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-<< "pango" {
-    { [ os winnt? ] [ "libpango-1.0-0.dll" ] }
-    { [ os macosx? ] [ "libpango-1.0.0.dylib" ] }
-    { [ os unix? ] [ "libpango-1.0.so" ] }
-} cond "cdecl" add-library >>
-
-LIBRARY: pango
-
-: PANGO_SCALE 1024 ;
-
-FUNCTION: PangoLayout*
-pango_layout_new ( PangoContext* context ) ;
-
-FUNCTION: void
-pango_layout_set_text ( PangoLayout* layout, char* text, int length ) ;
-
-FUNCTION: char*
-pango_layout_get_text ( PangoLayout* layout ) ;
-
-FUNCTION: void
-pango_layout_get_size ( PangoLayout* layout, int* width, int* height ) ;
-
-FUNCTION: PangoFontDescription*
-pango_font_description_from_string ( char* str ) ;
-
-FUNCTION: char*
-pango_font_description_to_string ( PangoFontDescription* desc ) ;
-
-FUNCTION: char*
-pango_font_description_to_filename ( PangoFontDescription* desc ) ;
-
-FUNCTION: void
-pango_layout_set_font_description ( PangoLayout* layout, PangoFontDescription* desc ) ;
-
-FUNCTION: PangoFontDescription*
-pango_layout_get_font_description ( PangoLayout* layout ) ;
-
-FUNCTION: void
-pango_layout_get_pixel_size ( PangoLayout* layout, int* width, int* height ) ;
-
-FUNCTION: void
-pango_font_description_free ( PangoFontDescription* desc ) ;
-
-! glib functions
-
-TYPEDEF: void* gpointer
-
-FUNCTION: void
-g_object_unref ( gpointer object ) ;
-
-FUNCTION: void
-g_free ( gpointer mem ) ;
index a25d0df95e404e2544292d1bbd1be08e305f1af5..e8cb877249e1afeb02421f482540f1084b564e1d 100644 (file)
@@ -13,7 +13,7 @@ PLAF_EXE_OBJS += vm/main-unix.o
 ifdef NO_UI
        X11_UI_LIBS =
 else
-       X11_UI_LIBS = -lfreetype -lGL -lGLU -lX11
+       X11_UI_LIBS = -lpango-1.0 -lpangocairo-1.0 -lcairo -lglib-2.0 -lgobject-2.0 -lGL -lGLU -lX11
 endif
 
 # CFLAGS += -fPIC