From 55f29c69df6a096b63468c933c01ef2f6af13232 Mon Sep 17 00:00:00 2001 From: Matthew Willis Date: Sun, 10 Feb 2008 23:53:20 -0800 Subject: [PATCH] Changed set-fullscreen? to take a gadget instead of a world, moved it into the ui vocab. Moved fullscreen docs into the ui vocab. --- extra/ui/backend/backend.factor | 4 ++-- extra/ui/cocoa/cocoa.factor | 4 ++-- extra/ui/gadgets/worlds/worlds-docs.factor | 9 --------- extra/ui/ui-docs.factor | 10 ++++++++++ extra/ui/ui.factor | 6 ++++++ 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/extra/ui/backend/backend.factor b/extra/ui/backend/backend.factor index cc1f5f7d05..2334c7602b 100755 --- a/extra/ui/backend/backend.factor +++ b/extra/ui/backend/backend.factor @@ -7,9 +7,9 @@ SYMBOL: ui-backend HOOK: set-title ui-backend ( string world -- ) -HOOK: set-fullscreen? ui-backend ( ? world -- ) +HOOK: set-fullscreen* ui-backend ( ? world -- ) -HOOK: fullscreen? ui-backend ( world -- ? ) +HOOK: fullscreen* ui-backend ( world -- ? ) HOOK: (open-window) ui-backend ( world -- ) diff --git a/extra/ui/cocoa/cocoa.factor b/extra/ui/cocoa/cocoa.factor index 184e6fd856..06de1d81fb 100755 --- a/extra/ui/cocoa/cocoa.factor +++ b/extra/ui/cocoa/cocoa.factor @@ -59,10 +59,10 @@ M: cocoa-ui-backend set-title ( string world -- ) : exit-fullscreen ( world -- ) world-handle first f -> exitFullScreenModeWithOptions: ; -M: cocoa-ui-backend set-fullscreen? ( ? world -- ) +M: cocoa-ui-backend set-fullscreen* ( ? world -- ) swap [ enter-fullscreen ] [ exit-fullscreen ] if ; -M: cocoa-ui-backend fullscreen? ( world -- ? ) +M: cocoa-ui-backend fullscreen* ( world -- ? ) world-handle first -> isInFullScreenMode zero? not ; : auto-position ( world -- ) diff --git a/extra/ui/gadgets/worlds/worlds-docs.factor b/extra/ui/gadgets/worlds/worlds-docs.factor index 8a64750751..a47717329d 100755 --- a/extra/ui/gadgets/worlds/worlds-docs.factor +++ b/extra/ui/gadgets/worlds/worlds-docs.factor @@ -13,15 +13,6 @@ HELP: set-title { $description "Sets the title bar of the native window containing the world." } { $notes "This word should not be called directly by user code. Instead, change the " { $link world-title } " model; see " { $link "models" } "." } ; -HELP: set-fullscreen? -{ $values { "?" "a boolean" } { "world" world } } -{ $description "Sets and unsets fullscreen mode for the world." } -{ $notes "Find a world using " { $link find-world } "." } ; - -HELP: fullscreen? -{ $values { "world" world } { "?" "a boolean" } } -{ $description "Queries the world to see if it is running in fullscreen mode." } ; - HELP: raise-window { $values { "world" world } } { $description "Makes the native window containing the given world the front-most window." } diff --git a/extra/ui/ui-docs.factor b/extra/ui/ui-docs.factor index 651a12c737..5d87e40d94 100755 --- a/extra/ui/ui-docs.factor +++ b/extra/ui/ui-docs.factor @@ -14,6 +14,16 @@ HELP: open-window { $values { "gadget" gadget } { "title" string } } { $description "Opens a native window with the specified title." } ; +HELP: set-fullscreen? +{ $values { "?" "a boolean" } { "gadget" gadget } } +{ $description "Sets and unsets fullscreen mode for the gadget's world." } ; + +HELP: fullscreen? +{ $values { "gadget" gadget } { "?" "a boolean" } } +{ $description "Queries the gadget's world to see if it is running in fullscreen mode." } ; + +{ fullscreen? set-fullscreen? } related-words + HELP: find-window { $values { "quot" "a quotation with stack effect " { $snippet "( world -- ? )" } } { "world" "a " { $link world } " or " { $link f } } } { $description "Finds a native window whose world satisfies the quotation, outputting " { $link f } " if no such world could be found. The front-most native window is checked first." } ; diff --git a/extra/ui/ui.factor b/extra/ui/ui.factor index 774d84ff3d..c214eee8d5 100755 --- a/extra/ui/ui.factor +++ b/extra/ui/ui.factor @@ -145,6 +145,12 @@ SYMBOL: ui-hook >r [ 1 track, ] { 0 1 } make-track r> f open-world-window ; +: set-fullscreen? ( ? gadget -- ) + find-world set-fullscreen* ; + +: fullscreen? ( gadget -- ? ) + find-world fullscreen* ; + HOOK: close-window ui-backend ( gadget -- ) M: object close-window