From 7ad494d2dd2382e0711cff6f3d8cc32f2ad655e7 Mon Sep 17 00:00:00 2001 From: slava <slava@slava-laptop.(none)> Date: Sat, 13 Dec 2008 00:09:36 -0600 Subject: [PATCH 01/10] Add Display structure --- basis/x11/xlib/xlib.factor | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/basis/x11/xlib/xlib.factor b/basis/x11/xlib/xlib.factor index 555eb573fc..58b4995c40 100644 --- a/basis/x11/xlib/xlib.factor +++ b/basis/x11/xlib/xlib.factor @@ -31,7 +31,6 @@ TYPEDEF: XID KeySym TYPEDEF: ulong Atom TYPEDEF: char* XPointer -TYPEDEF: void* Display* TYPEDEF: void* Screen* TYPEDEF: void* GC TYPEDEF: void* Visual* @@ -66,6 +65,12 @@ TYPEDEF: void* Atom** ! 2 - Display Functions ! +! This struct is incomplete +C-STRUCT: Display +{ "void*" "ext_data" } +{ "void*" "free_funcs" } +{ "int" "fd" } ; + FUNCTION: Display* XOpenDisplay ( void* display_name ) ; ! 2.2 Obtaining Information about the Display, Image Formats, or Screens From 7bf857650c322290e5445e1d8113f4527f03adcf Mon Sep 17 00:00:00 2001 From: slava <slava@slava-laptop.(none)> Date: Sat, 13 Dec 2008 03:49:22 -0600 Subject: [PATCH 02/10] Remove stop-after-last-window? option, it's obsolete, get ui.event-loop (only used on X11 and Windows) to load --- basis/tools/deploy/shaker/strip-cocoa.factor | 4 ---- basis/ui/event-loop/event-loop.factor | 7 +++---- basis/ui/tools/deploy/deploy.factor | 5 ----- basis/ui/ui.factor | 3 --- basis/ui/windows/windows.factor | 1 - 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/basis/tools/deploy/shaker/strip-cocoa.factor b/basis/tools/deploy/shaker/strip-cocoa.factor index 773b2d0f3b..df64443b7b 100644 --- a/basis/tools/deploy/shaker/strip-cocoa.factor +++ b/basis/tools/deploy/shaker/strip-cocoa.factor @@ -19,12 +19,8 @@ IN: cocoa.application [ [ die ] 19 setenv ] "cocoa.application" add-init-hook -"stop-after-last-window?" get - H{ } clone \ pool [ global [ - "stop-after-last-window?" "ui" lookup set - ! Only keeps those methods that we actually call sent-messages get super-sent-messages get assoc-union objc-methods [ assoc-intersect pool-values ] change diff --git a/basis/ui/event-loop/event-loop.factor b/basis/ui/event-loop/event-loop.factor index fe6f4d7de5..7c08d802f5 100644 --- a/basis/ui/event-loop/event-loop.factor +++ b/basis/ui/event-loop/event-loop.factor @@ -1,12 +1,11 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: ui.backend kernel namespaces sequences deques calendar -threads ; +USING: calendar combinators deques kernel namespaces sequences +threads ui ui.backend ui.gadgets ; IN: ui.event-loop : event-loop? ( -- ? ) { - { [ stop-after-last-window? get not ] [ t ] } { [ graft-queue deque-empty? not ] [ t ] } { [ windows get-global empty? not ] [ t ] } [ f ] @@ -14,6 +13,6 @@ IN: ui.event-loop HOOK: do-events ui-backend ( -- ) -: event-loop ( quot -- ) [ event-loop? ] [ do-events ] [ ] while ; +: event-loop ( -- ) [ event-loop? ] [ do-events ] [ ] while ; : ui-wait ( -- ) 10 milliseconds sleep ; diff --git a/basis/ui/tools/deploy/deploy.factor b/basis/ui/tools/deploy/deploy.factor index f233c9f162..38db81c3dc 100644 --- a/basis/ui/tools/deploy/deploy.factor +++ b/basis/ui/tools/deploy/deploy.factor @@ -18,10 +18,6 @@ TUPLE: deploy-gadget < pack vocab settings ; deploy-ui? get "Include user interface framework" <checkbox> add-gadget ; -: exit-when-windows-closed ( parent -- parent ) - "stop-after-last-window?" get - "Exit when last UI window closed" <checkbox> add-gadget ; - : io-settings ( parent -- parent ) "Input/output support:" <label> add-gadget deploy-io get deploy-io-options <radio-buttons> add-gadget ; @@ -50,7 +46,6 @@ TUPLE: deploy-gadget < pack vocab settings ; <pile> bundle-name deploy-ui - os macosx? [ exit-when-windows-closed ] when io-settings reflection-settings advanced-settings diff --git a/basis/ui/ui.factor b/basis/ui/ui.factor index b6bc172c21..37ce4ea499 100644 --- a/basis/ui/ui.factor +++ b/basis/ui/ui.factor @@ -10,8 +10,6 @@ IN: ui ! Assoc mapping aliens to gadgets SYMBOL: windows -SYMBOL: stop-after-last-window? - : window ( handle -- world ) windows get-global at ; : window-focus ( handle -- gadget ) window world-focus ; @@ -207,7 +205,6 @@ MAIN: ui f windows set-global [ ui-hook set - stop-after-last-window? on ui ] with-scope ] if ; diff --git a/basis/ui/windows/windows.factor b/basis/ui/windows/windows.factor index 7f68bb5736..525aca21ab 100755 --- a/basis/ui/windows/windows.factor +++ b/basis/ui/windows/windows.factor @@ -574,7 +574,6 @@ M: windows-ui-backend set-title ( string world -- ) M: windows-ui-backend ui [ [ - stop-after-last-window? on init-clipboard init-win32-ui start-ui From 93b7215f1b0b83990aecb1a1fff8f3dc1af40e74 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Sat, 13 Dec 2008 04:10:39 -0600 Subject: [PATCH 03/10] Returning from boot quotation wouldn't exit Factor if run loop MX was in use --- basis/bootstrap/finish-bootstrap.factor | 1 + basis/bootstrap/finish-staging.factor | 1 + basis/tools/deploy/shaker/shaker.factor | 1 + 3 files changed, 3 insertions(+) diff --git a/basis/bootstrap/finish-bootstrap.factor b/basis/bootstrap/finish-bootstrap.factor index 133b64acaa..36f6291bc6 100644 --- a/basis/bootstrap/finish-bootstrap.factor +++ b/basis/bootstrap/finish-bootstrap.factor @@ -12,5 +12,6 @@ namespaces eval kernel vocabs.loader io ; ignore-cli-args? not script get and [ run-script ] [ "run" get run ] if* output-stream get [ stream-flush ] when* + 0 exit ] [ print-error 1 exit ] recover ] set-boot-quot diff --git a/basis/bootstrap/finish-staging.factor b/basis/bootstrap/finish-staging.factor index a60ce04e15..49f504fd41 100644 --- a/basis/bootstrap/finish-staging.factor +++ b/basis/bootstrap/finish-staging.factor @@ -7,4 +7,5 @@ io ; (command-line) parse-command-line "run" get run output-stream get [ stream-flush ] when* + 0 exit ] set-boot-quot diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index 3d4944841d..135679444b 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -365,6 +365,7 @@ SYMBOL: deploy-vocab init-hooks get values concat % , strip-io? [ \ flush , ] unless + [ 0 exit ] % ] [ ] make set-boot-quot ; From c8ba693da7dc3ea29d235180fc6885f36bbe8598 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Sat, 13 Dec 2008 04:20:46 -0600 Subject: [PATCH 04/10] Remove stop-after-last-window? usage in ui.x11 --- basis/ui/x11/x11.factor | 1 - 1 file changed, 1 deletion(-) diff --git a/basis/ui/x11/x11.factor b/basis/ui/x11/x11.factor index 9be3c2fd10..96633198c0 100755 --- a/basis/ui/x11/x11.factor +++ b/basis/ui/x11/x11.factor @@ -281,7 +281,6 @@ M: x11-ui-backend ui ( -- ) [ f [ [ - stop-after-last-window? on init-clipboard start-ui event-loop From 441a9f7c09867cdb8fe069ec95292df531851778 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Sat, 13 Dec 2008 04:57:37 -0600 Subject: [PATCH 05/10] Move time-related words to core-foundation.time to remove number tower dependency from core-foundation; remove no longer used words from cocoa.application --- basis/core-foundation/core-foundation.factor | 11 +---------- basis/core-foundation/fsevents/fsevents.factor | 3 ++- basis/core-foundation/run-loop/run-loop.factor | 3 ++- basis/core-foundation/time/time.factor | 14 ++++++++++++++ basis/core-foundation/timers/timers.factor | 3 ++- 5 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 basis/core-foundation/time/time.factor diff --git a/basis/core-foundation/core-foundation.factor b/basis/core-foundation/core-foundation.factor index 51173aff21..6b7d81c862 100644 --- a/basis/core-foundation/core-foundation.factor +++ b/basis/core-foundation/core-foundation.factor @@ -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 calendar ; +USING: alien.syntax destructors accessors kernel ; IN: core-foundation TYPEDEF: void* CFTypeRef @@ -14,8 +14,6 @@ TYPEDEF: int SInt32 TYPEDEF: uint UInt32 TYPEDEF: ulong CFTypeID TYPEDEF: UInt32 CFOptionFlags -TYPEDEF: double CFTimeInterval -TYPEDEF: double CFAbsoluteTime FUNCTION: CFTypeRef CFRetain ( CFTypeRef cf ) ; @@ -30,10 +28,3 @@ M: CFRelease-destructor dispose* alien>> CFRelease ; : |CFRelease ( alien -- alien ) dup f CFRelease-destructor boa |dispose drop ; inline - -: >CFTimeInterval ( duration -- interval ) - duration>seconds ; inline - -: >CFAbsoluteTime ( timestamp -- time ) - T{ timestamp { year 2001 } { month 1 } { day 1 } } time- - duration>seconds ; inline diff --git a/basis/core-foundation/fsevents/fsevents.factor b/basis/core-foundation/fsevents/fsevents.factor index 7ed040b455..b0c299a831 100644 --- a/basis/core-foundation/fsevents/fsevents.factor +++ b/basis/core-foundation/fsevents/fsevents.factor @@ -5,7 +5,8 @@ math sequences namespaces make assocs init accessors continuations combinators io.encodings.utf8 destructors locals arrays specialized-arrays.direct.alien specialized-arrays.direct.int specialized-arrays.direct.longlong -core-foundation core-foundation.run-loop core-foundation.strings ; +core-foundation core-foundation.run-loop core-foundation.strings +core-foundation.time ; IN: core-foundation.fsevents : kFSEventStreamCreateFlagUseCFTypes 2 ; inline diff --git a/basis/core-foundation/run-loop/run-loop.factor b/basis/core-foundation/run-loop/run-loop.factor index 5f2ff7bd53..8b2106685a 100644 --- a/basis/core-foundation/run-loop/run-loop.factor +++ b/basis/core-foundation/run-loop/run-loop.factor @@ -3,7 +3,8 @@ USING: accessors alien alien.syntax kernel math namespaces sequences destructors combinators threads heaps deques calendar core-foundation core-foundation.strings -core-foundation.file-descriptors core-foundation.timers ; +core-foundation.file-descriptors core-foundation.timers +core-foundation.time ; IN: core-foundation.run-loop : kCFRunLoopRunFinished 1 ; inline diff --git a/basis/core-foundation/time/time.factor b/basis/core-foundation/time/time.factor new file mode 100644 index 0000000000..15ad7bb1a1 --- /dev/null +++ b/basis/core-foundation/time/time.factor @@ -0,0 +1,14 @@ +! Copyright (C) 2008 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: calendar alien.syntax ; +IN: core-foundation.time + +TYPEDEF: double CFTimeInterval +TYPEDEF: double CFAbsoluteTime + +: >CFTimeInterval ( duration -- interval ) + duration>seconds ; inline + +: >CFAbsoluteTime ( timestamp -- time ) + T{ timestamp { year 2001 } { month 1 } { day 1 } } time- + duration>seconds ; inline diff --git a/basis/core-foundation/timers/timers.factor b/basis/core-foundation/timers/timers.factor index 0acd92ced1..51ee982592 100644 --- a/basis/core-foundation/timers/timers.factor +++ b/basis/core-foundation/timers/timers.factor @@ -1,6 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax system math kernel core-foundation calendar ; +USING: alien.syntax system math kernel calendar core-foundation +core-foundation.time ; IN: core-foundation.timers TYPEDEF: void* CFRunLoopTimerRef From e79e6d6056c8b0199ec3edd2c3d7c31ab1fa1cf6 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Sat, 13 Dec 2008 05:00:23 -0600 Subject: [PATCH 06/10] Remove dead code --- basis/cocoa/application/application.factor | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/basis/cocoa/application/application.factor b/basis/cocoa/application/application.factor index a52aaedce2..fb9a5f97ec 100644 --- a/basis/cocoa/application/application.factor +++ b/basis/cocoa/application/application.factor @@ -1,7 +1,7 @@ ! 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.run-loop core-foundation.arrays + core-foundation.arrays core-foundation.data core-foundation.strings cocoa.messages cocoa cocoa.classes cocoa.runtime sequences threads init summary kernel.private assocs ; @@ -35,13 +35,6 @@ FUNCTION: void NSBeep ( ) ; : with-cocoa ( quot -- ) [ NSApp drop call ] with-autorelease-pool ; inline -: next-event ( app -- event ) - NSAnyEventMask f CFRunLoopDefaultMode 1 - -> nextEventMatchingMask:untilDate:inMode:dequeue: ; - -: do-event ( app -- ? ) - dup next-event [ dupd -> sendEvent: -> updateWindows t ] [ drop f ] if* ; - : add-observer ( observer selector name object -- ) [ [ NSNotificationCenter -> defaultCenter ] 2dip From 44a8bac6cef0a5589806b5e0002e5406d3580e8f Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Sat, 13 Dec 2008 05:20:50 -0600 Subject: [PATCH 07/10] Remove more dead code --- basis/cocoa/application/application-docs.factor | 5 ----- basis/cocoa/application/application.factor | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/basis/cocoa/application/application-docs.factor b/basis/cocoa/application/application-docs.factor index e12b6eb276..60a0232a2c 100644 --- a/basis/cocoa/application/application-docs.factor +++ b/basis/cocoa/application/application-docs.factor @@ -30,10 +30,6 @@ HELP: cocoa-app { $values { "quot" quotation } } { $description "Initializes Cocoa, calls the quotation, and starts the Cocoa event loop." } ; -HELP: do-event -{ $values { "app" "an " { $snippet "NSApplication" } } { "?" "a boolean" } } -{ $description "Processes a pending event in the queue, if any, returning a boolean indicating if there was one. Does not block." } ; - HELP: add-observer { $values { "observer" "an " { $snippet "NSObject" } } { "selector" string } { "name" "an " { $snippet "NSString" } } { "object" "an " { $snippet "NSObject" } } } { $description "Registers an observer with the " { $snippet "NSNotificationCenter" } " singleton." } ; @@ -52,7 +48,6 @@ HELP: objc-error ARTICLE: "cocoa-application-utils" "Cocoa application utilities" "Utilities:" { $subsection NSApp } -{ $subsection do-event } { $subsection add-observer } { $subsection remove-observer } { $subsection install-delegate } diff --git a/basis/cocoa/application/application.factor b/basis/cocoa/application/application.factor index fb9a5f97ec..ab2b6375a9 100644 --- a/basis/cocoa/application/application.factor +++ b/basis/cocoa/application/application.factor @@ -1,10 +1,10 @@ ! 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 ; +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 ; From e7fc788d409d15d99f58c2c2136287e2ee9c3440 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Sat, 13 Dec 2008 06:53:53 -0600 Subject: [PATCH 08/10] Update UI unit tests for ui.event-loop split --- basis/ui/event-loop/event-loop-tests.factor | 4 ++++ basis/ui/ui-tests.factor | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 basis/ui/event-loop/event-loop-tests.factor diff --git a/basis/ui/event-loop/event-loop-tests.factor b/basis/ui/event-loop/event-loop-tests.factor new file mode 100644 index 0000000000..ae1d7ec8bc --- /dev/null +++ b/basis/ui/event-loop/event-loop-tests.factor @@ -0,0 +1,4 @@ +IN: ui.event-loop.tests +USING: ui.event-loop tools.test ; + +\ event-loop must-infer diff --git a/basis/ui/ui-tests.factor b/basis/ui/ui-tests.factor index 2920b58fff..15999d128b 100644 --- a/basis/ui/ui-tests.factor +++ b/basis/ui/ui-tests.factor @@ -1,5 +1,4 @@ IN: ui.tests USING: ui tools.test ; -\ event-loop must-infer \ open-window must-infer From 42b580c80a8edb22ce02afeff1aceaf5b6d9f750 Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Sat, 13 Dec 2008 07:14:11 -0600 Subject: [PATCH 09/10] Remove .lib dependencies from opengl.{shaders,framebuffers,capabilities} and move them to basis --- {extra => basis}/opengl/capabilities/authors.txt | 0 {extra => basis}/opengl/capabilities/capabilities-docs.factor | 0 {extra => basis}/opengl/capabilities/capabilities.factor | 0 {extra => basis}/opengl/capabilities/summary.txt | 0 {extra => basis}/opengl/capabilities/tags.txt | 0 {extra => basis}/opengl/framebuffers/authors.txt | 0 {extra => basis}/opengl/framebuffers/framebuffers-docs.factor | 0 {extra => basis}/opengl/framebuffers/framebuffers.factor | 0 {extra => basis}/opengl/framebuffers/summary.txt | 0 {extra => basis}/opengl/framebuffers/tags.txt | 0 {extra => basis}/opengl/shaders/authors.txt | 0 {extra => basis}/opengl/shaders/shaders-docs.factor | 0 {extra => basis}/opengl/shaders/shaders.factor | 4 ++-- {extra => basis}/opengl/shaders/summary.txt | 0 {extra => basis}/opengl/shaders/tags.txt | 0 15 files changed, 2 insertions(+), 2 deletions(-) rename {extra => basis}/opengl/capabilities/authors.txt (100%) rename {extra => basis}/opengl/capabilities/capabilities-docs.factor (100%) rename {extra => basis}/opengl/capabilities/capabilities.factor (100%) rename {extra => basis}/opengl/capabilities/summary.txt (100%) rename {extra => basis}/opengl/capabilities/tags.txt (100%) rename {extra => basis}/opengl/framebuffers/authors.txt (100%) rename {extra => basis}/opengl/framebuffers/framebuffers-docs.factor (100%) rename {extra => basis}/opengl/framebuffers/framebuffers.factor (100%) rename {extra => basis}/opengl/framebuffers/summary.txt (100%) rename {extra => basis}/opengl/framebuffers/tags.txt (100%) rename {extra => basis}/opengl/shaders/authors.txt (100%) rename {extra => basis}/opengl/shaders/shaders-docs.factor (100%) rename {extra => basis}/opengl/shaders/shaders.factor (97%) rename {extra => basis}/opengl/shaders/summary.txt (100%) rename {extra => basis}/opengl/shaders/tags.txt (100%) diff --git a/extra/opengl/capabilities/authors.txt b/basis/opengl/capabilities/authors.txt similarity index 100% rename from extra/opengl/capabilities/authors.txt rename to basis/opengl/capabilities/authors.txt diff --git a/extra/opengl/capabilities/capabilities-docs.factor b/basis/opengl/capabilities/capabilities-docs.factor similarity index 100% rename from extra/opengl/capabilities/capabilities-docs.factor rename to basis/opengl/capabilities/capabilities-docs.factor diff --git a/extra/opengl/capabilities/capabilities.factor b/basis/opengl/capabilities/capabilities.factor similarity index 100% rename from extra/opengl/capabilities/capabilities.factor rename to basis/opengl/capabilities/capabilities.factor diff --git a/extra/opengl/capabilities/summary.txt b/basis/opengl/capabilities/summary.txt similarity index 100% rename from extra/opengl/capabilities/summary.txt rename to basis/opengl/capabilities/summary.txt diff --git a/extra/opengl/capabilities/tags.txt b/basis/opengl/capabilities/tags.txt similarity index 100% rename from extra/opengl/capabilities/tags.txt rename to basis/opengl/capabilities/tags.txt diff --git a/extra/opengl/framebuffers/authors.txt b/basis/opengl/framebuffers/authors.txt similarity index 100% rename from extra/opengl/framebuffers/authors.txt rename to basis/opengl/framebuffers/authors.txt diff --git a/extra/opengl/framebuffers/framebuffers-docs.factor b/basis/opengl/framebuffers/framebuffers-docs.factor similarity index 100% rename from extra/opengl/framebuffers/framebuffers-docs.factor rename to basis/opengl/framebuffers/framebuffers-docs.factor diff --git a/extra/opengl/framebuffers/framebuffers.factor b/basis/opengl/framebuffers/framebuffers.factor similarity index 100% rename from extra/opengl/framebuffers/framebuffers.factor rename to basis/opengl/framebuffers/framebuffers.factor diff --git a/extra/opengl/framebuffers/summary.txt b/basis/opengl/framebuffers/summary.txt similarity index 100% rename from extra/opengl/framebuffers/summary.txt rename to basis/opengl/framebuffers/summary.txt diff --git a/extra/opengl/framebuffers/tags.txt b/basis/opengl/framebuffers/tags.txt similarity index 100% rename from extra/opengl/framebuffers/tags.txt rename to basis/opengl/framebuffers/tags.txt diff --git a/extra/opengl/shaders/authors.txt b/basis/opengl/shaders/authors.txt similarity index 100% rename from extra/opengl/shaders/authors.txt rename to basis/opengl/shaders/authors.txt diff --git a/extra/opengl/shaders/shaders-docs.factor b/basis/opengl/shaders/shaders-docs.factor similarity index 100% rename from extra/opengl/shaders/shaders-docs.factor rename to basis/opengl/shaders/shaders-docs.factor diff --git a/extra/opengl/shaders/shaders.factor b/basis/opengl/shaders/shaders.factor similarity index 97% rename from extra/opengl/shaders/shaders.factor rename to basis/opengl/shaders/shaders.factor index 476bb1be71..5b63b63afe 100755 --- a/extra/opengl/shaders/shaders.factor +++ b/basis/opengl/shaders/shaders.factor @@ -2,8 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. USING: kernel opengl.gl alien.c-types continuations namespaces assocs alien alien.strings libc opengl math sequences combinators -combinators.lib macros arrays io.encodings.ascii fry -specialized-arrays.uint destructors accessors ; +macros arrays io.encodings.ascii fry specialized-arrays.uint +destructors accessors ; IN: opengl.shaders : with-gl-shader-source-ptr ( string quot -- ) diff --git a/extra/opengl/shaders/summary.txt b/basis/opengl/shaders/summary.txt similarity index 100% rename from extra/opengl/shaders/summary.txt rename to basis/opengl/shaders/summary.txt diff --git a/extra/opengl/shaders/tags.txt b/basis/opengl/shaders/tags.txt similarity index 100% rename from extra/opengl/shaders/tags.txt rename to basis/opengl/shaders/tags.txt From 62737d37789ea7c82f5a88c5078e389b0b120ceb Mon Sep 17 00:00:00 2001 From: Slava Pestov <slava@slava-pestovs-macbook-pro.local> Date: Sat, 13 Dec 2008 07:14:23 -0600 Subject: [PATCH 10/10] Remove .lib dependencies from bunny --- extra/bunny/cel-shaded/cel-shaded.factor | 2 +- extra/bunny/model/model.factor | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extra/bunny/cel-shaded/cel-shaded.factor b/extra/bunny/cel-shaded/cel-shaded.factor index e481b47161..b1e24243f0 100644 --- a/extra/bunny/cel-shaded/cel-shaded.factor +++ b/extra/bunny/cel-shaded/cel-shaded.factor @@ -1,6 +1,6 @@ USING: arrays bunny.model continuations destructors kernel multiline opengl opengl.shaders opengl.capabilities opengl.gl -sequences sequences.lib accessors combinators ; +sequences accessors combinators ; IN: bunny.cel-shaded STRING: vertex-shader-source diff --git a/extra/bunny/model/model.factor b/extra/bunny/model/model.factor index 452adf5689..9dddd0d8cd 100755 --- a/extra/bunny/model/model.factor +++ b/extra/bunny/model/model.factor @@ -2,8 +2,8 @@ USING: accessors alien.c-types arrays combinators destructors http.client io io.encodings.ascii io.files kernel math math.matrices math.parser math.vectors opengl opengl.capabilities opengl.gl opengl.demo-support sequences -sequences.lib splitting vectors words -specialized-arrays.float specialized-arrays.uint ; +splitting vectors words specialized-arrays.float +specialized-arrays.uint ; IN: bunny.model : numbers ( str -- seq ) @@ -27,7 +27,7 @@ IN: bunny.model vneg normalize ; : normal ( ns vs triple -- ) - [ n ] keep [ rot [ v+ ] change-nth ] each-with2 ; + [ n ] keep [ rot [ v+ ] change-nth ] with with each ; : normals ( vs is -- ns ) over length { 0.0 0.0 0.0 } <array> -rot @@ -50,10 +50,10 @@ IN: bunny.model ] unless ; : (draw-triangle) ( ns vs triple -- ) - [ dup roll nth gl-normal swap nth gl-vertex ] each-with2 ; + [ dup roll nth gl-normal swap nth gl-vertex ] with with each ; : draw-triangles ( ns vs is -- ) - GL_TRIANGLES [ [ (draw-triangle) ] each-with2 ] do-state ; + GL_TRIANGLES [ [ (draw-triangle) ] with with each ] do-state ; TUPLE: bunny-dlist list ; TUPLE: bunny-buffers array element-array nv ni ;