diff --git a/collects/framework/framework-docs.ss b/collects/framework/framework-docs.ss deleted file mode 100644 index e1949f8a69..0000000000 --- a/collects/framework/framework-docs.ss +++ /dev/null @@ -1,74 +0,0 @@ -#lang scheme/base - -(provide def-fw-procs) - -(require (for-label scheme/contract) - (for-label framework/framework)) - -(require "private/framework-exports.ss" - (for-syntax scheme/base) - scribble/decode - scribble/manual) - -(define-syntax (fw-doc-form stx) - (syntax-case stx (-> ->*) - [(_ id (-> a ... b) (arg ...) (docs ...)) - #'(defproc (id (arg a) ...) - b - docs ...)] - [(_ id (->* (mandatory-ctc ...) (optional-ctc ...) range) - ((mandatory-arg ...) ((optional-arg default) ...)) - (docs ...)) - #'(defproc (id (mandatory-arg mandatory-ctc) ... - (optional-arg optional-ctc default) ...) - range - docs ...)] - - [(_ id ctc () (docs ...)) - #'(defthing id ctc docs ...)] - - [(_ id whatever ...) - (begin - (fprintf (current-error-port) "Cannot parse docs for ~a\n" (syntax->datum #'id)) - #'(defthing id any/c))])) - -(define-syntax (mapdesc stx) - (syntax-case stx () - [(_ cmd events) - #'(make-splice (list (index (symbol->string 'cmd)) - (symbol->string 'cmd) - " (" - (symbol->string 'events) - " events)"))])) - -(define-syntax (export/docs stx) - (syntax-case stx () - [(_ tag docs ...) - (let ([reg (regexp (format "^~a:" (syntax->datum #'tag)))]) - (with-syntax ([((id ctc argspec docs ...) ...) - (filter (λ (x) - (syntax-case x () - [(id ctc argspec docs ...) - (regexp-match reg (format "~a" (syntax->datum #'id)))])) - (syntax->list #'(docs ...)))]) - #'(begin (fw-doc-form id ctc argspec docs ...) ...)))])) - -(define-syntax (conv/export/docs stx) - (define-struct faux-stx (obj vec) #:prefab) - (syntax-case stx () - [(id tag arg) - #`(export/docs - tag - #,@(let loop ([f-stx (syntax->datum #'arg)]) - (cond - [(faux-stx? f-stx) - (datum->syntax #'id - (loop (faux-stx-obj f-stx)) - (faux-stx-vec f-stx))] - [(pair? f-stx) (cons (loop (car f-stx)) (loop (cdr f-stx)))] - [else f-stx])))])) - -(define-syntax (def-fw-procs stx) - (syntax-case stx () - [(_ tag) - #'(framework-exports/srcloc-preserved conv/export/docs tag)])) diff --git a/collects/framework/main.ss b/collects/framework/main.ss index 68fe5fc86b..24e46802a7 100644 --- a/collects/framework/main.ss +++ b/collects/framework/main.ss @@ -1,14 +1,1513 @@ #reader scribble/reader -#lang scheme/base +#lang scheme/gui -(require "main2.ss" - "preferences.ss" - "test.ss" - "gui-utils.ss" - "decorated-editor-snip.ss") +(require (lib "mred-unit.ss" "mred") + (lib "mred-sig.ss" "mred") + framework/unit + framework/private/sig + (for-syntax scheme/base) + scribble/srcdoc) -(provide (all-from-out "test.ss") - (all-from-out "main2.ss") - (all-from-out "gui-utils.ss") - (all-from-out "preferences.ss") - (all-from-out "decorated-editor-snip.ss")) +(require framework/preferences + framework/test + framework/gui-utils + framework/decorated-editor-snip) + +(provide (all-from-out framework/preferences + framework/test + framework/gui-utils + framework/decorated-editor-snip)) + +(require/doc scheme/base scribble/manual framework/private/mapdesc) + +(provide-signature-elements + (prefix application: framework:application-class^) + (prefix version: framework:version-class^) + (prefix color-model: framework:color-model-class^) + (prefix mode: framework:mode-class^) + (prefix exit: framework:exit-class^) + (prefix menu: framework:menu-class^) + (prefix preferences: framework:preferences-class^) + (prefix number-snip: framework:number-snip-class^) + (prefix autosave: framework:autosave-class^) + (prefix path-utils: framework:path-utils-class^) + (prefix icon: framework:icon-class^) + (prefix keymap: framework:keymap-class^) + (prefix editor: framework:editor-class^) + (prefix pasteboard: framework:pasteboard-class^) + (prefix text: framework:text-class^) + (prefix color: framework:color-class^) + (prefix color-prefs: framework:color-prefs-class^) + (prefix comment-box: framework:comment-box-class^) + (prefix finder: framework:finder-class^) + (prefix group: framework:group-class^) + (prefix canvas: framework:canvas-class^) + (prefix panel: framework:panel-class^) + (prefix frame: framework:frame-class^) + (prefix handler: framework:handler-class^) + (prefix scheme: framework:scheme-class^) + (prefix main: framework:main-class^)) + +(define-compound-unit/infer framework+mred@ + (import) + (export framework^) + (link standard-mred@ framework@)) + +(define-values/invoke-unit/infer framework+mred@) + +(provide/doc + (parameter-doc + text:autocomplete-append-after + (parameter/c string?) + suffix + @{A string that is inserted after a completion is inserted by a + @scheme[text:autocomplete] instance. + + Defaults to @scheme[""].}) + + (parameter-doc + text:autocomplete-limit + (parameter/c (and/c integer? exact? positive?)) + count + @{Controls the number of completions visible at a time in the menu + produced by @scheme[text:autocomplete] instances. + + Defaults to 15.}) + + (proc-doc/names + text:get-completions/manuals + (-> (or/c false/c (listof symbol?)) (listof string?)) + (manuals) + @{Returns the list of keywords for the manuals from @scheme[manuals] + by extracting all of the documented exports of the manuals. The + symbols are meant to be module paths. If @scheme[manuals] is false, + then all of the documented names are used.}) + + (proc-doc/names + number-snip:make-repeating-decimal-snip + (number? boolean? . -> . (is-a?/c snip%)) + (num show-prefix?) + @{Makes a number snip that shows the decimal expansion for + @scheme[number] The boolean indicates if a @litchar{#e} prefix + appears on the number. + + See also @scheme[number-snip:make-fraction-snip].}) + + (proc-doc/names + number-snip:make-fraction-snip + (number? boolean? . -> . (is-a?/c snip%)) + (num show-prefix-in-decimal-view?) + @{Makes a number snip that shows a fractional view of @scheme[number]. + The boolean indicates if a @litchar{#e} prefix appears on the + number, when shown in the decimal state. + + See also @scheme[number-snip:make-repeating-decimal-snip].}) + + (proc-doc/names + version:add-spec + (any/c any/c . -> . void?) + (spec revision) + @{These two values are appended to the version string. @scheme[write] + is used to transform them to strings. For example: + + @scheme[(version:add-spec 's 1)] + + in version 205 will make the version string be @litchar{205s1}. The + symbols @scheme['f] and @scheme['d] are used internally for + framework and drscheme revisions.}) + + (proc-doc/names + version:version + (-> string?) + () + @{This function returns a string describing the version of this + application. See also @scheme[version:add-spec].}) + + (parameter-doc + application:current-app-name + (parameter/c string?) + name + @{This is a parameter specifying the name of the current + application. It is used in the help menu + (see @scheme[frame:standard-menus%]) and in frame titles + (see @scheme[frame:editor%]). + The first case in the case-lambda returns the current name, and the + second case in the case-lambda sets the name of the application to + @scheme[name].}) + + (proc-doc/names + preferences:put-preferences/gui + (-> (listof symbol?) + (listof any/c) + any) + (name-list val-list) + @{Like @scheme[put-preferences], but has more sophisticated error + handling. In particular, it + @itemize{ + @item{waits for three consecutive failures before informing the + user} + @item{gives the user the opportunity to ``steal'' the lockfile + after the third failure, and} + @item{when failures occur, it remembers what its arguments were + and if any preference save eventually succeeds, all of the + past failures are also written at that point.}}}) + + (proc-doc/names + preferences:add-panel + (-> (or/c string? (cons/c string? (listof string?))) + (->d ([parent (is-a?/c area-container-window<%>)]) + () + [_ + (let ([old-children (send parent get-children)]) + (and/c (is-a?/c area-container-window<%>) + (λ (child) + (andmap eq? + (append old-children (list child)) + (send parent get-children)))))]) + void?) + (labels f) + @{@scheme[preferences:add-preference-panel] adds the result of + @scheme[f] with name @scheme[labels] to the preferences dialog box. + + The labels determine where this preference panel is placed in the + dialog. If the list is just one string, the preferences panel is + placed at the top level of the dialog. If there are more strings, a + hierarchy of nested panels is created and the new panel is added at + the end. If multiple calls to + @scheme[preferences:add-preference-panel] pass the same prefix of + strings, those panels are placed in the same children. + + When the preference dialog is opened for the first time, the + function @scheme[f] is called with a panel, and @scheme[f] is + expected to add a new child panel to it and add whatever preferences + configuration controls it wants to that panel. Then, @scheme[f]'s + should return the panel it added.}) + + (proc-doc/names + preferences:add-editor-checkbox-panel + (-> void?) + () + @{Adds a preferences panel for configuring options related to + editing.}) + + (proc-doc/names + preferences:add-warnings-checkbox-panel + (-> void?) + () + @{Adds a preferences panel for configuring options relating to + warnings.}) + + (proc-doc/names + preferences:add-scheme-checkbox-panel + (-> void?) + () + @{Adds a preferences panel for configuring options related to + Scheme.}) + + (proc-doc/names + preferences:add-to-warnings-checkbox-panel + (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) + (proc) + @{Saves @scheme[proc] until the preferences panel is created, when it + is called with the Misc. panel to add new children to the panel.}) + + (proc-doc/names + preferences:add-to-scheme-checkbox-panel + (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) + (proc) + @{Saves @scheme[proc] until the preferences panel is created, when it + is called with the Scheme preferences panel to add new children to + the panel.}) + + (proc-doc/names + preferences:add-to-editor-checkbox-panel + (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) + (proc) + @{Saves @scheme[proc] until the preferences panel is created, when it + is called with the Echeme preferences panel to add new children to + the panel.}) + + (proc-doc/names + preferences:add-font-panel + (-> void?) + () + @{Adds a font selection preferences panel to the preferences dialog.}) + + (proc-doc/names + preferences:show-dialog + (-> void?) + () + @{Shows the preferences dialog.}) + + (proc-doc/names + preferences:hide-dialog + (-> void?) + () + @{Hides the preferences dialog.}) + + (proc-doc/names + preferences:add-on-close-dialog-callback + ((-> void?) . -> . void?) + (cb) + @{Registers @scheme[cb]. Next time the user clicks the OK button the + preferences dialog, all of the @scheme[cb] functions are called, + assuming that each of the callbacks passed to + @scheme[preferences:add-can-close-dialog-callback] succeed.}) + + (proc-doc/names + preferences:add-can-close-dialog-callback + ((-> boolean?) . -> . void?) + (cb) + @{Registers @scheme[cb]. Next time the user clicks the OK button the + preferences dialog, all of the @scheme[cb] functions are called. If + any of them return @scheme[#f], the dialog is not closed. + + See also @scheme[preferences:add-on-close-dialog-callback].}) + + (proc-doc/names + autosave:register + ((and/c (is-a?/c autosave:autosavable<%>) + (is-a?/c editor<%>)) + . -> . + void?) + (obj) + @{Adds @scheme[obj] to the list of objects to be autosaved. When it + is time to autosave, the @scheme[do-autosave] method of the object + is called. This method is responsible for performing the autosave. + + There is no need to de-register an object because the autosaver + keeps a ``weak'' pointer to the object; i.e., the autosaver does not + keep an object from garbage collection.}) + + (proc-doc/names + autosave:restore-autosave-files/gui + (-> void?) + () + @{Opens a GUI to ask the user about recovering any autosave files left + around from crashes and things. + + This function doesn't return until the user has finished restoring + the autosave files. (It uses yield to handle events however.)}) + + (proc-doc/names + exit:exiting? + (-> boolean?) + () + @{Returns @scheme[#t] to indicate that an exit operation is taking + place. Does not indicate that the app will actually exit, since the + user may cancel the exit. + + See also @scheme[exit:insert-on-callback] and + @scheme[exit:insert-can?-callback].}) + + (proc-doc/names + exit:set-exiting + (boolean? . -> . void?) + (exiting?) + @{Sets a flag that affects the result of @scheme[exit:exiting?].}) + + (proc-doc/names + exit:insert-on-callback + ((-> void?) . -> . (-> void?)) + (callback) + @{Adds a callback to be called when exiting. This callback must not + fail. If a callback should stop an exit from happening, use + @scheme[exit:insert-can?-callback].}) + + (proc-doc/names + exit:insert-can?-callback + ((-> boolean?) . -> . (-> void?)) + (callback) + @{Use this function to add a callback that determines if an attempted + exit can proceed. This callback should not clean up any state, + since another callback may veto the exit. Use + @scheme[exit:insert-on-callback] for callbacks that clean up + state.}) + + (proc-doc/names + exit:can-exit? + (-> boolean?) + () + @{Calls the ``can-callbacks'' and returns their results. See + @scheme[exit:insert-can?-callback] for more information.}) + + (proc-doc/names + exit:on-exit + (-> void?) + () + @{Calls the ``on-callbacks''. See @scheme[exit:insert-on-callback] + for more information.}) + + (proc-doc/names + exit:exit + (-> any) + () + @{@scheme[exit:exit] performs four actions: + @itemize{ + @item{sets the result of the @scheme[exit:exiting?] function to + @scheme[#t].} + @item{invokes the exit-callbacks, with @scheme[exit:can-exit?] if + none of the ``can?'' callbacks return @scheme[#f],} + @item{invokes @scheme[exit:on-exit] and then} + @item{queues a callback that calls @scheme[exit] + (a mzscheme procedure) and (if @scheme[exit] returns) sets the result of + @scheme[exit:exiting?] back to @scheme[#t].}}}) + + (proc-doc/names + exit:user-oks-exit + (-> boolean?) + () + @{Opens a dialog that queries the user about exiting. Returns the + user's decision.}) + + (proc-doc/names + path-utils:generate-autosave-name + (string? . -> . string?) + (filename) + @{Generates a name for an autosave file from @scheme[filename].}) + + (proc-doc/names + path-utils:generate-backup-name + (path? . -> . path?) + (filename) + @{Generates a name for an backup file from @scheme[filename].}) + + (parameter-doc + finder:dialog-parent-parameter + (parameter/c (or/c false/c (is-a?/c dialog%) (is-a?/c frame%))) + parent + @{This parameter determines the parent of the dialogs created by + @scheme[finder:get-file], @scheme[finder:put-file], + @scheme[finder:common-get-file], @scheme[finder:common-put-file], + @scheme[finder:common-get-file-list], @scheme[finder:std-get-file], + and @scheme[finder:std-put-file].}) + + (parameter-doc + finder:default-extension + (parameter/c string?) + extension + @{This parameter controls the default extension for the framework's + @scheme[finder:put-file] dialog. Its value gets passed as the + @scheme[default-extension] argument to @scheme[put-file]. + + Its default value is @scheme[""].}) + + (parameter-doc + finder:default-filters + (parameter/c (listof (list/c string? string?))) + filters + @{ + This parameter controls the default filters for the framework's + @scheme[finder:put-file] dialog. Its value gets passed as the + @scheme[default-filters] argument to @scheme[put-file]. + + Its default value is @scheme['(("Any" "*.*"))].}) + + (proc-doc/names + finder:common-put-file + (->* () + (string? + (or/c false/c path?) + boolean? + string? + (or/c false/c byte-regexp?) + string? + (or/c (is-a?/c top-level-window<%>) false/c)) + (or/c false/c path?)) + (() + ((name "Untitled") + (directory #f) + (replace? #f) + (prompt "Select File") + (filter #f) + (filter-msg "That filename does not have the right form.") + (parent (finder:dialog-parent-parameter)))) + @{This procedure queries the user for a single filename, using a + platform-independent dialog box. Consider using + @scheme[finder:put-file] instead of this function. + + See section @secref{selecting-a-filename} for more information.}) + + (proc-doc/names + finder:common-get-file + (->* () + ((or/c path? false/c) + string? + (or/c byte-regexp? false/c) + string? + (or/c false/c (is-a?/c top-level-window<%>))) + (or/c path? false/c)) + (() + ((directory #f) + (prompt "Select File") + (filter #f) + (filter-msg "That filename does not have the right form.") + (parent #f))) + @{This procedure queries the user for a single filename, using a + platform-independent dialog box. Consider using + @scheme[finder:get-file] instead of this function. + + See section @secref{selecting-a-filename} for more information.}) + + (proc-doc/names + finder:std-put-file + (->* () + (string? + (or/c false/c path?) + boolean? + string? + (or/c false/c byte-regexp?) + string? + (or/c (is-a?/c top-level-window<%>) false/c)) + (or/c false/c path?)) + (() + ((name "Untitled") + (directory #f) + (replace? #f) + (prompt "Select File") + (filter #f) + (filter-msg "That filename does not have the right form.") + (parent (finder:dialog-parent-parameter)))) + @{This procedure queries the user for a single filename, using a + platform-dependent dialog box. Consider using + @scheme[finder:put-file] instead of this function. + + See section @secref{selecting-a-filename} for more information.}) + + (proc-doc/names + finder:std-get-file + (->* () + ((or/c path? false/c) + string? + (or/c byte-regexp? false/c) + string? + (or/c false/c (is-a?/c top-level-window<%>))) + (or/c path? false/c)) + (() + ((directory #f) + (prompt "Select File") + (filter #f) + (filter-msg "That filename does not have the right form.") + (parent #f))) + @{This procedure queries the user for a single filename, using a + platform-dependent dialog box. Consider using + @scheme[finder:get-file] instead of this function. + + See section @secref{selecting-a-filename} for more information.}) + + (proc-doc/names + finder:put-file + (->* () + (string? + (or/c false/c path?) + boolean? + string? + (or/c false/c byte-regexp?) + string? + (or/c (is-a?/c top-level-window<%>) false/c)) + (or/c false/c path?)) + (() + ((name "Untitled") + (directory #f) + (replace? #f) + (prompt "Select File") + (filter #f) + (filter-msg "That filename does not have the right form.") + (parent (finder:dialog-parent-parameter)))) + @{Queries the user for a filename. + + If the result of @scheme[(preferences:get 'framework:file-dialogs)] + is @scheme['std] this calls @scheme[finder:std-put-file], and if it + is @scheme['common], @scheme[finder:common-put-file] is called.}) + + (proc-doc/names + finder:get-file + (->* () + ((or/c path? false/c) + string? + (or/c byte-regexp? string? false/c) + string? + (or/c false/c (is-a?/c top-level-window<%>))) + (or/c path? false/c)) + (() + ((directory #f) + (prompt "Select File") + (filter #f) + (filter-msg "That filename does not have the right form.") + (parent #f))) + @{Queries the user for a filename. + + If the result of @scheme[(preferences:get 'framework:file-dialogs)] + is @scheme['std] this calls @scheme[finder:std-get-file], and if it + is @scheme['common], @scheme[finder:common-get-file] is called.}) + + (proc-doc/names + finder:common-get-file-list + (->* () + ((or/c false/c path?) + string? + (or/c false/c byte-regexp?) + string? + (or/c false/c (is-a?/c top-level-window<%>))) + (or/c (listof path?) false/c)) + (() + ((directory #f) + (prompt "Select File") + (filter #f) + (filter-msg "That filename does not have the right form.") + (parent #f))) + @{This procedure queries the user for a list of filenames, using a + platform-independent dialog box. + + See @secref{selecting-a-filename} for more information.}) + + (proc-doc/names + frame:setup-size-pref + (symbol? number? number? . -> . void) + (size-pref-sym width height) + @{Initializes a preference for the @scheme[frame:size-pref] mixin. + + The first argument should be the preferences symbol, and the second + an third should be the default width and height, respectively.}) + + (proc-doc/names + frame:add-snip-menu-items + (->* ((is-a?/c menu%) (subclass?/c menu-item%)) + ((-> (is-a?/c menu-item%) void?)) + void?) + ((menu menu-item%) + ((func void))) + @{Inserts three menu items into @scheme[menu], one that inserts a text + box, one that inserts a pasteboard box, and one that inserts an + image into the currently focused editor (if there is one). Uses + @scheme[menu-item%] as the class for the menu items. + + Calls @scheme[func] right after inserting each menu item.}) + + (proc-doc/names + frame:reorder-menus + ((is-a?/c frame%) . -> . void?) + (frame) + @{Re-orders the menus in a frame. It moves the ``File'' and ``Edit'' + menus to the front of the menubar and moves the ``Windows'' and + ``Help'' menus to the end of the menubar. + + This is useful in conjunction with the frame classes. After + instantiating the class and adding ones own menus, the menus will be + mis-ordered. This function fixes them up.}) + + (proc-doc/names + frame:remove-empty-menus + ((is-a?/c frame%) . -> . void?) + (frame) + @{Removes empty menus in a frame.}) + + (proc-doc/names + group:get-the-frame-group + (-> (is-a?/c group:%)) + () + @{This returns the frame group.}) + + (proc-doc/names + group:on-close-action + (-> void?) + () + @{See also @scheme[group:can-close-check]. + + Call this function from the @method[top-level-window<%> can-close?] + callback of a frame in order for the group to properly close the + application.}) + + (proc-doc/names + group:can-close-check + (-> boolean?) + () + @{See also @scheme[group:on-close-action]. + + Call this function from the @method[top-level-window<%> can-close?] + callback of a frame in order for the group to properly close the + application.}) + + (proc-doc/names + handler:handler? + (any/c . -> . boolean?) + (obj) + @{This predicate determines if its input is a handler.}) + + (proc-doc/names + handler:handler-name + (handler:handler? . -> . string?) + (handler) + @{Extracts the name from a handler.}) + + (proc-doc/names + handler:handler-extension + (handler:handler? + . -> . (or/c (path? . -> . boolean?) (listof string?))) + (handler) + @{Extracts the extension from a handler.}) + + (proc-doc/names + handler:handler-handler + (handler:handler? . -> . (path? . -> . (is-a?/c frame:editor<%>))) + (handler) + @{Extracs the handler's handling function.}) + + (proc-doc/names + handler:insert-format-handler + (string? + (or/c string? (listof string?) (path? . -> . boolean?)) + (path? . -> . (or/c false/c (is-a?/c frame:editor<%>))) + . -> . + void?) + (name pred handler) + @{This function inserts a format handler. + + The string, @scheme[name] names the format handler for use with + @scheme[handler:find-named-format-handler]. If @scheme[pred] is a + string, it is matched with the extension of a filename by + @scheme[handler:find-format-handler]. If @scheme[pred] is a list of + strings, they are each matched with the extension of a filename by + @scheme[handler:find-format-handler]. If it is a function, the + filename is applied to the function and the functions result + determines if this is the handler to use. + + The most recently added format handler takes precedence over all + other format handlers.}) + + (proc-doc/names + handler:find-named-format-handler + (string? . -> . (path? . -> . (is-a?/c frame:editor<%>))) + (name) + @{This function selects a format handler. See also + @scheme[handler:insert-format-handler]. + + It finds a handler based on @scheme[name].}) + + (proc-doc/names + handler:find-format-handler + (path? . -> . (path? . -> . (is-a?/c frame:editor<%>))) + (filename) + @{This function selects a format handler. See also + @scheme[handler:insert-format-handler]. + + It finds a handler based on @scheme[filename].}) + + (proc-doc/names + handler:edit-file + (->* ((or/c path? false/c)) + ((-> (is-a?/c frame:editor<%>))) + (or/c false/c (is-a?/c frame:editor<%>))) + ((filename) + ((make-default + (λ () ((handler:current-create-new-window) filename))))) + @{This function creates a frame or re-uses an existing frame to edit a + file. + + If the preference @scheme['framework:open-here] is set to + @scheme[#t], and + @scheme[(send (group:get-the-frame-group) get-open-here-frame)] + returns a frame, the + @method[frame:open-here<%> open-here] method of that frame is used + to load the file in the existing frame. + + Otherwise, it invokes the appropriate format handler to open the + file (see @scheme[handler:insert-format-handler]). + + @itemize{ + @item{If @scheme[filename] is a string, this function checks the + result of @scheme[group:get-the-frame-group] to see if the + @scheme[filename] is already open by a frame in the group. + @itemize{ + @item{If so, it returns the frame.} + @item{If not, this function calls + @scheme[handler:find-format-handler] with + @scheme[filename]. + @itemize{ + @item{If a handler is found, it is applied to + @scheme[filename] and it's result is the + final result.} + @item{If not, @scheme[make-default] is used.}}}}} + @item{If @scheme[filename] is @scheme[#f], @scheme[make-default] + is used.}}}) + + (parameter-doc + handler:current-create-new-window + (parameter/c (-> (or/c false/c path?) (is-a?/c frame%))) + proc + @{This is a parameter that controls how the framework creates new + application windows. + + The default setting is this: + @schemeblock[ + (λ (filename) + (let ([frame (make-object frame:text-info-file% filename)]) + (send frame show #t) + frame)) + ]}) + + (proc-doc/names + handler:open-file + (->* () + ((or/c false/c path? string?)) + (or/c false/c (is-a?/c frame:basic<%>))) + (() + ((dir #f))) + @{This function queries the user for a filename and opens the file for + editing. It uses @scheme[handler:edit-file] to open the file, once + the user has chosen it. + + Calls @scheme[finder:get-file] and @scheme[handler:edit-file], passing along @scheme[dir].}) + + (proc-doc/names + handler:install-recent-items + ((is-a?/c menu%) . -> . void?) + (menu) + @{This function deletes all of the items in the given menu and adds + one menu item for each recently opened file. These menu items, when + selected, call @scheme[handler:edit-file] with the filename of the + recently opened file. + + The menu's size is limited to 10.}) + + (proc-doc/names + handler:set-recent-items-frame-superclass + ((implementation?/c frame:standard-menus<%>) . -> . void?) + (frame) + @{Sets the superclass for the recently opened files frame. It must be + derived from @scheme[frame:standard-menus].}) + + (proc-doc/names + handler:add-to-recent + (path? . -> . void?) + (filename) + @{Adds a filename to the list of recently opened files.}) + + (proc-doc/names + handler:set-recent-position + (path? number? number? . -> . void?) + (filename start end) + @{Sets the selection of the recently opened file to @scheme[start] and + @scheme[end].}) + + (proc-doc/names + handler:size-recently-opened-files + (number? . -> . void?) + (num) + @{Sizes the @scheme['framework:recently-opened-files/pos] preference + list length to @scheme[num].}) + + (proc-doc/names + icon:get-paren-highlight-bitmap + (-> (is-a?/c bitmap%)) + () + @{This returns the parenthesis highlight @scheme[bitmap%]. It is only + used on black and white screens.}) + + (proc-doc/names + icon:get-eof-bitmap + (-> (is-a?/c bitmap%)) + () + @{This returns the @scheme[bitmap%] used for the clickable ``eof'' + icon from @scheme[text:ports].}) + + (proc-doc/names + icon:get-autowrap-bitmap + (-> (is-a?/c bitmap%)) + () + @{This returns the autowrap's @scheme[bitmap%]. + + The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] + method.}) + + (proc-doc/names + icon:get-lock-bitmap + (-> (is-a?/c bitmap%)) + () + @{This returns the lock's @scheme[bitmap]. + + The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] + method.}) + + (proc-doc/names + icon:get-unlock-bitmap + (-> (is-a?/c bitmap%)) + () + @{This returns the reset unlocked @scheme[bitmap]. + + The bitmap may not respond @scheme[#t] to the @link bitmap ok? + method.}) + + (proc-doc/names + icon:get-anchor-bitmap + (-> (is-a?/c bitmap%)) + () + @{This returns the anchor's @scheme[bitmap]. + + The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] + method.}) + + (proc-doc/names + icon:get-left/right-cursor + (-> (is-a?/c cursor%)) + () + @{This function returns a @link cursor object that indicates + left/right sizing is possible, for use with columns inside a window. + + The cursor may not respond @scheme[#t] to the @link cursor ok? + method.}) + + (proc-doc/names + icon:get-up/down-cursor + (-> (is-a?/c cursor%)) + () + @{This function returns a @scheme[cursor%] object that indicates + up/down sizing is possible, for use with columns inside a window. + + The cursor may not respond @scheme[#t] to the @method[cursor% ok?] + method.}) + + (proc-doc/names + icon:get-gc-on-bitmap + (-> (is-a?/c bitmap%)) + () + @{This returns a bitmap to be displayed in an @scheme[frame:info<%>] + frame when garbage collection is taking place. + + The bitmap may not respond @scheme[#t] to the @link bitmap ok? + method.}) + + (proc-doc/names + icon:get-gc-off-bitmap + (-> (is-a?/c bitmap%)) + () + @{This returns a bitmap to be displayed in an @scheme[frame:info<%>] + frame when garbage collection is not taking place. + + The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] + method.}) + + (proc-doc/names + keymap:remove-user-keybindings-file + (-> any/c any) + (user-keybindings-path) + @{Removes the keymap previously added by + @scheme[keymap:add-user-keybindings-file].}) + + (proc-doc/names + keymap:add-user-keybindings-file + (-> any/c any) + (user-keybindings-path-or-require-spec) + @{Chains the keymap defined by + @scheme[user-keybindings-path-or-require-spec] to the global keymap, + returned by @scheme[keymap:get-global]. + + If @scheme[user-keybindings-path-or-require-spec] is a path, the + module is loaded directly from that path. Otherwise, + @scheme[user-keybindings-path-or-require-spec] is treated like an + argument to @scheme[require].}) + + (parameter-doc + keymap:add-to-right-button-menu + (parameter/c + (-> (is-a?/c popup-menu%) (is-a?/c editor<%>) (is-a?/c event%) void?)) + proc + @{When the keymap that @scheme[keymap:get-global] returns is installed + into an editor, this parameter's value is used for right button + clicks. + + Before calling this procedure, the function + @scheme[append-editor-operation-menu-items] is called. + + See also @scheme[keymap:add-to-right-button-menu/before].}) + + (parameter-doc + keymap:add-to-right-button-menu/before + (parameter/c + (-> (is-a?/c popup-menu%) (is-a?/c editor<%>) (is-a?/c event%) void?)) + proc + @{When the keymap that @scheme[keymap:get-global] returns is installed + into an editor, this function is called for right button clicks. + + After calling this procedure, the function + @scheme[append-editor-operation-menu-items] is called. + + See also @scheme[keymap:add-to-right-button-menu].}) + + (proc-doc/names + keymap:call/text-keymap-initializer + ((-> any/c) . -> . any/c) + (thunk-proc) + @{Thus function parameterizes the call to @scheme[thunk-proc] by + setting the keymap-initialization procedure (see + @scheme[current-text-keymap-initializer]) to install the framework's + standard text bindings.}) + + (proc-doc/names + keymap:canonicalize-keybinding-string + (string? . -> . string?) + (keybinding-string) + @{Returns a string that denotes the same keybindings as the input + string, except that it is in canonical form; two canonical + keybinding strings can be compared with @scheme[string=?].}) + + (proc-doc/names + keymap:get-editor + (-> (is-a?/c keymap%)) + () + @{This returns a keymap for handling standard editing operations. It + binds these keys: + + @itemize{ + @item{@scheme["z"]: undo} + @item{@scheme["y"]: redo} + @item{@scheme["x"]: cut} + @item{@scheme["c"]: copy} + @item{@scheme["v"]: paste} + @item{@scheme["a"]: select all}} + where each key is prefixed with the menu-shortcut key, based on the + platform. Under unix, the shortcut is @scheme["a:"]; under windows + the shortcut key is @scheme["c:"] and under MacOS, the shortcut key + is @scheme["d:"].}) + + (proc-doc/names + keymap:get-file + (-> (is-a?/c keymap%)) + () + @{This returns a keymap for handling file operations.}) + + (proc-doc/names + keymap:get-global + (-> (is-a?/c keymap%)) + () + @{This returns a keymap for general operations. See + @scheme[keymap:setup-global] for a list of the bindings this keymap + contains.}) + + (proc-doc/names + keymap:get-search + (-> (is-a?/c keymap%)) + () + @{This returns a keymap for searching operations.}) + + (proc-doc/names + keymap:make-meta-prefix-list + (string? . -> . (listof string?)) + (key) + @{This prefixes a key with all of the different meta prefixes and + returns a list of the prefixed strings. + + takes a keymap, a base key specification, and a function name; it + prefixes the base key with all ``meta'' combination prefixes, and + installs the new combinations into the keymap. For example, + @scheme[(keymap:send-map-function-meta keymap "a" func)] maps + @scheme["m:a"] and @scheme["ESC;a"] to @scheme[func].}) + + (proc-doc/names + keymap:send-map-function-meta + ((is-a?/c keymap%) string? string? . -> . void?) + (keymap key func) + @{@index{Meta} Most keyboard and mouse mappings are inserted into a + keymap by calling the keymap's @method[keymap% map-function] method. + However, ``meta'' combinations require special attention. The + @scheme["m:"] prefix recognized by @method[keymap% map-function] + applies only to the Meta key that exists on some keyboards. By + convention, however, ``meta'' combinations can also be accessed by + using ``ESC'' as a prefix. + + This procedure binds all of the key-bindings obtained by prefixing + @scheme[key] with a meta-prefix to @scheme[func] in + @scheme[keymap].}) + + (proc-doc/names + keymap:setup-editor + ((is-a?/c keymap%) . -> . void?) + (keymap) + @{This sets up the input keymap with the bindings described in + @scheme[keymap:get-editor].}) + + (proc-doc/names + keymap:setup-file + ((is-a?/c keymap%) . -> . void?) + (keymap) + @{This extends a @scheme[keymap%] with the bindings for files.}) + + (proc-doc/names + keymap:setup-global + ((is-a?/c keymap%) . -> . void?) + (keymap) + @{This extends a @scheme[keymap%] with the general bindings. + + This function extends a @scheme[keymap%] with the following + functions: + @itemize{ + @item{@mapdesc[ring-bell any] --- Rings the bell + (using @scheme[bell]) and removes the search panel from the frame, + if there.} + @item{@mapdesc[save-file key] --- Saves the buffer. If the buffer + has no name, then + @scheme[finder:put-file]@index["finder:put-file"] is + invoked.} + @item{@mapdesc[save-file-as key] --- Calls + @scheme[finder:put-file]@index["finder:put-file"] to save + the buffer.} + @item{@mapdesc[load-file key] --- Invokes + @scheme[finder:open-file]@index["finder:open-file"].} + @item{@mapdesc[find-string key] --- Opens the search buffer at the + bottom of the frame, unless it is already open, in which + case it searches for the text in the search buffer.} + @item{@mapdesc[find-string-reverse key] --- Same as + ``find-string'', but in the reverse direction.} + @item{@mapdesc[find-string-replace key] --- Opens a replace string + dialog box.} + @item{@mapdesc[toggle-anchor key] --- Turns selection-anchoring on + or off.} + @item{@mapdesc[center-view-on-line key] --- Centers the buffer in + its display using the currently selected line.} + @item{@mapdesc[collapse-space key] --- Collapses all non-return + whitespace around the caret into a single space.} + @item{@mapdesc[remove-space key] --- Removes all non-return + whitespace around the caret.} + @item{@mapdesc[collapse-newline key] --- Collapses all empty lines + around the caret into a single empty line. If there is only + one empty line, it is removed.} + @item{@mapdesc[open-line key] --- Inserts a new line.} + @item{@mapdesc[transpose-chars key] --- Transposes the characters + before and after the caret and moves forward one position.} + @item{@mapdesc[transpose-words key] --- Transposes words before + and after the caret and moves forward one word.} + @item{@mapdesc[capitalize-word key] --- Changes the first + character of the next word to a capital letter and moves to + the end of the word.} + @item{@mapdesc[upcase-word key] --- Changes all characters of the + next word to capital letters and moves to the end of the + word.} + @item{@mapdesc[downcase-word key] --- Changes all characters + of the next word to lowercase letters and moves to the end + of the word.} + @item{@mapdesc[kill-word key] --- Kills the next word.} + @item{@mapdesc[backward-kill-word key] --- Kills the previous + word.} + @item{@mapdesc[goto-line any] --- Queries the user for a line + number and moves the caret there.} + @item{@mapdesc[goto-position any] --- Queries the user for a + position number and moves the caret there.} + @item{@mapdesc[copy-clipboard mouse] --- Copies the current + selection to the clipboard.} + @item{@mapdesc[cut-clipboard mouse] --- Cuts the current selection + to the clipboard.} + @item{@mapdesc[paste-clipboard mouse] --- Patses the clipboard to + the current selection.} + @item{@mapdesc[copy-click-region mouse] --- Copies the region + between the caret and the input mouse event.} + @item{@mapdesc[cut-click-region mouse] --- Cuts the region + between the caret and the input mouse event.} + @item{@mapdesc[paste-click-region mouse] --- Pastes the clipboard + into the position of the input mouse event.} + @item{@mapdesc[select-click-word mouse] --- Selects the word under + the input mouse event.} + @item{@mapdesc[select-click-line mouse] --- Selects the line under + the input mouse event.} + @item{@mapdesc[start-macro key] -- Starts building a keyboard + macro} + @item{@mapdesc[end-macro key] --- Stops building a keyboard macro} + @item{@mapdesc[do-macro key] --- Executes the last keyboard macro} + @item{@mapdesc[toggle-overwrite key] --- Toggles overwriting + mode}} + + These functions are bound to the following keys + (C = control, S = shift, A = alt, M = ``meta'', D = command): + + @itemize{ + @item{C-g : ``ring-bell''} + @item{M-C-g : ``ring-bell''} + @item{C-c C-g : ``ring-bell''} + @item{C-x C-g : ``ring-bell''} + @item{C-p : ``previous-line''} + @item{S-C-p : ``select-previous-line''} + @item{C-n : ``next-line''} + @item{S-C-n : ``select-next-line''} + @item{C-e : ``end-of-line''} + @item{S-C-e : ``select-to-end-of-line''} + @item{D-RIGHT : ``end-of-line''} + @item{S-D-RIGHT : ``select-to-end-of-line''} + @item{M-RIGHT : ``end-of-line''} + @item{S-M-RIGHT : ``select-to-end-of-line''} + @item{C-a : ``beginning-of-line''} + @item{S-C-a : ``select-to-beginning-of-line''} + @item{D-LEFT : ``beginning-of-line''} + @item{D-S-LEFT : ``select-to-beginning-of-line''} + @item{M-LEFT : ``beginning-of-line''} + @item{M-S-LEFT : ``select-to-beginning-of-line''} + @item{C-h : ``delete-previous-character''} + @item{C-d : ``delete-next-character''} + @item{C-f : ``forward-character''} + @item{S-C-f : ``select-forward-character''} + @item{C-b : ``backward-character''} + @item{S-C-b : ``select-backward-character''} + @item{M-f : ``forward-word''} + @item{S-M-f : ``select-forward-word''} + @item{A-RIGHT : ``forward-word''} + @item{A-S-RIGHT : ``forward-select-word''} + @item{M-b : ``backward-word''} + @item{S-M-b : ``select-backward-word''} + @item{A-LEFT : ``backward-word''} + @item{A-S-LEFT : ``backward-select-word''} + @item{M-d : ``kill-word''} + @item{M-DELETE : ``backward-kill-word''} + @item{M-c : ``capitalize-word''} + @item{M-u : ``upcase-word''} + @item{M-l : ``downcase-word''} + @item{M-< : ``beginning-of-file''} + @item{S-M-< : ``select-to-beginning-of-file''} + @item{M-> : ``end-of-file''} + @item{S-M-> : ``select-to-end-of-file''} + @item{C-v : ``next-page''} + @item{S-C-v : ``select-next-page''} + @item{M-v : ``previous-page''} + @item{S-M-v : ``select-previous-page''} + @item{C-l : ``center-view-on-line''} + @item{C-k : ``delete-to-end-of-line''} + @item{C-y : ``paste-clipboard'' (Except Windows)} + @item{A-v : ``paste-clipboard''} + @item{D-v : ``paste-clipboard''} + @item{C-_ : ``undo''} + @item{C-x u : ``undo''} + @item{C-+ : ``redo''} + @item{C-w : ``cut-clipboard''} + @item{M-w : ``copy-clipboard''} + @item{C-x C-s : ``save-file''} + @item{C-x C-w : ``save-file-as''} + @item{C-x C-f : ``load-file''} + @item{C-s : ``find-string''} + @item{C-r : ``find-string-reverse''} + @item{M-% : ``find-string-replace''} + @item{SPACE : ``collapse-space''} + @item{M-Backslash : ``remove-space''} + @item{C-x C-o : ``collapse-newline''} + @item{C-o : ``open-line''} + @item{C-t : ``transpose-chars''} + @item{M-t : ``transpose-words''} + @item{C-SPACE : ``toggle-anchor''} + @item{M-g : ``goto-line''} + @item{M-p : ``goto-position''} + @item{LEFTBUTTONTRIPLE : ``select-click-line''} + @item{LEFTBUTTONDOUBLE : ``select-click-word''} + @item{RIGHTBUTTON : ``copy-click-region''} + @item{RIGHTBUTTONDOUBLE : ``cut-click-region''} + @item{MIDDLEBUTTON : ``paste-click-region''} + @item{C-RIGHTBUTTON : ``copy-clipboard''} + @item{INSERT : ``toggle-overwrite''} + @item{M-o : ``toggle-overwrite''}}}) + + (proc-doc/names + keymap:setup-search + ((is-a?/c keymap%) . -> . void?) + (keymap) + @{This extends a @link keymap with the bindings for searching.}) + + (proc-doc/names + keymap:set-chained-keymaps + ((is-a?/c keymap:aug-keymap<%>) + (listof (is-a?/c keymap%)) + . -> . + void?) + (keymap children-keymaps) + @{Sets @scheme[keymap]'s chained keymaps to @scheme[children-keymaps], + unchaining any keymaps that are currently chained to + @scheme[keymap].}) + + (proc-doc/names + keymap:remove-chained-keymap + ((is-a?/c editor<%>) + (is-a?/c keymap:aug-keymap<%>) + . -> . + void?) + (editor keymap) + @{Removes @scheme[keymap] from the keymaps chained to @scheme[editor]. + Also (indirectly) removes all keymaps chained to @scheme[keymap] + from @scheme[editor], since they are removed when unchaining + @scheme[keymap] itself. + + Each of the keymaps chained to @scheme[editor] must be an + @scheme[keymap:aug-keymap%] and @scheme[keymap] cannot be the result + of @scheme[(send editor get-keymap)] That is, @scheme[keymap] must + be chained to some keymap attached to the editor.}) + + (proc-doc/names + scheme:text-balanced? + (->* ((is-a?/c text%)) + (number? (or/c false/c number?)) + boolean?) + ((text) + ((start 0) (end #f))) + @{Determines if the range in the editor from @scheme[start] to + @scheme[end] in @scheme[text] is a matched set of parenthesis. If + @scheme[end] is @scheme[#f], it defaults to the last position of the + @scheme[text]. + + The implementation of this function creates a port with + @scheme[open-input-text-editor] and then uses `read' to parse the + range of the buffer.}) + + (proc-doc/names + scheme:add-preferences-panel + (-> void?) + () + @{Adds a tabbing preferences panel to the preferences dialog.}) + + (proc-doc/names + scheme:get-keymap + (-> (is-a?/c keymap%)) + () + @{Returns a keymap with binding suitable for Scheme.}) + + (proc-doc/names + scheme:add-coloring-preferences-panel + (-> any) + () + @{ + Installs the ``Scheme'' preferences panel in the ``Syntax Coloring'' + section.}) + + (proc-doc/names + scheme:get-color-prefs-table + (-> (listof (list/c symbol? (is-a?/c color%)))) + () + @{Returns + a table mapping from symbols + (naming the categories that the online colorer uses for Scheme mode coloring) to their colors. + + These symbols are suitable for input to + @scheme[scheme:short-sym->pref-name] and + @scheme[scheme:short-sym->style-name]. + + See also @scheme[scheme:get-white-on-black-color-prefs-table].}) + + (proc-doc/names + scheme:get-white-on-black-color-prefs-table + (-> (listof (list/c symbol? (is-a?/c color%)))) + () + @{Returns + a table mapping from symbols + (naming the categories that the online colorer uses for Scheme mode coloring) to their colors when + the user chooses the white-on-black mode in the preferences dialog. + + See also @scheme[scheme:get-color-prefs-table].}) + + (proc-doc/names + scheme:short-sym->pref-name + (symbol? . -> . symbol?) + (short-sym) + @{Builds the symbol naming the preference from one of the symbols in + the table returned by @scheme[scheme:get-color-prefs-table].}) + + (proc-doc/names + scheme:short-sym->style-name + (symbol? . -> . string?) + (short-sym) + @{Builds the symbol naming the editor style from one of the symbols in + the table returned by @scheme[scheme:get-color-prefs-table]. This + style is a named style in the style list returned by + @scheme[editor:get-standard-style-list].}) + + (proc-doc/names + scheme:get-wordbreak-map + (-> (is-a?/c editor-wordbreak-map%)) + () + @{This method returns a @link editor-wordbreak-map that is suitable + for Scheme.}) + + (proc-doc/names + scheme:init-wordbreak-map + ((is-a?/c keymap%) . -> . void?) + (key) + @{Initializes the workdbreak map for @scheme[keymap].}) + + (proc-doc/names + scheme:setup-keymap + ((is-a?/c keymap%) . -> . void?) + (keymap) + @{Initializes @scheme[keymap] with Scheme-mode keybindings.}) + + (proc-doc/names + editor:set-default-font-color + (-> (is-a?/c color%) void?) + (color) + @{Sets the color of the style named + @scheme[editor:get-default-color-style-name].}) + + (proc-doc/names + editor:get-default-color-style-name + (-> string?) + () + @{The name of the style (in the list returned by + @scheme[editor:get-standard-style-list]) that holds the default + color.}) + + (proc-doc/names + editor:set-standard-style-list-delta + (string? (is-a?/c style-delta%) . -> . void?) + (name delta) + @{Finds (or creates) the style named by @scheme[name] in the result of + @scheme[editor:get-standard-style-list] and sets its delta to + @scheme[delta]. + + If the style named by @scheme[name] is already in the style list, it + must be a delta style.}) + + (proc-doc/names + editor:set-standard-style-list-pref-callbacks + (-> any) + () + @{Installs the font preference callbacks that update the style list + returned by @scheme[editor:get-standard-style-list] based on the + font preference symbols.}) + + (proc-doc/names + editor:get-standard-style-list + (-> (is-a?/c style-list%)) + () + @{Returns a style list that is used for all instances of + @scheme[editor:standard-style-list%].}) + + (proc-doc/names + color-model:rgb->xyz + (number? number? number? . -> . color-model:xyz?) + (r g b) + @{Converts a color represented as a red-green-blue tuple (each value + from 0 to 255) into an XYZ tuple. This describes a point in the CIE + XYZ color space.}) + + (proc-doc/names + color-model:rgb-color-distance + (number? number? number? number? number? number? . -> . number?) + (red-a green-a blue-a red-b green-b blue-b) + @{This calculates a distance between two colors. The smaller the + distance, the closer the colors should appear to the human eye. A + distance of 10 is reasonably close that it could be called the same + color. + + This function is not symmetric in red, green, and blue, so it is + important to pass red, green, and blue components of the colors in + the the proper order. The first three arguments are red, green and + blue for the first color, respectively, and the second three + arguments are red green and blue for the second color, + respectively.}) + + (proc-doc/names + color-model:xyz->rgb + (number? number? number? . -> . (list/c number? number? number?)) + (x y z) + @{Converts an XYZ-tuple (in the CIE XYZ colorspace) into a list of + values representing an RGB-tuple.}) + + (proc-doc/names + color-model:xyz? + (any/c . -> . boolean?) + (val) + @{Determines if @scheme[val] an xyz color record.}) + + (proc-doc/names + color-model:xyz-x + (color-model:xyz? . -> . number?) + (xyz) + @{Extracts the x component of @scheme[xyz].}) + + (proc-doc/names + color-model:xyz-y + (color-model:xyz? . -> . number?) + (xyz) + @{Extracts the y component of @scheme[xyz].}) + + (proc-doc/names + color-model:xyz-z + (color-model:xyz? . -> . number?) + (xyz) + @{Extracts the z component of @scheme[xyz].}) + + (proc-doc/names + color-prefs:set-default/color-scheme + (-> symbol? + (or/c (is-a?/c color%) string?) + (or/c (is-a?/c color%) string?) + void?) + (pref-sym black-on-white-color white-on-black-color) + @{Registers a preference whose value will be updated when the user + clicks on one of the color scheme default settings in the + preferences dialog. + + Also calls @scheme[preferences:set-default] and + @scheme[preferences:set-un/marshall] with appropriate arguments to + register the preference.}) + + (proc-doc/names + color-prefs:register-color-preference + (->* (symbol? string? (or/c (is-a?/c color%) (is-a?/c style-delta%))) + ((or/c string? (is-a?/c color%) false/c)) + void?) + ((pref-name style-name color/sd) + ((white-on-black-color #f))) + @{This function registers a color preference and initializes the style + list returned from @scheme[editor:get-standard-style-list]. In + particular, it calls @scheme[preferences:set-default] and + @scheme[preferences:set-un/marshall] to install the pref for + @scheme[pref-name], using @scheme[color/sd] as the default + color. The preference is bound to a @scheme[style-delta%], and + initially the @scheme[style-delta%] changes the foreground color to + @scheme[color/sd], unless @scheme[color/sd] is a style delta + already, in which case it is just used directly. Then, it calls + @scheme[editor:set-standard-style-list-delta] passing the + @scheme[style-name] and the current value of the preference + @scheme[pref-name]. + + Finally, it adds calls @scheme[preferences:add-callback] to set a + callback for @scheme[pref-name] that updates the style list when the + preference changes. + + If @scheme[white-on-black-color] is not @scheme[#f], then the color + of the @scheme[color/sd] argument is used in combination with + @scheme[white-on-black-color] to register this preference with + @scheme[color-prefs:set-default/color-scheme].}) + + (proc-doc/names + color-prefs:add-background-preferences-panel + (-> void?) + () + @{Adds a preferences panel that configures the background color for + @scheme[editor:basic-mixin].}) + + (proc-doc/names + color-prefs:add-to-preferences-panel + (string? ((is-a?/c vertical-panel%) . -> . void?) . -> . void?) + (name func) + @{Calls @scheme[func] with the subpanel of the preferences coloring + panel that corresponds to @scheme[name].}) + + (proc-doc/names + color-prefs:build-color-selection-panel + ((is-a?/c area-container<%>) symbol? string? string? . -> . void?) + (parent pref-sym style-name example-text) + @{Builds a panel with a number of controls for configuring a font: the + color and check boxes for bold, italic, and underline. The + @scheme[parent] argument specifies where the panel will be placed. + The @scheme[pref-sym] should be a preference + (suitable for use with @scheme[preferences:get] and @scheme[preferences:set]). + The + @scheme[style-name] specifies the name of a style in the style list + returned from @scheme[editor:get-standard-style-list] and + @scheme[example-text] is shown in the panel so users can see the + results of their configuration.}) + + (proc-doc/names + color-prefs:marshall-style-delta + (-> (is-a?/c style-delta%) printable/c) + (style-delta) + @{Builds a printed representation for a style-delta.}) + + (proc-doc/names + color-prefs:unmarshall-style-delta + (-> printable/c (or/c false/c (is-a?/c style-delta%))) + (marshalled-style-delta) + @{Builds a style delta from its printed representation. Returns + @scheme[#f] if the printed form cannot be parsed.})) diff --git a/collects/framework/main2.ss b/collects/framework/main2.ss deleted file mode 100644 index 61603b878d..0000000000 --- a/collects/framework/main2.ss +++ /dev/null @@ -1,1503 +0,0 @@ -#reader scribble/reader -#lang scheme/gui - -(require (lib "mred-unit.ss" "mred") - (lib "mred-sig.ss" "mred") - framework/unit ;"unit.ss" - framework/private/sig ; "private/sig.ss" - (for-syntax scheme/base) - scribble/srcdoc) - -(require/doc scheme/base scribble/manual) - -(provide-signature-elements - (prefix application: framework:application-class^) - (prefix version: framework:version-class^) - (prefix color-model: framework:color-model-class^) - (prefix mode: framework:mode-class^) - (prefix exit: framework:exit-class^) - (prefix menu: framework:menu-class^) - (prefix preferences: framework:preferences-class^) - (prefix number-snip: framework:number-snip-class^) - (prefix autosave: framework:autosave-class^) - (prefix path-utils: framework:path-utils-class^) - (prefix icon: framework:icon-class^) - (prefix keymap: framework:keymap-class^) - (prefix editor: framework:editor-class^) - (prefix pasteboard: framework:pasteboard-class^) - (prefix text: framework:text-class^) - (prefix color: framework:color-class^) - (prefix color-prefs: framework:color-prefs-class^) - (prefix comment-box: framework:comment-box-class^) - (prefix finder: framework:finder-class^) - (prefix group: framework:group-class^) - (prefix canvas: framework:canvas-class^) - (prefix panel: framework:panel-class^) - (prefix frame: framework:frame-class^) - (prefix handler: framework:handler-class^) - (prefix scheme: framework:scheme-class^) - (prefix main: framework:main-class^)) - -(define-compound-unit/infer framework+mred@ - (import) - (export framework^) - (link standard-mred@ framework@)) - -(define-values/invoke-unit/infer framework+mred@) - -(provide/doc - (parameter-doc - text:autocomplete-append-after - (parameter/c string?) - suffix - @{A string that is inserted after a completion is inserted by a - @scheme[text:autocomplete] instance. - - Defaults to @scheme[""].}) - - (parameter-doc - text:autocomplete-limit - (parameter/c (and/c integer? exact? positive?)) - count - @{Controls the number of completions visible at a time in the menu - produced by @scheme[text:autocomplete] instances. - - Defaults to 15.}) - - (proc-doc/names - text:get-completions/manuals - (-> (or/c false/c (listof symbol?)) (listof string?)) - (manuals) - @{Returns the list of keywords for the manuals from @scheme[manuals] - by extracting all of the documented exports of the manuals. The - symbols are meant to be module paths. If @scheme[manuals] is false, - then all of the documented names are used.}) - - (proc-doc/names - number-snip:make-repeating-decimal-snip - (number? boolean? . -> . (is-a?/c snip%)) - (num show-prefix?) - @{Makes a number snip that shows the decimal expansion for - @scheme[number] The boolean indicates if a @litchar{#e} prefix - appears on the number. - - See also @scheme[number-snip:make-fraction-snip].}) - - (proc-doc/names - number-snip:make-fraction-snip - (number? boolean? . -> . (is-a?/c snip%)) - (num show-prefix-in-decimal-view?) - @{Makes a number snip that shows a fractional view of @scheme[number]. - The boolean indicates if a @litchar{#e} prefix appears on the - number, when shown in the decimal state. - - See also @scheme[number-snip:make-repeating-decimal-snip].}) - - (proc-doc/names - version:add-spec - (any/c any/c . -> . void?) - (spec revision) - @{These two values are appended to the version string. @scheme[write] - is used to transform them to strings. For example: - - @scheme[(version:add-spec 's 1)] - - in version 205 will make the version string be @litchar{205s1}. The - symbols @scheme['f] and @scheme['d] are used internally for - framework and drscheme revisions.}) - - (proc-doc/names - version:version - (-> string?) - () - @{This function returns a string describing the version of this - application. See also @scheme[version:add-spec].}) - - (parameter-doc - application:current-app-name - (parameter/c string?) - name - @{This is a parameter specifying the name of the current - application. It is used in the help menu - (see @scheme[frame:standard-menus%]) and in frame titles - (see @scheme[frame:editor%]). - The first case in the case-lambda returns the current name, and the - second case in the case-lambda sets the name of the application to - @scheme[name].}) - - (proc-doc/names - preferences:put-preferences/gui - (-> (listof symbol?) - (listof any/c) - any) - (name-list val-list) - @{Like @scheme[put-preferences], but has more sophisticated error - handling. In particular, it - @itemize{ - @item{waits for three consecutive failures before informing the - user} - @item{gives the user the opportunity to ``steal'' the lockfile - after the third failure, and} - @item{when failures occur, it remembers what its arguments were - and if any preference save eventually succeeds, all of the - past failures are also written at that point.}}}) - - (proc-doc/names - preferences:add-panel - (-> (or/c string? (cons/c string? (listof string?))) - (->d ([parent (is-a?/c area-container-window<%>)]) - () - [_ - (let ([old-children (send parent get-children)]) - (and/c (is-a?/c area-container-window<%>) - (λ (child) - (andmap eq? - (append old-children (list child)) - (send parent get-children)))))]) - void?) - (labels f) - @{@scheme[preferences:add-preference-panel] adds the result of - @scheme[f] with name @scheme[labels] to the preferences dialog box. - - The labels determine where this preference panel is placed in the - dialog. If the list is just one string, the preferences panel is - placed at the top level of the dialog. If there are more strings, a - hierarchy of nested panels is created and the new panel is added at - the end. If multiple calls to - @scheme[preferences:add-preference-panel] pass the same prefix of - strings, those panels are placed in the same children. - - When the preference dialog is opened for the first time, the - function @scheme[f] is called with a panel, and @scheme[f] is - expected to add a new child panel to it and add whatever preferences - configuration controls it wants to that panel. Then, @scheme[f]'s - should return the panel it added.}) - - (proc-doc/names - preferences:add-editor-checkbox-panel - (-> void?) - () - @{Adds a preferences panel for configuring options related to - editing.}) - - (proc-doc/names - preferences:add-warnings-checkbox-panel - (-> void?) - () - @{Adds a preferences panel for configuring options relating to - warnings.}) - - (proc-doc/names - preferences:add-scheme-checkbox-panel - (-> void?) - () - @{Adds a preferences panel for configuring options related to - Scheme.}) - - (proc-doc/names - preferences:add-to-warnings-checkbox-panel - (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) - (proc) - @{Saves @scheme[proc] until the preferences panel is created, when it - is called with the Misc. panel to add new children to the panel.}) - - (proc-doc/names - preferences:add-to-scheme-checkbox-panel - (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) - (proc) - @{Saves @scheme[proc] until the preferences panel is created, when it - is called with the Scheme preferences panel to add new children to - the panel.}) - - (proc-doc/names - preferences:add-to-editor-checkbox-panel - (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) - (proc) - @{Saves @scheme[proc] until the preferences panel is created, when it - is called with the Echeme preferences panel to add new children to - the panel.}) - - (proc-doc/names - preferences:add-font-panel - (-> void?) - () - @{Adds a font selection preferences panel to the preferences dialog.}) - - (proc-doc/names - preferences:show-dialog - (-> void?) - () - @{Shows the preferences dialog.}) - - (proc-doc/names - preferences:hide-dialog - (-> void?) - () - @{Hides the preferences dialog.}) - - (proc-doc/names - preferences:add-on-close-dialog-callback - ((-> void?) . -> . void?) - (cb) - @{Registers @scheme[cb]. Next time the user clicks the OK button the - preferences dialog, all of the @scheme[cb] functions are called, - assuming that each of the callbacks passed to - @scheme[preferences:add-can-close-dialog-callback] succeed.}) - - (proc-doc/names - preferences:add-can-close-dialog-callback - ((-> boolean?) . -> . void?) - (cb) - @{Registers @scheme[cb]. Next time the user clicks the OK button the - preferences dialog, all of the @scheme[cb] functions are called. If - any of them return @scheme[#f], the dialog is not closed. - - See also @scheme[preferences:add-on-close-dialog-callback].}) - - (proc-doc/names - autosave:register - ((and/c (is-a?/c autosave:autosavable<%>) - (is-a?/c editor<%>)) - . -> . - void?) - (obj) - @{Adds @scheme[obj] to the list of objects to be autosaved. When it - is time to autosave, the @scheme[do-autosave] method of the object - is called. This method is responsible for performing the autosave. - - There is no need to de-register an object because the autosaver - keeps a ``weak'' pointer to the object; i.e., the autosaver does not - keep an object from garbage collection.}) - - (proc-doc/names - autosave:restore-autosave-files/gui - (-> void?) - () - @{Opens a GUI to ask the user about recovering any autosave files left - around from crashes and things. - - This function doesn't return until the user has finished restoring - the autosave files. (It uses yield to handle events however.)}) - - (proc-doc/names - exit:exiting? - (-> boolean?) - () - @{Returns @scheme[#t] to indicate that an exit operation is taking - place. Does not indicate that the app will actually exit, since the - user may cancel the exit. - - See also @scheme[exit:insert-on-callback] and - @scheme[exit:insert-can?-callback].}) - - (proc-doc/names - exit:set-exiting - (boolean? . -> . void?) - (exiting?) - @{Sets a flag that affects the result of @scheme[exit:exiting?].}) - - (proc-doc/names - exit:insert-on-callback - ((-> void?) . -> . (-> void?)) - (callback) - @{Adds a callback to be called when exiting. This callback must not - fail. If a callback should stop an exit from happening, use - @scheme[exit:insert-can?-callback].}) - - (proc-doc/names - exit:insert-can?-callback - ((-> boolean?) . -> . (-> void?)) - (callback) - @{Use this function to add a callback that determines if an attempted - exit can proceed. This callback should not clean up any state, - since another callback may veto the exit. Use - @scheme[exit:insert-on-callback] for callbacks that clean up - state.}) - - (proc-doc/names - exit:can-exit? - (-> boolean?) - () - @{Calls the ``can-callbacks'' and returns their results. See - @scheme[exit:insert-can?-callback] for more information.}) - - (proc-doc/names - exit:on-exit - (-> void?) - () - @{Calls the ``on-callbacks''. See @scheme[exit:insert-on-callback] - for more information.}) - - (proc-doc/names - exit:exit - (-> any) - () - @{@scheme[exit:exit] performs four actions: - @itemize{ - @item{sets the result of the @scheme[exit:exiting?] function to - @scheme[#t].} - @item{invokes the exit-callbacks, with @scheme[exit:can-exit?] if - none of the ``can?'' callbacks return @scheme[#f],} - @item{invokes @scheme[exit:on-exit] and then} - @item{queues a callback that calls @scheme[exit] - (a mzscheme procedure) and (if @scheme[exit] returns) sets the result of - @scheme[exit:exiting?] back to @scheme[#t].}}}) - - (proc-doc/names - exit:user-oks-exit - (-> boolean?) - () - @{Opens a dialog that queries the user about exiting. Returns the - user's decision.}) - - (proc-doc/names - path-utils:generate-autosave-name - (string? . -> . string?) - (filename) - @{Generates a name for an autosave file from @scheme[filename].}) - - (proc-doc/names - path-utils:generate-backup-name - (path? . -> . path?) - (filename) - @{Generates a name for an backup file from @scheme[filename].}) - - (parameter-doc - finder:dialog-parent-parameter - (parameter/c (or/c false/c (is-a?/c dialog%) (is-a?/c frame%))) - parent - @{This parameter determines the parent of the dialogs created by - @scheme[finder:get-file], @scheme[finder:put-file], - @scheme[finder:common-get-file], @scheme[finder:common-put-file], - @scheme[finder:common-get-file-list], @scheme[finder:std-get-file], - and @scheme[finder:std-put-file].}) - - (parameter-doc - finder:default-extension - (parameter/c string?) - extension - @{This parameter controls the default extension for the framework's - @scheme[finder:put-file] dialog. Its value gets passed as the - @scheme[default-extension] argument to @scheme[put-file]. - - Its default value is @scheme[""].}) - - (parameter-doc - finder:default-filters - (parameter/c (listof (list/c string? string?))) - filters - @{ - This parameter controls the default filters for the framework's - @scheme[finder:put-file] dialog. Its value gets passed as the - @scheme[default-filters] argument to @scheme[put-file]. - - Its default value is @scheme['(("Any" "*.*"))].}) - - (proc-doc/names - finder:common-put-file - (->* () - (string? - (or/c false/c path?) - boolean? - string? - (or/c false/c byte-regexp?) - string? - (or/c (is-a?/c top-level-window<%>) false/c)) - (or/c false/c path?)) - (() - ((name "Untitled") - (directory #f) - (replace? #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent (finder:dialog-parent-parameter)))) - @{This procedure queries the user for a single filename, using a - platform-independent dialog box. Consider using - @scheme[finder:put-file] instead of this function. - - See section @secref{selecting-a-filename} for more information.}) - - (proc-doc/names - finder:common-get-file - (->* () - ((or/c path? false/c) - string? - (or/c byte-regexp? false/c) - string? - (or/c false/c (is-a?/c top-level-window<%>))) - (or/c path? false/c)) - (() - ((directory #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent #f))) - @{This procedure queries the user for a single filename, using a - platform-independent dialog box. Consider using - @scheme[finder:get-file] instead of this function. - - See section @secref{selecting-a-filename} for more information.}) - - (proc-doc/names - finder:std-put-file - (->* () - (string? - (or/c false/c path?) - boolean? - string? - (or/c false/c byte-regexp?) - string? - (or/c (is-a?/c top-level-window<%>) false/c)) - (or/c false/c path?)) - (() - ((name "Untitled") - (directory #f) - (replace? #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent (finder:dialog-parent-parameter)))) - @{This procedure queries the user for a single filename, using a - platform-dependent dialog box. Consider using - @scheme[finder:put-file] instead of this function. - - See section @secref{selecting-a-filename} for more information.}) - - (proc-doc/names - finder:std-get-file - (->* () - ((or/c path? false/c) - string? - (or/c byte-regexp? false/c) - string? - (or/c false/c (is-a?/c top-level-window<%>))) - (or/c path? false/c)) - (() - ((directory #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent #f))) - @{This procedure queries the user for a single filename, using a - platform-dependent dialog box. Consider using - @scheme[finder:get-file] instead of this function. - - See section @secref{selecting-a-filename} for more information.}) - - (proc-doc/names - finder:put-file - (->* () - (string? - (or/c false/c path?) - boolean? - string? - (or/c false/c byte-regexp?) - string? - (or/c (is-a?/c top-level-window<%>) false/c)) - (or/c false/c path?)) - (() - ((name "Untitled") - (directory #f) - (replace? #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent (finder:dialog-parent-parameter)))) - @{Queries the user for a filename. - - If the result of @scheme[(preferences:get 'framework:file-dialogs)] - is @scheme['std] this calls @scheme[finder:std-put-file], and if it - is @scheme['common], @scheme[finder:common-put-file] is called.}) - - (proc-doc/names - finder:get-file - (->* () - ((or/c path? false/c) - string? - (or/c byte-regexp? string? false/c) - string? - (or/c false/c (is-a?/c top-level-window<%>))) - (or/c path? false/c)) - (() - ((directory #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent #f))) - @{Queries the user for a filename. - - If the result of @scheme[(preferences:get 'framework:file-dialogs)] - is @scheme['std] this calls @scheme[finder:std-get-file], and if it - is @scheme['common], @scheme[finder:common-get-file] is called.}) - - (proc-doc/names - finder:common-get-file-list - (->* () - ((or/c false/c path?) - string? - (or/c false/c byte-regexp?) - string? - (or/c false/c (is-a?/c top-level-window<%>))) - (or/c (listof path?) false/c)) - (() - ((directory #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent #f))) - @{This procedure queries the user for a list of filenames, using a - platform-independent dialog box. - - See @secref{selecting-a-filename} for more information.}) - - (proc-doc/names - frame:setup-size-pref - (symbol? number? number? . -> . void) - (size-pref-sym width height) - @{Initializes a preference for the @scheme[frame:size-pref] mixin. - - The first argument should be the preferences symbol, and the second - an third should be the default width and height, respectively.}) - - (proc-doc/names - frame:add-snip-menu-items - (->* ((is-a?/c menu%) (subclass?/c menu-item%)) - ((-> (is-a?/c menu-item%) void?)) - void?) - ((menu menu-item%) - ((func void))) - @{Inserts three menu items into @scheme[menu], one that inserts a text - box, one that inserts a pasteboard box, and one that inserts an - image into the currently focused editor (if there is one). Uses - @scheme[menu-item%] as the class for the menu items. - - Calls @scheme[func] right after inserting each menu item.}) - - (proc-doc/names - frame:reorder-menus - ((is-a?/c frame%) . -> . void?) - (frame) - @{Re-orders the menus in a frame. It moves the ``File'' and ``Edit'' - menus to the front of the menubar and moves the ``Windows'' and - ``Help'' menus to the end of the menubar. - - This is useful in conjunction with the frame classes. After - instantiating the class and adding ones own menus, the menus will be - mis-ordered. This function fixes them up.}) - - (proc-doc/names - frame:remove-empty-menus - ((is-a?/c frame%) . -> . void?) - (frame) - @{Removes empty menus in a frame.}) - - (proc-doc/names - group:get-the-frame-group - (-> (is-a?/c group:%)) - () - @{This returns the frame group.}) - - (proc-doc/names - group:on-close-action - (-> void?) - () - @{See also @scheme[group:can-close-check]. - - Call this function from the @method[top-level-window<%> can-close?] - callback of a frame in order for the group to properly close the - application.}) - - (proc-doc/names - group:can-close-check - (-> boolean?) - () - @{See also @scheme[group:on-close-action]. - - Call this function from the @method[top-level-window<%> can-close?] - callback of a frame in order for the group to properly close the - application.}) - - (proc-doc/names - handler:handler? - (any/c . -> . boolean?) - (obj) - @{This predicate determines if its input is a handler.}) - - (proc-doc/names - handler:handler-name - (handler:handler? . -> . string?) - (handler) - @{Extracts the name from a handler.}) - - (proc-doc/names - handler:handler-extension - (handler:handler? - . -> . (or/c (path? . -> . boolean?) (listof string?))) - (handler) - @{Extracts the extension from a handler.}) - - (proc-doc/names - handler:handler-handler - (handler:handler? . -> . (path? . -> . (is-a?/c frame:editor<%>))) - (handler) - @{Extracs the handler's handling function.}) - - (proc-doc/names - handler:insert-format-handler - (string? - (or/c string? (listof string?) (path? . -> . boolean?)) - (path? . -> . (or/c false/c (is-a?/c frame:editor<%>))) - . -> . - void?) - (name pred handler) - @{This function inserts a format handler. - - The string, @scheme[name] names the format handler for use with - @scheme[handler:find-named-format-handler]. If @scheme[pred] is a - string, it is matched with the extension of a filename by - @scheme[handler:find-format-handler]. If @scheme[pred] is a list of - strings, they are each matched with the extension of a filename by - @scheme[handler:find-format-handler]. If it is a function, the - filename is applied to the function and the functions result - determines if this is the handler to use. - - The most recently added format handler takes precedence over all - other format handlers.}) - - (proc-doc/names - handler:find-named-format-handler - (string? . -> . (path? . -> . (is-a?/c frame:editor<%>))) - (name) - @{This function selects a format handler. See also - @scheme[handler:insert-format-handler]. - - It finds a handler based on @scheme[name].}) - - (proc-doc/names - handler:find-format-handler - (path? . -> . (path? . -> . (is-a?/c frame:editor<%>))) - (filename) - @{This function selects a format handler. See also - @scheme[handler:insert-format-handler]. - - It finds a handler based on @scheme[filename].}) - - (proc-doc/names - handler:edit-file - (->* ((or/c path? false/c)) - ((-> (is-a?/c frame:editor<%>))) - (or/c false/c (is-a?/c frame:editor<%>))) - ((filename) - ((make-default - (λ () ((handler:current-create-new-window) filename))))) - @{This function creates a frame or re-uses an existing frame to edit a - file. - - If the preference @scheme['framework:open-here] is set to - @scheme[#t], and - @scheme[(send (group:get-the-frame-group) get-open-here-frame)] - returns a frame, the - @method[frame:open-here<%> open-here] method of that frame is used - to load the file in the existing frame. - - Otherwise, it invokes the appropriate format handler to open the - file (see @scheme[handler:insert-format-handler]). - - @itemize{ - @item{If @scheme[filename] is a string, this function checks the - result of @scheme[group:get-the-frame-group] to see if the - @scheme[filename] is already open by a frame in the group. - @itemize{ - @item{If so, it returns the frame.} - @item{If not, this function calls - @scheme[handler:find-format-handler] with - @scheme[filename]. - @itemize{ - @item{If a handler is found, it is applied to - @scheme[filename] and it's result is the - final result.} - @item{If not, @scheme[make-default] is used.}}}}} - @item{If @scheme[filename] is @scheme[#f], @scheme[make-default] - is used.}}}) - - (parameter-doc - handler:current-create-new-window - (parameter/c (-> (or/c false/c path?) (is-a?/c frame%))) - proc - @{This is a parameter that controls how the framework creates new - application windows. - - The default setting is this: - @schemeblock[ - (λ (filename) - (let ([frame (make-object frame:text-info-file% filename)]) - (send frame show #t) - frame)) - ]}) - - (proc-doc/names - handler:open-file - (->* () - ((or/c false/c path? string?)) - (or/c false/c (is-a?/c frame:basic<%>))) - (() - ((dir #f))) - @{This function queries the user for a filename and opens the file for - editing. It uses @scheme[handler:edit-file] to open the file, once - the user has chosen it. - - Calls @scheme[finder:get-file] and @scheme[handler:edit-file], passing along @scheme[dir].}) - - (proc-doc/names - handler:install-recent-items - ((is-a?/c menu%) . -> . void?) - (menu) - @{This function deletes all of the items in the given menu and adds - one menu item for each recently opened file. These menu items, when - selected, call @scheme[handler:edit-file] with the filename of the - recently opened file. - - The menu's size is limited to 10.}) - - (proc-doc/names - handler:set-recent-items-frame-superclass - ((implementation?/c frame:standard-menus<%>) . -> . void?) - (frame) - @{Sets the superclass for the recently opened files frame. It must be - derived from @scheme[frame:standard-menus].}) - - (proc-doc/names - handler:add-to-recent - (path? . -> . void?) - (filename) - @{Adds a filename to the list of recently opened files.}) - - (proc-doc/names - handler:set-recent-position - (path? number? number? . -> . void?) - (filename start end) - @{Sets the selection of the recently opened file to @scheme[start] and - @scheme[end].}) - - (proc-doc/names - handler:size-recently-opened-files - (number? . -> . void?) - (num) - @{Sizes the @scheme['framework:recently-opened-files/pos] preference - list length to @scheme[num].}) - - (proc-doc/names - icon:get-paren-highlight-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the parenthesis highlight @scheme[bitmap%]. It is only - used on black and white screens.}) - - (proc-doc/names - icon:get-eof-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the @scheme[bitmap%] used for the clickable ``eof'' - icon from @scheme[text:ports].}) - - (proc-doc/names - icon:get-autowrap-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the autowrap's @scheme[bitmap%]. - - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] - method.}) - - (proc-doc/names - icon:get-lock-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the lock's @scheme[bitmap]. - - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] - method.}) - - (proc-doc/names - icon:get-unlock-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the reset unlocked @scheme[bitmap]. - - The bitmap may not respond @scheme[#t] to the @link bitmap ok? - method.}) - - (proc-doc/names - icon:get-anchor-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the anchor's @scheme[bitmap]. - - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] - method.}) - - (proc-doc/names - icon:get-left/right-cursor - (-> (is-a?/c cursor%)) - () - @{This function returns a @link cursor object that indicates - left/right sizing is possible, for use with columns inside a window. - - The cursor may not respond @scheme[#t] to the @link cursor ok? - method.}) - - (proc-doc/names - icon:get-up/down-cursor - (-> (is-a?/c cursor%)) - () - @{This function returns a @scheme[cursor%] object that indicates - up/down sizing is possible, for use with columns inside a window. - - The cursor may not respond @scheme[#t] to the @method[cursor% ok?] - method.}) - - (proc-doc/names - icon:get-gc-on-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns a bitmap to be displayed in an @scheme[frame:info<%>] - frame when garbage collection is taking place. - - The bitmap may not respond @scheme[#t] to the @link bitmap ok? - method.}) - - (proc-doc/names - icon:get-gc-off-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns a bitmap to be displayed in an @scheme[frame:info<%>] - frame when garbage collection is not taking place. - - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] - method.}) - - (proc-doc/names - keymap:remove-user-keybindings-file - (-> any/c any) - (user-keybindings-path) - @{Removes the keymap previously added by - @scheme[keymap:add-user-keybindings-file].}) - - (proc-doc/names - keymap:add-user-keybindings-file - (-> any/c any) - (user-keybindings-path-or-require-spec) - @{Chains the keymap defined by - @scheme[user-keybindings-path-or-require-spec] to the global keymap, - returned by @scheme[keymap:get-global]. - - If @scheme[user-keybindings-path-or-require-spec] is a path, the - module is loaded directly from that path. Otherwise, - @scheme[user-keybindings-path-or-require-spec] is treated like an - argument to @scheme[require].}) - - (parameter-doc - keymap:add-to-right-button-menu - (parameter/c - (-> (is-a?/c popup-menu%) (is-a?/c editor<%>) (is-a?/c event%) void?)) - proc - @{When the keymap that @scheme[keymap:get-global] returns is installed - into an editor, this parameter's value is used for right button - clicks. - - Before calling this procedure, the function - @scheme[append-editor-operation-menu-items] is called. - - See also @scheme[keymap:add-to-right-button-menu/before].}) - - (parameter-doc - keymap:add-to-right-button-menu/before - (parameter/c - (-> (is-a?/c popup-menu%) (is-a?/c editor<%>) (is-a?/c event%) void?)) - proc - @{When the keymap that @scheme[keymap:get-global] returns is installed - into an editor, this function is called for right button clicks. - - After calling this procedure, the function - @scheme[append-editor-operation-menu-items] is called. - - See also @scheme[keymap:add-to-right-button-menu].}) - - (proc-doc/names - keymap:call/text-keymap-initializer - ((-> any/c) . -> . any/c) - (thunk-proc) - @{Thus function parameterizes the call to @scheme[thunk-proc] by - setting the keymap-initialization procedure (see - @scheme[current-text-keymap-initializer]) to install the framework's - standard text bindings.}) - - (proc-doc/names - keymap:canonicalize-keybinding-string - (string? . -> . string?) - (keybinding-string) - @{Returns a string that denotes the same keybindings as the input - string, except that it is in canonical form; two canonical - keybinding strings can be compared with @scheme[string=?].}) - - (proc-doc/names - keymap:get-editor - (-> (is-a?/c keymap%)) - () - @{This returns a keymap for handling standard editing operations. It - binds these keys: - - @itemize{ - @item{@scheme["z"]: undo} - @item{@scheme["y"]: redo} - @item{@scheme["x"]: cut} - @item{@scheme["c"]: copy} - @item{@scheme["v"]: paste} - @item{@scheme["a"]: select all}} - where each key is prefixed with the menu-shortcut key, based on the - platform. Under unix, the shortcut is @scheme["a:"]; under windows - the shortcut key is @scheme["c:"] and under MacOS, the shortcut key - is @scheme["d:"].}) - - (proc-doc/names - keymap:get-file - (-> (is-a?/c keymap%)) - () - @{This returns a keymap for handling file operations.}) - - (proc-doc/names - keymap:get-global - (-> (is-a?/c keymap%)) - () - @{This returns a keymap for general operations. See - @scheme[keymap:setup-global] for a list of the bindings this keymap - contains.}) - - (proc-doc/names - keymap:get-search - (-> (is-a?/c keymap%)) - () - @{This returns a keymap for searching operations.}) - - (proc-doc/names - keymap:make-meta-prefix-list - (string? . -> . (listof string?)) - (key) - @{This prefixes a key with all of the different meta prefixes and - returns a list of the prefixed strings. - - takes a keymap, a base key specification, and a function name; it - prefixes the base key with all ``meta'' combination prefixes, and - installs the new combinations into the keymap. For example, - @scheme[(keymap:send-map-function-meta keymap "a" func)] maps - @scheme["m:a"] and @scheme["ESC;a"] to @scheme[func].}) - - (proc-doc/names - keymap:send-map-function-meta - ((is-a?/c keymap%) string? string? . -> . void?) - (keymap key func) - @{@index{Meta} Most keyboard and mouse mappings are inserted into a - keymap by calling the keymap's @method[keymap% map-function] method. - However, ``meta'' combinations require special attention. The - @scheme["m:"] prefix recognized by @method[keymap% map-function] - applies only to the Meta key that exists on some keyboards. By - convention, however, ``meta'' combinations can also be accessed by - using ``ESC'' as a prefix. - - This procedure binds all of the key-bindings obtained by prefixing - @scheme[key] with a meta-prefix to @scheme[func] in - @scheme[keymap].}) - - (proc-doc/names - keymap:setup-editor - ((is-a?/c keymap%) . -> . void?) - (keymap) - @{This sets up the input keymap with the bindings described in - @scheme[keymap:get-editor].}) - - (proc-doc/names - keymap:setup-file - ((is-a?/c keymap%) . -> . void?) - (keymap) - @{This extends a @scheme[keymap%] with the bindings for files.}) - - (proc-doc/names - keymap:setup-global - ((is-a?/c keymap%) . -> . void?) - (keymap) - @{This extends a @scheme[keymap%] with the general bindings. - - This function extends a @scheme[keymap%] with the following - functions: - @itemize{ - @item{@mapdesc[ring-bell any] --- Rings the bell (using - @scheme[bell]) and removes the search panel from the frame, - if there.} - @item{@mapdesc[save-file key] --- Saves the buffer. If the buffer - has no name, then - @scheme[finder:put-file]@index["finder:put-file"] is - invoked.} - @item{@mapdesc[save-file-as key] --- Calls - @scheme[finder:put-file]@index["finder:put-file"] to save - the buffer.} - @item{@mapdesc[load-file key] --- Invokes - @scheme[finder:open-file]@index["finder:open-file"].} - @item{@mapdesc[find-string key] --- Opens the search buffer at the - bottom of the frame, unless it is already open, in which - case it searches for the text in the search buffer.} - @item{@mapdesc[find-string-reverse key] --- Same as - ``find-string'', but in the reverse direction.} - @item{@mapdesc[find-string-replace key] --- Opens a replace string - dialog box.} - @item{@mapdesc[toggle-anchor key] --- Turns selection-anchoring on - or off.} - @item{@mapdesc[center-view-on-line key] --- Centers the buffer in - its display using the currently selected line.} - @item{@mapdesc[collapse-space key] --- Collapses all non-return - whitespace around the caret into a single space.} - @item{@mapdesc[remove-space key] --- Removes all non-return - whitespace around the caret.} - @item{@mapdesc[collapse-newline key] --- Collapses all empty lines - around the caret into a single empty line. If there is only - one empty line, it is removed.} - @item{@mapdesc[open-line key] --- Inserts a new line.} - @item{@mapdesc[transpose-chars key] --- Transposes the characters - before and after the caret and moves forward one position.} - @item{@mapdesc[transpose-words key] --- Transposes words before - and after the caret and moves forward one word.} - @item{@mapdesc[capitalize-word key] --- Changes the first - character of the next word to a capital letter and moves to - the end of the word.} - @item{@mapdesc[upcase-word key] --- Changes all characters of the - next word to capital letters and moves to the end of the - word.} - @item{@mapdesc[downcase-word key] --- Changes all characters - of the next word to lowercase letters and moves to the end - of the word.} - @item{@mapdesc[kill-word key] --- Kills the next word.} - @item{@mapdesc[backward-kill-word key] --- Kills the previous - word.} - @item{@mapdesc[goto-line any] --- Queries the user for a line - number and moves the caret there.} - @item{@mapdesc[goto-position any] --- Queries the user for a - position number and moves the caret there.} - @item{@mapdesc[copy-clipboard mouse] --- Copies the current - selection to the clipboard.} - @item{@mapdesc[cut-clipboard mouse] --- Cuts the current selection - to the clipboard.} - @item{@mapdesc[paste-clipboard mouse] --- Patses the clipboard to - the current selection.} - @item{@mapdesc[copy-click-region mouse] --- Copies the region - between the caret and the input mouse event.} - @item{@mapdesc[cut-click-region mouse] --- Cuts the region - between the caret and the input mouse event.} - @item{@mapdesc[paste-click-region mouse] --- Pastes the clipboard - into the position of the input mouse event.} - @item{@mapdesc[select-click-word mouse] --- Selects the word under - the input mouse event.} - @item{@mapdesc[select-click-line mouse] --- Selects the line under - the input mouse event.} - @item{@mapdesc[start-macro key] -- Starts building a keyboard - macro} - @item{@mapdesc[end-macro key] --- Stops building a keyboard macro} - @item{@mapdesc[do-macro key] --- Executes the last keyboard macro} - @item{@mapdesc[toggle-overwrite key] --- Toggles overwriting - mode}} - - These functions are bound to the following keys - (C = control, S = shift, A = alt, M = ``meta'', D = command): - - @itemize{ - @item{C-g : ``ring-bell''} - @item{M-C-g : ``ring-bell''} - @item{C-c C-g : ``ring-bell''} - @item{C-x C-g : ``ring-bell''} - @item{C-p : ``previous-line''} - @item{S-C-p : ``select-previous-line''} - @item{C-n : ``next-line''} - @item{S-C-n : ``select-next-line''} - @item{C-e : ``end-of-line''} - @item{S-C-e : ``select-to-end-of-line''} - @item{D-RIGHT : ``end-of-line''} - @item{S-D-RIGHT : ``select-to-end-of-line''} - @item{M-RIGHT : ``end-of-line''} - @item{S-M-RIGHT : ``select-to-end-of-line''} - @item{C-a : ``beginning-of-line''} - @item{S-C-a : ``select-to-beginning-of-line''} - @item{D-LEFT : ``beginning-of-line''} - @item{D-S-LEFT : ``select-to-beginning-of-line''} - @item{M-LEFT : ``beginning-of-line''} - @item{M-S-LEFT : ``select-to-beginning-of-line''} - @item{C-h : ``delete-previous-character''} - @item{C-d : ``delete-next-character''} - @item{C-f : ``forward-character''} - @item{S-C-f : ``select-forward-character''} - @item{C-b : ``backward-character''} - @item{S-C-b : ``select-backward-character''} - @item{M-f : ``forward-word''} - @item{S-M-f : ``select-forward-word''} - @item{A-RIGHT : ``forward-word''} - @item{A-S-RIGHT : ``forward-select-word''} - @item{M-b : ``backward-word''} - @item{S-M-b : ``select-backward-word''} - @item{A-LEFT : ``backward-word''} - @item{A-S-LEFT : ``backward-select-word''} - @item{M-d : ``kill-word''} - @item{M-DELETE : ``backward-kill-word''} - @item{M-c : ``capitalize-word''} - @item{M-u : ``upcase-word''} - @item{M-l : ``downcase-word''} - @item{M-< : ``beginning-of-file''} - @item{S-M-< : ``select-to-beginning-of-file''} - @item{M-> : ``end-of-file''} - @item{S-M-> : ``select-to-end-of-file''} - @item{C-v : ``next-page''} - @item{S-C-v : ``select-next-page''} - @item{M-v : ``previous-page''} - @item{S-M-v : ``select-previous-page''} - @item{C-l : ``center-view-on-line''} - @item{C-k : ``delete-to-end-of-line''} - @item{C-y : ``paste-clipboard'' (Except Windows)} - @item{A-v : ``paste-clipboard''} - @item{D-v : ``paste-clipboard''} - @item{C-_ : ``undo''} - @item{C-x u : ``undo''} - @item{C-+ : ``redo''} - @item{C-w : ``cut-clipboard''} - @item{M-w : ``copy-clipboard''} - @item{C-x C-s : ``save-file''} - @item{C-x C-w : ``save-file-as''} - @item{C-x C-f : ``load-file''} - @item{C-s : ``find-string''} - @item{C-r : ``find-string-reverse''} - @item{M-% : ``find-string-replace''} - @item{SPACE : ``collapse-space''} - @item{M-Backslash : ``remove-space''} - @item{C-x C-o : ``collapse-newline''} - @item{C-o : ``open-line''} - @item{C-t : ``transpose-chars''} - @item{M-t : ``transpose-words''} - @item{C-SPACE : ``toggle-anchor''} - @item{M-g : ``goto-line''} - @item{M-p : ``goto-position''} - @item{LEFTBUTTONTRIPLE : ``select-click-line''} - @item{LEFTBUTTONDOUBLE : ``select-click-word''} - @item{RIGHTBUTTON : ``copy-click-region''} - @item{RIGHTBUTTONDOUBLE : ``cut-click-region''} - @item{MIDDLEBUTTON : ``paste-click-region''} - @item{C-RIGHTBUTTON : ``copy-clipboard''} - @item{INSERT : ``toggle-overwrite''} - @item{M-o : ``toggle-overwrite''}}}) - - (proc-doc/names - keymap:setup-search - ((is-a?/c keymap%) . -> . void?) - (keymap) - @{This extends a @link keymap with the bindings for searching.}) - - (proc-doc/names - keymap:set-chained-keymaps - ((is-a?/c keymap:aug-keymap<%>) - (listof (is-a?/c keymap%)) - . -> . - void?) - (keymap children-keymaps) - @{Sets @scheme[keymap]'s chained keymaps to @scheme[children-keymaps], - unchaining any keymaps that are currently chained to - @scheme[keymap].}) - - (proc-doc/names - keymap:remove-chained-keymap - ((is-a?/c editor<%>) - (is-a?/c keymap:aug-keymap<%>) - . -> . - void?) - (editor keymap) - @{Removes @scheme[keymap] from the keymaps chained to @scheme[editor]. - Also (indirectly) removes all keymaps chained to @scheme[keymap] - from @scheme[editor], since they are removed when unchaining - @scheme[keymap] itself. - - Each of the keymaps chained to @scheme[editor] must be an - @scheme[keymap:aug-keymap%] and @scheme[keymap] cannot be the result - of @scheme[(send editor get-keymap)] That is, @scheme[keymap] must - be chained to some keymap attached to the editor.}) - - (proc-doc/names - scheme:text-balanced? - (->* ((is-a?/c text%)) - (number? (or/c false/c number?)) - boolean?) - ((text) - ((start 0) (end #f))) - @{Determines if the range in the editor from @scheme[start] to - @scheme[end] in @scheme[text] is a matched set of parenthesis. If - @scheme[end] is @scheme[#f], it defaults to the last position of the - @scheme[text]. - - The implementation of this function creates a port with - @scheme[open-input-text-editor] and then uses `read' to parse the - range of the buffer.}) - - (proc-doc/names - scheme:add-preferences-panel - (-> void?) - () - @{Adds a tabbing preferences panel to the preferences dialog.}) - - (proc-doc/names - scheme:get-keymap - (-> (is-a?/c keymap%)) - () - @{Returns a keymap with binding suitable for Scheme.}) - - (proc-doc/names - scheme:add-coloring-preferences-panel - (-> any) - () - @{ - Installs the ``Scheme'' preferences panel in the ``Syntax Coloring'' - section.}) - - (proc-doc/names - scheme:get-color-prefs-table - (-> (listof (list/c symbol? (is-a?/c color%)))) - () - @{Returns - a table mapping from symbols - (naming the categories that the online colorer uses for Scheme mode coloring) to their colors. - - These symbols are suitable for input to - @scheme[scheme:short-sym->pref-name] and - @scheme[scheme:short-sym->style-name]. - - See also @scheme[scheme:get-white-on-black-color-prefs-table].}) - - (proc-doc/names - scheme:get-white-on-black-color-prefs-table - (-> (listof (list/c symbol? (is-a?/c color%)))) - () - @{Returns - a table mapping from symbols - (naming the categories that the online colorer uses for Scheme mode coloring) to their colors when - the user chooses the white-on-black mode in the preferences dialog. - - See also @scheme[scheme:get-color-prefs-table].}) - - (proc-doc/names - scheme:short-sym->pref-name - (symbol? . -> . symbol?) - (short-sym) - @{Builds the symbol naming the preference from one of the symbols in - the table returned by @scheme[scheme:get-color-prefs-table].}) - - (proc-doc/names - scheme:short-sym->style-name - (symbol? . -> . string?) - (short-sym) - @{Builds the symbol naming the editor style from one of the symbols in - the table returned by @scheme[scheme:get-color-prefs-table]. This - style is a named style in the style list returned by - @scheme[editor:get-standard-style-list].}) - - (proc-doc/names - scheme:get-wordbreak-map - (-> (is-a?/c editor-wordbreak-map%)) - () - @{This method returns a @link editor-wordbreak-map that is suitable - for Scheme.}) - - (proc-doc/names - scheme:init-wordbreak-map - ((is-a?/c keymap%) . -> . void?) - (key) - @{Initializes the workdbreak map for @scheme[keymap].}) - - (proc-doc/names - scheme:setup-keymap - ((is-a?/c keymap%) . -> . void?) - (keymap) - @{Initializes @scheme[keymap] with Scheme-mode keybindings.}) - - (proc-doc/names - editor:set-default-font-color - (-> (is-a?/c color%) void?) - (color) - @{Sets the color of the style named - @scheme[editor:get-default-color-style-name].}) - - (proc-doc/names - editor:get-default-color-style-name - (-> string?) - () - @{The name of the style (in the list returned by - @scheme[editor:get-standard-style-list]) that holds the default - color.}) - - (proc-doc/names - editor:set-standard-style-list-delta - (string? (is-a?/c style-delta%) . -> . void?) - (name delta) - @{Finds (or creates) the style named by @scheme[name] in the result of - @scheme[editor:get-standard-style-list] and sets its delta to - @scheme[delta]. - - If the style named by @scheme[name] is already in the style list, it - must be a delta style.}) - - (proc-doc/names - editor:set-standard-style-list-pref-callbacks - (-> any) - () - @{Installs the font preference callbacks that update the style list - returned by @scheme[editor:get-standard-style-list] based on the - font preference symbols.}) - - (proc-doc/names - editor:get-standard-style-list - (-> (is-a?/c style-list%)) - () - @{Returns a style list that is used for all instances of - @scheme[editor:standard-style-list%].}) - - (proc-doc/names - color-model:rgb->xyz - (number? number? number? . -> . color-model:xyz?) - (r g b) - @{Converts a color represented as a red-green-blue tuple (each value - from 0 to 255) into an XYZ tuple. This describes a point in the CIE - XYZ color space.}) - - (proc-doc/names - color-model:rgb-color-distance - (number? number? number? number? number? number? . -> . number?) - (red-a green-a blue-a red-b green-b blue-b) - @{This calculates a distance between two colors. The smaller the - distance, the closer the colors should appear to the human eye. A - distance of 10 is reasonably close that it could be called the same - color. - - This function is not symmetric in red, green, and blue, so it is - important to pass red, green, and blue components of the colors in - the the proper order. The first three arguments are red, green and - blue for the first color, respectively, and the second three - arguments are red green and blue for the second color, - respectively.}) - - (proc-doc/names - color-model:xyz->rgb - (number? number? number? . -> . (list/c number? number? number?)) - (x y z) - @{Converts an XYZ-tuple (in the CIE XYZ colorspace) into a list of - values representing an RGB-tuple.}) - - (proc-doc/names - color-model:xyz? - (any/c . -> . boolean?) - (val) - @{Determines if @scheme[val] an xyz color record.}) - - (proc-doc/names - color-model:xyz-x - (color-model:xyz? . -> . number?) - (xyz) - @{Extracts the x component of @scheme[xyz].}) - - (proc-doc/names - color-model:xyz-y - (color-model:xyz? . -> . number?) - (xyz) - @{Extracts the y component of @scheme[xyz].}) - - (proc-doc/names - color-model:xyz-z - (color-model:xyz? . -> . number?) - (xyz) - @{Extracts the z component of @scheme[xyz].}) - - (proc-doc/names - color-prefs:set-default/color-scheme - (-> symbol? - (or/c (is-a?/c color%) string?) - (or/c (is-a?/c color%) string?) - void?) - (pref-sym black-on-white-color white-on-black-color) - @{Registers a preference whose value will be updated when the user - clicks on one of the color scheme default settings in the - preferences dialog. - - Also calls @scheme[preferences:set-default] and - @scheme[preferences:set-un/marshall] with appropriate arguments to - register the preference.}) - - (proc-doc/names - color-prefs:register-color-preference - (->* (symbol? string? (or/c (is-a?/c color%) (is-a?/c style-delta%))) - ((or/c string? (is-a?/c color%) false/c)) - void?) - ((pref-name style-name color/sd) - ((white-on-black-color #f))) - @{This function registers a color preference and initializes the style - list returned from @scheme[editor:get-standard-style-list]. In - particular, it calls @scheme[preferences:set-default] and - @scheme[preferences:set-un/marshall] to install the pref for - @scheme[pref-name], using @scheme[color/sd] as the default - color. The preference is bound to a @scheme[style-delta%], and - initially the @scheme[style-delta%] changes the foreground color to - @scheme[color/sd], unless @scheme[color/sd] is a style delta - already, in which case it is just used directly. Then, it calls - @scheme[editor:set-standard-style-list-delta] passing the - @scheme[style-name] and the current value of the preference - @scheme[pref-name]. - - Finally, it adds calls @scheme[preferences:add-callback] to set a - callback for @scheme[pref-name] that updates the style list when the - preference changes. - - If @scheme[white-on-black-color] is not @scheme[#f], then the color - of the @scheme[color/sd] argument is used in combination with - @scheme[white-on-black-color] to register this preference with - @scheme[color-prefs:set-default/color-scheme].}) - - (proc-doc/names - color-prefs:add-background-preferences-panel - (-> void?) - () - @{Adds a preferences panel that configures the background color for - @scheme[editor:basic-mixin].}) - - (proc-doc/names - color-prefs:add-to-preferences-panel - (string? ((is-a?/c vertical-panel%) . -> . void?) . -> . void?) - (name func) - @{Calls @scheme[func] with the subpanel of the preferences coloring - panel that corresponds to @scheme[name].}) - - (proc-doc/names - color-prefs:build-color-selection-panel - ((is-a?/c area-container<%>) symbol? string? string? . -> . void?) - (parent pref-sym style-name example-text) - @{Builds a panel with a number of controls for configuring a font: the - color and check boxes for bold, italic, and underline. The - @scheme[parent] argument specifies where the panel will be placed. - The @scheme[pref-sym] should be a preference - (suitable for use with @scheme[preferences:get] and @scheme[preferences:set]). - The - @scheme[style-name] specifies the name of a style in the style list - returned from @scheme[editor:get-standard-style-list] and - @scheme[example-text] is shown in the panel so users can see the - results of their configuration.}) - - (proc-doc/names - color-prefs:marshall-style-delta - (-> (is-a?/c style-delta%) printable/c) - (style-delta) - @{Builds a printed representation for a style-delta.}) - - (proc-doc/names - color-prefs:unmarshall-style-delta - (-> printable/c (or/c false/c (is-a?/c style-delta%))) - (marshalled-style-delta) - @{Builds a style delta from its printed representation. Returns - @scheme[#f] if the printed form cannot be parsed.})) diff --git a/collects/framework/preferences.ss b/collects/framework/preferences.ss index f57fa58543..0994e818e1 100644 --- a/collects/framework/preferences.ss +++ b/collects/framework/preferences.ss @@ -300,52 +300,6 @@ the state transitions / contracts are: (provide/doc - (proc-doc/names - preferences:snapshot? - (-> any/c boolean?) - (arg) - @{Determines if its argument is a preferences snapshot. - - See also - @scheme[preferences:get-prefs-snapshot] and - @scheme[preferences:restore-prefs-snapshot].}) - (proc-doc/names - preferences:restore-prefs-snapshot - (-> preferences:snapshot? void?) - (snapshot) - @{Restores the preferences saved in @scheme[snapshot]. - - See also @scheme[preferences:get-prefs-snapshot].}) - - (proc-doc/names - preferences:get-prefs-snapshot - (-> preferences:snapshot?) - () - @{Caches all of the current values of the preferences and returns them. - - See also - @scheme[preferences:restore-prefs-snapshot].}) - - - (proc-doc/names - exn:make-unknown-preference - (string? continuation-mark-set? . -> . exn:unknown-preference?) - (message continuation-marks) - @{Creates an unknown preference exception.}) - (proc-doc/names - exn:unknown-preference? - (any/c . -> . boolean?) - (exn) - @{Determines if a value is an unknown preference exn.}) - - (parameter-doc - preferences:low-level-put-preferences - (parameter/c (-> (listof symbol?) (listof any/c) any)) - put-preference - @{This parameter's value - is called when to save preference the preferences. Its interface should - be just like mzlib's @scheme[put-preference].}) - (proc-doc/names preferences:get (symbol? . -> . any/c) @@ -355,8 +309,8 @@ the state transitions / contracts are: @scheme[preferences:get] returns the value for the preference @scheme[symbol]. It raises @index['("exn:unknown-preference")]{@scheme[exn:unknown-preference]} - @scheme[exn:unknown-preference] if the preference's default has not been set.}) + (proc-doc/names preferences:set (symbol? any/c . -> . void?) @@ -372,6 +326,7 @@ the state transitions / contracts are: It raises @index['("exn:unknown-preference")]{@scheme[exn:unknown-preference]} if the preference's default has not been set.}) + (proc-doc/names preferences:add-callback (->* (symbol? @@ -461,4 +416,52 @@ the state transitions / contracts are: () @{@scheme[(preferences:restore-defaults)] restores the users's configuration to the - default preferences.})) + default preferences.}) + + + + (proc-doc/names + exn:make-unknown-preference + (string? continuation-mark-set? . -> . exn:unknown-preference?) + (message continuation-marks) + @{Creates an unknown preference exception.}) + + (proc-doc/names + exn:unknown-preference? + (any/c . -> . boolean?) + (exn) + @{Determines if a value is an unknown preference exn.}) + + (parameter-doc + preferences:low-level-put-preferences + (parameter/c (-> (listof symbol?) (listof any/c) any)) + put-preference + @{This parameter's value + is called when to save preference the preferences. Its interface should + be just like mzlib's @scheme[put-preference].}) + + (proc-doc/names + preferences:snapshot? + (-> any/c boolean?) + (arg) + @{Determines if its argument is a preferences snapshot. + + See also + @scheme[preferences:get-prefs-snapshot] and + @scheme[preferences:restore-prefs-snapshot].}) + (proc-doc/names + preferences:restore-prefs-snapshot + (-> preferences:snapshot? void?) + (snapshot) + @{Restores the preferences saved in @scheme[snapshot]. + + See also @scheme[preferences:get-prefs-snapshot].}) + + (proc-doc/names + preferences:get-prefs-snapshot + (-> preferences:snapshot?) + () + @{Caches all of the current values of the preferences and returns them. + + See also + @scheme[preferences:restore-prefs-snapshot].})) diff --git a/collects/framework/private/framework-exports.ss b/collects/framework/private/framework-exports.ss deleted file mode 100644 index 7325e117a3..0000000000 --- a/collects/framework/private/framework-exports.ss +++ /dev/null @@ -1,1368 +0,0 @@ -#reader(lib "reader.ss" "scribble") -#lang scheme/base - -(require (for-syntax scheme/base)) -(provide framework-exports - framework-exports/srcloc-preserved) - -(define-syntax (framework-exports stx) - (syntax-case stx () - [(_ id) - #'(id - - (text:autocomplete-append-after - (parameter/c string?) - () - @{A string that is inserted after a completions is inserted by a - @scheme[text:autocomplete] instance. - - Defaults to @scheme[""].}) - - (text:autocomplete-limit - (parameter/c (and/c integer? exact? positive?)) - () - @{Controls the number of completions visible at a time in the menu - produced by @scheme[text:autocomplete] instances. - - Defaults to 15.}) - - (text:get-completions/manuals - (-> (or/c false/c (listof symbol?)) (listof string?)) - (manuals) - @{Returns the list of keywords for the manuals from @scheme[manuals] - by extracting all of the documented exports of the manuals. The - symbols are meant to be module paths. If @scheme[manuals] is false, - then all of the documented names are used.}) - - (number-snip:make-repeating-decimal-snip - (number? boolean? . -> . (is-a?/c snip%)) - (num show-prefix?) - @{Makes a number snip that shows the decimal expansion for - @scheme[number] The boolean indicates if a @litchar{#e} prefix - appears on the number. - - See also @scheme[number-snip:make-fraction-snip].}) - - (number-snip:make-fraction-snip - (number? boolean? . -> . (is-a?/c snip%)) - (num show-prefix-in-decimal-view?) - @{Makes a number snip that shows a fractional view of @scheme[number]. - The boolean indicates if a @litchar{#e} prefix appears on the - number, when shown in the decimal state. - - See also @scheme[number-snip:make-repeating-decimal-snip].}) - - (version:add-spec - (any/c any/c . -> . void?) - (spec revision) - @{These two values are appended to the version string. @scheme[write] - is used to transform them to strings. For example: - - @scheme[(version:add-spec 's 1)] - - in version 205 will make the version string be @litchar{205s1}. The - symbols @scheme['f] and @scheme['d] are used internally for - framework and drscheme revisions.}) - - (version:version - (-> string?) - () - @{This function returns a string describing the version of this - application. See also @scheme[version:add-spec].}) - - (application:current-app-name - (parameter/c string?) - () - @{This is a parameter specifying the name of the current - application. It is used in the help menu (see - @scheme[frame:standard-menus%]) and in frame titles (see - @scheme[frame:editor%]). - - The first case in the case-lambda returns the current name, and the - second case in the case-lambda sets the name of the application to - @scheme[name].}) - - (preferences:put-preferences/gui - (-> (listof symbol?) - (listof any/c) - any) - (name-list val-list) - @{Like @scheme[put-preferences], but has more sophisticated error - handling. In particular, it - @itemize{ - @item{waits for three consecutive failures before informing the - user} - @item{gives the user the opportunity to ``steal'' the lockfile - after the third failure, and} - @item{when failures occur, it remembers what its arguments were - and if any preference save eventually succeeds, all of the - past failures are also written at that point.}}}) - - (preferences:add-panel - (-> (or/c string? (cons/c string? (listof string?))) - (->d ([parent (is-a?/c area-container-window<%>)]) - () - [_ - (let ([old-children (send parent get-children)]) - (and/c (is-a?/c area-container-window<%>) - (λ (child) - (andmap eq? - (append old-children (list child)) - (send parent get-children)))))]) - void?) - (labels f) - @{@scheme[preferences:add-preference-panel] adds the result of - @scheme[f] with name @scheme[labels] to the preferences dialog box. - - The labels determine where this preference panel is placed in the - dialog. If the list is just one string, the preferences panel is - placed at the top level of the dialog. If there are more strings, a - hierarchy of nested panels is created and the new panel is added at - the end. If multiple calls to - @scheme[preferences:add-preference-panel] pass the same prefix of - strings, those panels are placed in the same children. - - When the preference dialog is opened for the first time, the - function @scheme[f] is called with a panel, and @scheme[f] is - expected to add a new child panel to it and add whatever preferences - configuration controls it wants to that panel. Then, @scheme[f]'s - should return the panel it added.}) - - (preferences:add-editor-checkbox-panel - (-> void?) - () - @{Adds a preferences panel for configuring options related to - editing.}) - - (preferences:add-warnings-checkbox-panel - (-> void?) - () - @{Adds a preferences panel for configuring options relating to - warnings.}) - - (preferences:add-scheme-checkbox-panel - (-> void?) - () - @{Adds a preferences panel for configuring options related to - Scheme.}) - - (preferences:add-to-warnings-checkbox-panel - (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) - (proc) - @{Saves @scheme[proc] until the preferences panel is created, when it - is called with the Misc. panel to add new children to the panel.}) - - (preferences:add-to-scheme-checkbox-panel - (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) - (proc) - @{Saves @scheme[proc] until the preferences panel is created, when it - is called with the Scheme preferences panel to add new children to - the panel.}) - - (preferences:add-to-editor-checkbox-panel - (((is-a?/c vertical-panel%) . -> . void?) . -> . void?) - (proc) - @{Saves @scheme[proc] until the preferences panel is created, when it - is called with the Echeme preferences panel to add new children to - the panel.}) - - (preferences:add-font-panel - (-> void?) - () - @{Adds a font selection preferences panel to the preferences dialog.}) - - (preferences:show-dialog - (-> void?) - () - @{Shows the preferences dialog.}) - - (preferences:hide-dialog - (-> void?) - () - @{Hides the preferences dialog.}) - - (preferences:add-on-close-dialog-callback - ((-> void?) . -> . void?) - (cb) - @{Registers @scheme[cb]. Next time the user clicks the OK button the - preferences dialog, all of the @scheme[cb] functions are called, - assuming that each of the callbacks passed to - @scheme[preferences:add-can-close-dialog-callback] succeed.}) - - (preferences:add-can-close-dialog-callback - ((-> boolean?) . -> . void?) - (cb) - @{Registers @scheme[cb]. Next time the user clicks the OK button the - preferences dialog, all of the @scheme[cb] functions are called. If - any of them return @scheme[#f], the dialog is not closed. - - See also @scheme[preferences:add-on-close-dialog-callback].}) - - (autosave:register - ((and/c (is-a?/c autosave:autosavable<%>) - (is-a?/c editor<%>)) - . -> . - void?) - (obj) - @{Adds @scheme[obj] to the list of objects to be autosaved. When it - is time to autosave, the @scheme[do-autosave] method of the object - is called. This method is responsible for performing the autosave. - - There is no need to de-register an object because the autosaver - keeps a ``weak'' pointer to the object; i.e., the autosaver does not - keep an object from garbage collection.}) - - (autosave:restore-autosave-files/gui - (-> void?) - () - @{Opens a GUI to ask the user about recovering any autosave files left - around from crashes and things. - - This function doesn't return until the user has finished restoring - the autosave files. (It uses yield to handle events however.)}) - - (exit:exiting? - (-> boolean?) - () - @{Returns @scheme[#t] to indicate that an exit operation is taking - place. Does not indicate that the app will actually exit, since the - user may cancel the exit. - - See also @scheme[exit:insert-on-callback] and - @scheme[exit:insert-can?-callback].}) - - (exit:set-exiting - (boolean? . -> . void?) - (exiting?) - @{Sets a flag that affects the result of @scheme[exit:exiting?].}) - - (exit:insert-on-callback - ((-> void?) . -> . (-> void?)) - (callback) - @{Adds a callback to be called when exiting. This callback must not - fail. If a callback should stop an exit from happening, use - @scheme[exit:insert-can?-callback].}) - - (exit:insert-can?-callback - ((-> boolean?) . -> . (-> void?)) - (callback) - @{Use this function to add a callback that determines if an attempted - exit can proceed. This callback should not clean up any state, - since another callback may veto the exit. Use - @scheme[exit:insert-on-callback] for callbacks that clean up - state.}) - - (exit:can-exit? - (-> boolean?) - () - @{Calls the ``can-callbacks'' and returns their results. See - @scheme[exit:insert-can?-callback] for more information.}) - - (exit:on-exit - (-> void?) - () - @{Calls the ``on-callbacks''. See @scheme[exit:insert-on-callback] - for more information.}) - - (exit:exit - (-> any) - () - @{@scheme[exit:exit] performs four actions: - @itemize{ - @item{sets the result of the @scheme[exit:exiting?] function to - @scheme[#t].} - @item{invokes the exit-callbacks, with @scheme[exit:can-exit?] if - none of the ``can?'' callbacks return @scheme[#f],} - @item{invokes @scheme[exit:on-exit] and then} - @item{queues a callback that calls @scheme[exit] (a mzscheme - procedure) and (if @scheme[exit] returns) sets the result of - @scheme[exit:exiting?] back to @scheme[#t].}}}) - - (exit:user-oks-exit - (-> boolean?) - () - @{Opens a dialog that queries the user about exiting. Returns the - user's decision.}) - - (path-utils:generate-autosave-name - (string? . -> . string?) - (filename) - @{Generates a name for an autosave file from @scheme[filename].}) - - (path-utils:generate-backup-name - (path? . -> . path?) - (filename) - @{Generates a name for an backup file from @scheme[filename].}) - - (finder:dialog-parent-parameter - (parameter/c (or/c false/c (is-a?/c dialog%) (is-a?/c frame%))) - () - @{This parameter determines the parent of the dialogs created by - @scheme[finder:get-file], @scheme[finder:put-file], - @scheme[finder:common-get-file], @scheme[finder:common-put-file], - @scheme[finder:common-get-file-list], @scheme[finder:std-get-file], - and @scheme[finder:std-put-file].}) - - (finder:default-extension - (parameter/c string?) - () - @{This parameter controls the default extension for the framework's - @scheme[finder:put-file] dialog. Its value gets passed as the - @scheme[default-extension] argument to @scheme[put-file]. - - Its default value is @scheme[""].}) - - (finder:default-filters - (parameter/c (listof (list/c string? string?))) - () - @{ - This parameter controls the default extension for the framework's - @scheme[finder:put-file] dialog. Its value gets passed as the - @scheme[default-filters] argument to @scheme[put-file]. - - Its default value is @scheme['(("Any" "*.*"))].}) - - (finder:common-put-file - (->* () - (string? - (or/c false/c path?) - boolean? - string? - (or/c false/c byte-regexp?) - string? - (or/c (is-a?/c top-level-window<%>) false/c)) - (or/c false/c path?)) - (() - ((name "Untitled") - (directory #f) - (replace? #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent (finder:dialog-parent-parameter)))) - @{This procedure queries the user for a single filename, using a - platform-independent dialog box. Consider using - @scheme[finder:put-file] instead of this function. - - See section @secref{selecting-a-filename} for more information.}) - - (finder:common-get-file - (->* () - ((or/c path? false/c) - string? - (or/c byte-regexp? false/c) - string? - (or/c false/c (is-a?/c top-level-window<%>))) - (or/c path? false/c)) - (() - ((directory #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent #f))) - @{This procedure queries the user for a single filename, using a - platform-independent dialog box. Consider using - @scheme[finder:get-file] instead of this function. - - See section @secref{selecting-a-filename} for more information.}) - - (finder:std-put-file - (->* () - (string? - (or/c false/c path?) - boolean? - string? - (or/c false/c byte-regexp?) - string? - (or/c (is-a?/c top-level-window<%>) false/c)) - (or/c false/c path?)) - (() - ((name "Untitled") - (directory #f) - (replace? #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent (finder:dialog-parent-parameter)))) - @{This procedure queries the user for a single filename, using a - platform-dependent dialog box. Consider using - @scheme[finder:put-file] instead of this function. - - See section @secref{selecting-a-filename} for more information.}) - - (finder:std-get-file - (->* () - ((or/c path? false/c) - string? - (or/c byte-regexp? false/c) - string? - (or/c false/c (is-a?/c top-level-window<%>))) - (or/c path? false/c)) - (() - ((directory #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent #f))) - @{This procedure queries the user for a single filename, using a - platform-dependent dialog box. Consider using - @scheme[finder:get-file] instead of this function. - - See section @secref{selecting-a-filename} for more information.}) - - (finder:put-file - (->* () - (string? - (or/c false/c path?) - boolean? - string? - (or/c false/c byte-regexp?) - string? - (or/c (is-a?/c top-level-window<%>) false/c)) - (or/c false/c path?)) - (() - ((name "Untitled") - (directory #f) - (replace? #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent (finder:dialog-parent-parameter)))) - @{Queries the user for a filename. - - If the result of @scheme[(preferences:get 'framework:file-dialogs)] - is @scheme['std] this calls @scheme[finder:std-put-file], and if it - is @scheme['common], @scheme[finder:common-put-file] is called.}) - - (finder:get-file - (->* () - ((or/c path? false/c) - string? - (or/c byte-regexp? string? false/c) - string? - (or/c false/c (is-a?/c top-level-window<%>))) - (or/c path? false/c)) - (() - ((directory #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent #f))) - @{Queries the user for a filename. - - If the result of @scheme[(preferences:get 'framework:file-dialogs)] - is @scheme['std] this calls @scheme[finder:std-get-file], and if it - is @scheme['common], @scheme[finder:common-get-file] is called.}) - - (finder:common-get-file-list - (->* () - ((or/c false/c path?) - string? - (or/c false/c byte-regexp?) - string? - (or/c false/c (is-a?/c top-level-window<%>))) - (or/c (listof path?) false/c)) - (() - ((directory #f) - (prompt "Select File") - (filter #f) - (filter-msg "That filename does not have the right form.") - (parent #f))) - @{This procedure queries the user for a list of filenames, using a - platform-independent dialog box. - - See @secref{selecting-a-filename} for more information.}) - - (frame:setup-size-pref - (symbol? number? number? . -> . void) - (size-pref-sym width height) - @{Initializes a preference for the @scheme[frame:size-pref] mixin. - - The first argument should be the preferences symbol, and the second - an third should be the default width and height, respectively.}) - - (frame:add-snip-menu-items - (->* ((is-a?/c menu%) (subclass?/c menu-item%)) - ((-> (is-a?/c menu-item%) void?)) - void?) - ((menu menu-item%) - ((func void))) - @{Inserts three menu items into @scheme[menu], one that inserts a text - box, one that inserts a pasteboard box, and one that inserts an - image into the currently focused editor (if there is one). Uses - @scheme[menu-item%] as the class for the menu items. - - Calls @scheme[func] right after inserting each menu item.}) - - (frame:reorder-menus - ((is-a?/c frame%) . -> . void?) - (frame) - @{Re-orders the menus in a frame. It moves the ``File'' and ``Edit'' - menus to the front of the menubar and moves the ``Windows'' and - ``Help'' menus to the end of the menubar. - - This is useful in conjunction with the frame classes. After - instantiating the class and adding ones own menus, the menus will be - mis-ordered. This function fixes them up.}) - - (frame:remove-empty-menus - ((is-a?/c frame%) . -> . void?) - (frame) - @{Removes empty menus in a frame.}) - - (group:get-the-frame-group - (-> (is-a?/c group:%)) - () - @{This returns the frame group.}) - - (group:on-close-action - (-> void?) - () - @{See also @scheme[group:can-close-check]. - - Call this function from the @method[top-level-window<%> can-close?] - callback of a frame in order for the group to properly close the - application.}) - - (group:can-close-check - (-> boolean?) - () - @{See also @scheme[group:on-close-action]. - - Call this function from the @method[top-level-window<%> can-close?] - callback of a frame in order for the group to properly close the - application.}) - - (handler:handler? - (any/c . -> . boolean?) - (obj) - @{This predicate determines if its input is a handler.}) - - (handler:handler-name - (handler:handler? . -> . string?) - (handler) - @{Extracts the name from a handler.}) - - (handler:handler-extension - (handler:handler? - . -> . (or/c (path? . -> . boolean?) (listof string?))) - (handler) - @{Extracts the extension from a handler.}) - - (handler:handler-handler - (handler:handler? . -> . (path? . -> . (is-a?/c frame:editor<%>))) - (handler) - @{Extracs the handler's handling function.}) - - (handler:insert-format-handler - (string? - (or/c string? (listof string?) (path? . -> . boolean?)) - (path? . -> . (or/c false/c (is-a?/c frame:editor<%>))) - . -> . - void?) - (name pred handler) - @{This function inserts a format handler. - - The string, @scheme[name] names the format handler for use with - @scheme[handler:find-named-format-handler]. If @scheme[pred] is a - string, it is matched with the extension of a filename by - @scheme[handler:find-format-handler]. If @scheme[pred] is a list of - strings, they are each matched with the extension of a filename by - @scheme[handler:find-format-handler]. If it is a function, the - filename is applied to the function and the functions result - determines if this is the handler to use. - - The most recently added format handler takes precedence over all - other format handlers.}) - - (handler:find-named-format-handler - (string? . -> . (path? . -> . (is-a?/c frame:editor<%>))) - (name) - @{This function selects a format handler. See also - @scheme[handler:insert-format-handler]. - - It finds a handler based on @scheme[name].}) - - (handler:find-format-handler - (path? . -> . (path? . -> . (is-a?/c frame:editor<%>))) - (filename) - @{This function selects a format handler. See also - @scheme[handler:insert-format-handler]. - - It finds a handler based on @scheme[filename].}) - - (handler:edit-file - (->* ((or/c path? false/c)) - ((-> (is-a?/c frame:editor<%>))) - (or/c false/c (is-a?/c frame:editor<%>))) - ((filename) - ((make-default - (λ () ((handler:current-create-new-window) filename))))) - @{This function creates a frame or re-uses an existing frame to edit a - file. - - If the preference @scheme['framework:open-here] is set to - @scheme[#t], and @scheme[(send (group:get-the-frame-group) - get-open-here-frame)] returns a frame, the - @method[frame:open-here<%> open-here] method of that frame is used - to load the file in the existing frame. - - Otherwise, it invokes the appropriate format handler to open the - file (see @scheme[handler:insert-format-handler]). - - @itemize{ - @item{If @scheme[filename] is a string, this function checks the - result of @scheme[group:get-the-frame-group] to see if the - @scheme[filename] is already open by a frame in the group. - @itemize{ - @item{If so, it returns the frame.} - @item{If not, this function calls - @scheme[handler:find-format-handler] with - @scheme[filename]. - @itemize{ - @item{If a handler is found, it is applied to - @scheme[filename] and it's result is the - final result.} - @item{If not, @scheme[make-default] is used.}}}}} - @item{If @scheme[filename] is @scheme[#f], @scheme[make-default] - is used.}}}) - - (handler:current-create-new-window - (parameter/c (-> (or/c false/c path?) (is-a?/c frame%))) - () - @{This is a parameter that controls how the framework creates new - application windows. - - The default setting is this: - @schemeblock[ - (λ (filename) - (let ([frame (make-object frame:text-info-file% filename)]) - (send frame show #t) - frame)) - ]}) - - (handler:open-file - (->* () - ((or/c false/c path? string?)) - (or/c false/c (is-a?/c frame:basic<%>))) - (((dir #f))) - @{This function queries the user for a filename and opens the file for - editing. It uses @scheme[handler:edit-file] to open the file, once - the user has chosen it. - - Calls @scheme[finder:get-file] and @scheme[handler:edit-file], passing along @scheme[dir].}) - - (handler:install-recent-items - ((is-a?/c menu%) . -> . void?) - (menu) - @{This function deletes all of the items in the given menu and adds - one menu item for each recently opened file. These menu items, when - selected, call @scheme[handler:edit-file] with the filename of the - recently opened file. - - The menu's size is limited to 10.}) - - (handler:set-recent-items-frame-superclass - ((implementation?/c frame:standard-menus<%>) . -> . void?) - (frame) - @{Sets the superclass for the recently opened files frame. It must be - derived from @scheme[frame:standard-menus].}) - - (handler:add-to-recent - (path? . -> . void?) - (filename) - @{Adds a filename to the list of recently opened files.}) - - (handler:set-recent-position - (path? number? number? . -> . void?) - (filename start end) - @{Sets the selection of the recently opened file to @scheme[start] and - @scheme[end].}) - - (handler:size-recently-opened-files - (number? . -> . void?) - (num) - @{Sizes the @scheme['framework:recently-opened-files/pos] preference - list length to @scheme[num].}) - - (icon:get-paren-highlight-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the parenthesis highlight @scheme[bitmap%]. It is only - used on black and white screens.}) - - (icon:get-eof-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the @scheme[bitmap%] used for the clickable ``eof'' - icon from @scheme[text:ports].}) - - (icon:get-autowrap-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the autowrap's @scheme[bitmap%]. - - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] - method.}) - - (icon:get-lock-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the lock's @scheme[bitmap]. - - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] - method.}) - - (icon:get-unlock-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the reset unlocked @scheme[bitmap]. - - The bitmap may not respond @scheme[#t] to the @link bitmap ok? - method.}) - - (icon:get-anchor-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns the anchor's @scheme[bitmap]. - - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] - method.}) - - (icon:get-left/right-cursor - (-> (is-a?/c cursor%)) - () - @{This function returns a @link cursor object that indicates - left/right sizing is possible, for use with columns inside a window. - - The cursor may not respond @scheme[#t] to the @link cursor ok? - method.}) - - (icon:get-up/down-cursor - (-> (is-a?/c cursor%)) - () - @{This function returns a @scheme[cursor%] object that indicates - up/down sizing is possible, for use with columns inside a window. - - The cursor may not respond @scheme[#t] to the @method[cursor% ok?] - method.}) - - (icon:get-gc-on-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns a bitmap to be displayed in an @scheme[frame:info<%>] - frame when garbage collection is taking place. - - The bitmap may not respond @scheme[#t] to the @link bitmap ok? - method.}) - - (icon:get-gc-off-bitmap - (-> (is-a?/c bitmap%)) - () - @{This returns a bitmap to be displayed in an @scheme[frame:info<%>] - frame when garbage collection is not taking place. - - The bitmap may not respond @scheme[#t] to the @method[bitmap% ok?] - method.}) - - (keymap:remove-user-keybindings-file - (-> any/c any) - (user-keybindings-path) - @{Removes the keymap previously added by - @scheme[keymap:add-user-keybindings-file].}) - - (keymap:add-user-keybindings-file - (-> any/c any) - (user-keybindings-path-or-require-spec) - @{Chains the keymap defined by - @scheme[user-keybindings-path-or-require-spec] to the global keymap, - returned by @scheme[keymap:get-global]. - - If @scheme[user-keybindings-path-or-require-spec] is a path, the - module is loaded directly from that path. Otherwise, - @scheme[user-keybindings-path-or-require-spec] is treated like an - argument to @scheme[require].}) - - (keymap:add-to-right-button-menu - (parameter/c - (-> (is-a?/c popup-menu%) (is-a?/c editor<%>) (is-a?/c event%) void?)) - () - @{When the keymap that @scheme[keymap:get-global] returns is installed - into an editor, this parameter's value is used for right button - clicks. - - Before calling this procedure, the function - @scheme[append-editor-operation-menu-items] is called. - - See also @scheme[keymap:add-to-right-button-menu/before].}) - - (keymap:add-to-right-button-menu/before - (parameter/c - (-> (is-a?/c popup-menu%) (is-a?/c editor<%>) (is-a?/c event%) void?)) - () - @{When the keymap that @scheme[keymap:get-global] returns is installed - into an editor, this function is called for right button clicks. - - After calling this procedure, the function - @scheme[append-editor-operation-menu-items] is called. - - See also @scheme[keymap:add-to-right-button-menu].}) - - (keymap:call/text-keymap-initializer - ((-> any/c) . -> . any/c) - (thunk-proc) - @{Thus function parameterizes the call to @scheme[thunk-proc] by - setting the keymap-initialization procedure (see - @scheme[current-text-keymap-initializer]) to install the framework's - standard text bindings.}) - - (keymap:canonicalize-keybinding-string - (string? . -> . string?) - (keybinding-string) - @{Returns a string that denotes the same keybindings as the input - string, except that it is in canonical form; two canonical - keybinding strings can be compared with @scheme[string=?].}) - - (keymap:get-editor - (-> (is-a?/c keymap%)) - () - @{This returns a keymap for handling standard editing operations. It - binds these keys: - - @itemize{ - @item{@scheme["z"]: undo} - @item{@scheme["y"]: redo} - @item{@scheme["x"]: cut} - @item{@scheme["c"]: copy} - @item{@scheme["v"]: paste} - @item{@scheme["a"]: select all}} - where each key is prefixed with the menu-shortcut key, based on the - platform. Under unix, the shortcut is @scheme["a:"]; under windows - the shortcut key is @scheme["c:"] and under MacOS, the shortcut key - is @scheme["d:"].}) - - (keymap:get-file - (-> (is-a?/c keymap%)) - () - @{This returns a keymap for handling file operations.}) - - (keymap:get-global - (-> (is-a?/c keymap%)) - () - @{This returns a keymap for general operations. See - @scheme[keymap:setup-global] for a list of the bindings this keymap - contains.}) - - (keymap:get-search - (-> (is-a?/c keymap%)) - () - @{This returns a keymap for searching operations.}) - - (keymap:make-meta-prefix-list - (string? . -> . (listof string?)) - (key) - @{This prefixes a key with all of the different meta prefixes and - returns a list of the prefixed strings. - - takes a keymap, a base key specification, and a function name; it - prefixes the base key with all ``meta'' combination prefixes, and - installs the new combinations into the keymap. For example, - @scheme[(keymap:send-map-function-meta keymap "a" func)] maps - @scheme["m:a"] and @scheme["ESC;a"] to @scheme[func].}) - - (keymap:send-map-function-meta - ((is-a?/c keymap%) string? string? . -> . void?) - (keymap key func) - @{@index{Meta} Most keyboard and mouse mappings are inserted into a - keymap by calling the keymap's @method[keymap% map-function] method. - However, ``meta'' combinations require special attention. The - @scheme["m:"] prefix recognized by @method[keymap% map-function] - applies only to the Meta key that exists on some keyboards. By - convention, however, ``meta'' combinations can also be accessed by - using ``ESC'' as a prefix. - - This procedure binds all of the key-bindings obtained by prefixing - @scheme[key] with a meta-prefix to @scheme[func] in - @scheme[keymap].}) - - (keymap:setup-editor - ((is-a?/c keymap%) . -> . void?) - (keymap) - @{This sets up the input keymap with the bindings described in - @scheme[keymap:get-editor].}) - - (keymap:setup-file - ((is-a?/c keymap%) . -> . void?) - (keymap) - @{This extends a @scheme[keymap%] with the bindings for files.}) - - (keymap:setup-global - ((is-a?/c keymap%) . -> . void?) - (keymap) - @{This extends a @scheme[keymap%] with the general bindings. - - This function extends a @scheme[keymap%] with the following - functions: - @itemize{ - @item{@mapdesc[ring-bell any] --- Rings the bell (using - @scheme[bell]) and removes the search panel from the frame, - if there.} - @item{@mapdesc[save-file key] --- Saves the buffer. If the buffer - has no name, then - @scheme[finder:put-file]@index["finder:put-file"] is - invoked.} - @item{@mapdesc[save-file-as key] --- Calls - @scheme[finder:put-file]@index["finder:put-file"] to save - the buffer.} - @item{@mapdesc[load-file key] --- Invokes - @scheme[finder:open-file]@index["finder:open-file"].} - @item{@mapdesc[find-string key] --- Opens the search buffer at the - bottom of the frame, unless it is already open, in which - case it searches for the text in the search buffer.} - @item{@mapdesc[find-string-reverse key] --- Same as - ``find-string'', but in the reverse direction.} - @item{@mapdesc[find-string-replace key] --- Opens a replace string - dialog box.} - @item{@mapdesc[toggle-anchor key] --- Turns selection-anchoring on - or off.} - @item{@mapdesc[center-view-on-line key] --- Centers the buffer in - its display using the currently selected line.} - @item{@mapdesc[collapse-space key] --- Collapses all non-return - whitespace around the caret into a single space.} - @item{@mapdesc[remove-space key] --- Removes all non-return - whitespace around the caret.} - @item{@mapdesc[collapse-newline key] --- Collapses all empty lines - around the caret into a single empty line. If there is only - one empty line, it is removed.} - @item{@mapdesc[open-line key] --- Inserts a new line.} - @item{@mapdesc[transpose-chars key] --- Transposes the characters - before and after the caret and moves forward one position.} - @item{@mapdesc[transpose-words key] --- Transposes words before - and after the caret and moves forward one word.} - @item{@mapdesc[capitalize-word key] --- Changes the first - character of the next word to a capital letter and moves to - the end of the word.} - @item{@mapdesc[upcase-word key] --- Changes all characters of the - next word to capital letters and moves to the end of the - word.} - @item{@mapdesc[downcase-word key] --- Changes all characters - of the next word to lowercase letters and moves to the end - of the word.} - @item{@mapdesc[kill-word key] --- Kills the next word.} - @item{@mapdesc[backward-kill-word key] --- Kills the previous - word.} - @item{@mapdesc[goto-line any] --- Queries the user for a line - number and moves the caret there.} - @item{@mapdesc[goto-position any] --- Queries the user for a - position number and moves the caret there.} - @item{@mapdesc[copy-clipboard mouse] --- Copies the current - selection to the clipboard.} - @item{@mapdesc[cut-clipboard mouse] --- Cuts the current selection - to the clipboard.} - @item{@mapdesc[paste-clipboard mouse] --- Patses the clipboard to - the current selection.} - @item{@mapdesc[copy-click-region mouse] --- Copies the region - between the caret and the input mouse event.} - @item{@mapdesc[cut-click-region mouse] --- Cuts the region - between the caret and the input mouse event.} - @item{@mapdesc[paste-click-region mouse] --- Pastes the clipboard - into the position of the input mouse event.} - @item{@mapdesc[select-click-word mouse] --- Selects the word under - the input mouse event.} - @item{@mapdesc[select-click-line mouse] --- Selects the line under - the input mouse event.} - @item{@mapdesc[start-macro key] -- Starts building a keyboard - macro} - @item{@mapdesc[end-macro key] --- Stops building a keyboard macro} - @item{@mapdesc[do-macro key] --- Executes the last keyboard macro} - @item{@mapdesc[toggle-overwrite key] --- Toggles overwriting - mode}} - - These functions are bound to the following keys (C = control, - S = shift, A = alt, M = ``meta'', D = command): - @itemize{ - @item{C-g : ``ring-bell''} - @item{M-C-g : ``ring-bell''} - @item{C-c C-g : ``ring-bell''} - @item{C-x C-g : ``ring-bell''} - @item{C-p : ``previous-line''} - @item{S-C-p : ``select-previous-line''} - @item{C-n : ``next-line''} - @item{S-C-n : ``select-next-line''} - @item{C-e : ``end-of-line''} - @item{S-C-e : ``select-to-end-of-line''} - @item{D-RIGHT : ``end-of-line''} - @item{S-D-RIGHT : ``select-to-end-of-line''} - @item{M-RIGHT : ``end-of-line''} - @item{S-M-RIGHT : ``select-to-end-of-line''} - @item{C-a : ``beginning-of-line''} - @item{S-C-a : ``select-to-beginning-of-line''} - @item{D-LEFT : ``beginning-of-line''} - @item{D-S-LEFT : ``select-to-beginning-of-line''} - @item{M-LEFT : ``beginning-of-line''} - @item{M-S-LEFT : ``select-to-beginning-of-line''} - @item{C-h : ``delete-previous-character''} - @item{C-d : ``delete-next-character''} - @item{C-f : ``forward-character''} - @item{S-C-f : ``select-forward-character''} - @item{C-b : ``backward-character''} - @item{S-C-b : ``select-backward-character''} - @item{M-f : ``forward-word''} - @item{S-M-f : ``select-forward-word''} - @item{A-RIGHT : ``forward-word''} - @item{A-S-RIGHT : ``forward-select-word''} - @item{M-b : ``backward-word''} - @item{S-M-b : ``select-backward-word''} - @item{A-LEFT : ``backward-word''} - @item{A-S-LEFT : ``backward-select-word''} - @item{M-d : ``kill-word''} - @item{M-DELETE : ``backward-kill-word''} - @item{M-c : ``capitalize-word''} - @item{M-u : ``upcase-word''} - @item{M-l : ``downcase-word''} - @item{M-< : ``beginning-of-file''} - @item{S-M-< : ``select-to-beginning-of-file''} - @item{M-> : ``end-of-file''} - @item{S-M-> : ``select-to-end-of-file''} - @item{C-v : ``next-page''} - @item{S-C-v : ``select-next-page''} - @item{M-v : ``previous-page''} - @item{S-M-v : ``select-previous-page''} - @item{C-l : ``center-view-on-line''} - @item{C-k : ``delete-to-end-of-line''} - @item{C-y : ``paste-clipboard'' (Except Windows)} - @item{A-v : ``paste-clipboard''} - @item{D-v : ``paste-clipboard''} - @item{C-_ : ``undo''} - @item{C-x u : ``undo''} - @item{C-+ : ``redo''} - @item{C-w : ``cut-clipboard''} - @item{M-w : ``copy-clipboard''} - @item{C-x C-s : ``save-file''} - @item{C-x C-w : ``save-file-as''} - @item{C-x C-f : ``load-file''} - @item{C-s : ``find-string''} - @item{C-r : ``find-string-reverse''} - @item{M-% : ``find-string-replace''} - @item{SPACE : ``collapse-space''} - @item{M-Backslash : ``remove-space''} - @item{C-x C-o : ``collapse-newline''} - @item{C-o : ``open-line''} - @item{C-t : ``transpose-chars''} - @item{M-t : ``transpose-words''} - @item{C-SPACE : ``toggle-anchor''} - @item{M-g : ``goto-line''} - @item{M-p : ``goto-position''} - @item{LEFTBUTTONTRIPLE : ``select-click-line''} - @item{LEFTBUTTONDOUBLE : ``select-click-word''} - @item{RIGHTBUTTON : ``copy-click-region''} - @item{RIGHTBUTTONDOUBLE : ``cut-click-region''} - @item{MIDDLEBUTTON : ``paste-click-region''} - @item{C-RIGHTBUTTON : ``copy-clipboard''} - @item{INSERT : ``toggle-overwrite''} - @item{M-o : ``toggle-overwrite''}}}) - - (keymap:setup-search - ((is-a?/c keymap%) . -> . void?) - (keymap) - @{This extends a @link keymap with the bindings for searching.}) - - (keymap:set-chained-keymaps - ((is-a?/c keymap:aug-keymap<%>) - (listof (is-a?/c keymap%)) - . -> . - void?) - (keymap children-keymaps) - @{Sets @scheme[keymap]'s chained keymaps to @scheme[children-keymaps], - unchaining any keymaps that are currently chained to - @scheme[keymap].}) - - (keymap:remove-chained-keymap - ((is-a?/c editor<%>) - (is-a?/c keymap:aug-keymap<%>) - . -> . - void?) - (editor keymap) - @{Removes @scheme[keymap] from the keymaps chained to @scheme[editor]. - Also (indirectly) removes all keymaps chained to @scheme[keymap] - from @scheme[editor], since they are removed when unchaining - @scheme[keymap] itself. - - Each of the keymaps chained to @scheme[editor] must be an - @scheme[keymap:aug-keymap%] and @scheme[keymap] cannot be the result - of @scheme[(send editor get-keymap)] That is, @scheme[keymap] must - be chained to some keymap attached to the editor.}) - - (scheme:text-balanced? - (->* ((is-a?/c text%)) - (number? (or/c false/c number?)) - boolean?) - ((text) - ((start 0) (end #f))) - @{Determines if the range in the editor from @scheme[start] to - @scheme[end] in @scheme[text] is a matched set of parenthesis. If - @scheme[end] is @scheme[#f], it defaults to the last position of the - @scheme[text]. - - The implementation of this function creates a port with - @scheme[open-input-text-editor] and then uses `read' to parse the - range of the buffer.}) - - (scheme:add-preferences-panel - (-> void?) - () - @{Adds a tabbing preferences panel to the preferences dialog.}) - - (scheme:get-keymap - (-> (is-a?/c keymap%)) - () - @{Returns a keymap with binding suitable for Scheme.}) - - (scheme:add-coloring-preferences-panel - (-> any) - () - @{ - Installs the ``Scheme'' preferences panel in the ``Syntax Coloring'' - section.}) - - (scheme:get-color-prefs-table - (-> (listof (list/c symbol? (is-a?/c color%)))) - () - @{Returns a table mapping from symbols (naming the categories that the - online colorer uses for Scheme mode coloring) to their colors. - - These symbols are suitable for input to - @scheme[scheme:short-sym->pref-name] and - @scheme[scheme:short-sym->style-name]. - - See also @scheme[scheme:get-white-on-black-color-prefs-table].}) - - (scheme:get-white-on-black-color-prefs-table - (-> (listof (list/c symbol? (is-a?/c color%)))) - () - @{Returns a table mapping from symbols (naming the categories that the - online colorer uses for Scheme mode coloring) to their colors when - the user chooses the white-on-black mode in the preferences dialog. - - See also @scheme[scheme:get-color-prefs-table].}) - - (scheme:short-sym->pref-name - (symbol? . -> . symbol?) - (short-sym) - @{Builds the symbol naming the preference from one of the symbols in - the table returned by @scheme[scheme:get-color-prefs-table].}) - - (scheme:short-sym->style-name - (symbol? . -> . string?) - (short-sym) - @{Builds the symbol naming the editor style from one of the symbols in - the table returned by @scheme[scheme:get-color-prefs-table]. This - style is a named style in the style list returned by - @scheme[editor:get-standard-style-list].}) - - (scheme:get-wordbreak-map - (-> (is-a?/c editor-wordbreak-map%)) - () - @{This method returns a @link editor-wordbreak-map that is suitable - for Scheme.}) - - (scheme:init-wordbreak-map - ((is-a?/c keymap%) . -> . void?) - (key) - @{Initializes the workdbreak map for @scheme[keymap].}) - - (scheme:setup-keymap - ((is-a?/c keymap%) . -> . void?) - (keymap) - @{Initializes @scheme[keymap] with Scheme-mode keybindings.}) - - (editor:set-default-font-color - (-> (is-a?/c color%) void?) - (color) - @{Sets the color of the style named - @scheme[editor:get-default-color-style-name].}) - - (editor:get-default-color-style-name - (-> string?) - () - @{The name of the style (in the list returned by - @scheme[editor:get-standard-style-list]) that holds the default - color.}) - - (editor:set-standard-style-list-delta - (string? (is-a?/c style-delta%) . -> . void?) - (name delta) - @{Finds (or creates) the style named by @scheme[name] in the result of - @scheme[editor:get-standard-style-list] and sets its delta to - @scheme[delta]. - - If the style named by @scheme[name] is already in the style list, it - must be a delta style.}) - - (editor:set-standard-style-list-pref-callbacks - (-> any) - () - @{Installs the font preference callbacks that update the style list - returned by @scheme[editor:get-standard-style-list] based on the - font preference symbols.}) - - (editor:get-standard-style-list - (-> (is-a?/c style-list%)) - () - @{Returns a style list that is used for all instances of - @scheme[editor:standard-style-list%].}) - - (color-model:rgb->xyz - (number? number? number? . -> . color-model:xyz?) - (r g b) - @{Converts a color represented as a red-green-blue tuple (each value - from 0 to 255) into an XYZ tuple. This describes a point in the CIE - XYZ color space.}) - - (color-model:rgb-color-distance - (number? number? number? number? number? number? . -> . number?) - (red-a green-a blue-a red-b green-b blue-b) - @{This calculates a distance between two colors. The smaller the - distance, the closer the colors should appear to the human eye. A - distance of 10 is reasonably close that it could be called the same - color. - - This function is not symmetric in red, green, and blue, so it is - important to pass red, green, and blue components of the colors in - the the proper order. The first three arguments are red, green and - blue for the first color, respectively, and the second three - arguments are red green and blue for the second color, - respectively.}) - - (color-model:xyz->rgb - (number? number? number? . -> . (list/c number? number? number?)) - (x y z) - @{Converts an XYZ-tuple (in the CIE XYZ colorspace) into a list of - values representing an RGB-tuple.}) - - (color-model:xyz? - (any/c . -> . boolean?) - (val) - @{Determines if @scheme[val] an xyz color record.}) - - (color-model:xyz-x - (color-model:xyz? . -> . number?) - (xyz) - @{Extracts the x component of @scheme[xyz].}) - - (color-model:xyz-y - (color-model:xyz? . -> . number?) - (xyz) - @{Extracts the y component of @scheme[xyz].}) - - (color-model:xyz-z - (color-model:xyz? . -> . number?) - (xyz) - @{Extracts the z component of @scheme[xyz].}) - - (color-prefs:set-default/color-scheme - (-> symbol? - (or/c (is-a?/c color%) string?) - (or/c (is-a?/c color%) string?) - void?) - (pref-sym black-on-white-color white-on-black-color) - @{Registers a preference whose value will be updated when the user - clicks on one of the color scheme default settings in the - preferences dialog. - - Also calls @scheme[preferences:set-default] and - @scheme[preferences:set-un/marshall] with appropriate arguments to - register the preference.}) - - (color-prefs:register-color-preference - (->* (symbol? string? (or/c (is-a?/c color%) (is-a?/c style-delta%))) - ((or/c string? (is-a?/c color%) false/c)) - void?) - ((pref-name style-name color/sd) - ((white-on-black-color #f))) - @{This function registers a color preference and initializes the style - list returned from @scheme[editor:get-standard-style-list]. In - particular, it calls @scheme[preferences:set-default] and - @scheme[preferences:set-un/marshall] to install the pref for - @scheme[pref-name], using @scheme[color/sd] as the default - color. The preference is bound to a @scheme[style-delta%], and - initially the @scheme[style-delta%] changes the foreground color to - @scheme[color/sd], unless @scheme[color/sd] is a style delta - already, in which case it is just used directly. Then, it calls - @scheme[editor:set-standard-style-list-delta] passing the - @scheme[style-name] and the current value of the preference - @scheme[pref-name]. - - Finally, it adds calls @scheme[preferences:add-callback] to set a - callback for @scheme[pref-name] that updates the style list when the - preference changes. - - If @scheme[white-on-black-color] is not @scheme[#f], then the color - of the @scheme[color/sd] argument is used in combination with - @scheme[white-on-black-color] to register this preference with - @scheme[color-prefs:set-default/color-scheme].}) - - (color-prefs:add-background-preferences-panel - (-> void?) - () - @{Adds a preferences panel that configures the background color for - @scheme[editor:basic-mixin].}) - - (color-prefs:add-to-preferences-panel - (string? ((is-a?/c vertical-panel%) . -> . void?) . -> . void?) - (name func) - @{Calls @scheme[func] with the subpanel of the preferences coloring - panel that corresponds to @scheme[name].}) - - (color-prefs:build-color-selection-panel - ((is-a?/c area-container<%>) symbol? string? string? . -> . void?) - (parent pref-sym style-name example-text) - @{Builds a panel with a number of controls for configuring a font: the - color and check boxes for bold, italic, and underline. The - @scheme[parent] argument specifies where the panel will be placed. - The @scheme[pref-sym] should be a preference (suitable for use with - @scheme[preferences:get] and @scheme[preferences:set]). The - @scheme[style-name] specifies the name of a style in the style list - returned from @scheme[editor:get-standard-style-list] and - @scheme[example-text] is shown in the panel so users can see the - results of their configuration.}) - - (color-prefs:marshall-style-delta - (-> (is-a?/c style-delta%) printable/c) - (style-delta) - @{Builds a printed representation for a style-delta.}) - - (color-prefs:unmarshall-style-delta - (-> printable/c (or/c false/c (is-a?/c style-delta%))) - (marshalled-style-delta) - @{Builds a style delta from its printed representation. Returns - @scheme[#f] if the printed form cannot be parsed.}) - - )])) - -(define-syntax (make-framework-exports/srcloc-preserved stx) - (let () - (define-struct faux-stx (obj vec) #:prefab) - (syntax-case stx () - [(macro-name arg ...) - (with-syntax ([framework-exports/srcloc-preserved - (datum->syntax #'macro-name - 'framework-exports/srcloc-preserved)]) - (let ([marshalled - (let loop ([stx #'(arg ...)]) - (cond - [(syntax? stx) (make-faux-stx (loop (syntax-e stx)) - (vector (syntax-source stx) - (syntax-line stx) - (syntax-column stx) - (syntax-position stx) - (syntax-span stx)))] - [(pair? stx) (cons (loop (car stx)) - (loop (cdr stx)))] - [else stx]))]) - #`(define-syntax (framework-exports/srcloc-preserved stx) - (syntax-case stx () - [(_ id tag) - #'(id tag #,marshalled)]))))]))) - -(framework-exports make-framework-exports/srcloc-preserved) diff --git a/collects/framework/private/mapdesc.ss b/collects/framework/private/mapdesc.ss new file mode 100644 index 0000000000..1ee4e3b918 --- /dev/null +++ b/collects/framework/private/mapdesc.ss @@ -0,0 +1,16 @@ +#lang scheme/base + +(provide mapdesc) +(require (for-syntax scheme/base) + scribble/decode + scribble/manual) + +(define-syntax (mapdesc stx) + (syntax-case stx () + [(_ cmd events) + #'(make-splice (list (index (symbol->string 'cmd)) + (symbol->string 'cmd) + " (" + (symbol->string 'events) + " events)"))])) + \ No newline at end of file diff --git a/collects/scribble/extract.ss b/collects/scribble/extract.ss index 4fddc25a54..fa1411464c 100644 --- a/collects/scribble/extract.ss +++ b/collects/scribble/extract.ss @@ -20,8 +20,12 @@ (define-syntax (include-extracted stx) (syntax-case stx () - [(_ orig-path) - (let ([path (resolve-path-spec #'orig-path #'orig-path stx)]) + [(_ orig-path) #'(include-extracted orig-path #rx"")] ;; this regexp matches everything + [(_ orig-path regexp-s) + (let ([path (resolve-path-spec #'orig-path #'orig-path stx)] + [reg (syntax-e #'regexp-s)]) + (unless (regexp? reg) + (raise-syntax-error #f "expected a literal regular expression as the second argument" stx #'regexp-s)) (let ([s-exp (parameterize ([current-namespace (make-base-namespace)] [read-accept-reader #t]) @@ -40,7 +44,13 @@ (map (lambda (c) (syntax-case c (#%plain-app void quote-syntax provide/doc) [(#%plain-app void (quote-syntax (provide/doc spec ...))) - (syntax->list #'(spec ...))] + (map + (λ (x) (syntax-case x () [(docs id) #'docs])) + (filter (λ (x) + (syntax-case x () + [(stuff id) + (regexp-match reg (symbol->string (syntax-e #'id)))])) + (syntax->list #'(spec ...))))] [_ null])) (syntax->list #'(content ...))))] [(req ...) diff --git a/collects/scribble/srcdoc.ss b/collects/scribble/srcdoc.ss index c6b8203d45..391d8f6813 100644 --- a/collects/scribble/srcdoc.ss +++ b/collects/scribble/srcdoc.ss @@ -17,7 +17,7 @@ (syntax-case stx () [(_ form ...) (let ([forms (syntax->list #'(form ...))]) - (with-syntax ([((for-provide/contract for-docs) ...) + (with-syntax ([((for-provide/contract for-docs id) ...) (map (lambda (form) (syntax-case form () [(id . _) @@ -31,9 +31,10 @@ #'id)) (let* ([i (make-syntax-introducer)] [i2 (lambda (x) (syntax-local-introduce (i x)))]) - (let-values ([(p/c d req/d) ((provide/doc-transformer-proc t) - (i (syntax-local-introduce form)))]) - (list (i2 p/c) (list (i2 req/d) (i2 d) (i2 (quote-syntax tag)))))))] + (let-values ([(p/c d req/d id) + ((provide/doc-transformer-proc t) + (i (syntax-local-introduce form)))]) + (list (i2 p/c) (list (i2 req/d) (i2 d) (i2 (quote-syntax tag))) (i2 id)))))] [_ (raise-syntax-error #f @@ -49,7 +50,7 @@ (syntax->list #'(for-provide/contract ...)))]) #'(begin p/c ... - (void (quote-syntax (provide/doc for-docs ...)))))))])) + (void (quote-syntax (provide/doc (for-docs id) ...)))))))])) (define-provide/doc-transformer proc-doc (lambda (stx) @@ -94,7 +95,8 @@ (values #'[id contract] #'(defproc header result . desc) - #'(scribble/manual)))]))) + #'(scribble/manual) + #'id))]))) (define-provide/doc-transformer proc-doc/names (lambda (stx) @@ -146,7 +148,8 @@ (values #'[id contract] #'(defproc* header . desc) - #'(scribble/manual)))]))) + #'(scribble/manual) + #'id))]))) (define-provide/doc-transformer parameter-doc (lambda (stx) @@ -166,4 +169,5 @@ (values #'[id (parameter/c contract)] #'(defparam id arg-id contract . desc) - #'(scribble/manual)))]))) + #'(scribble/manual) + #'id))]))) diff --git a/collects/scribblings/framework/application.scrbl b/collects/scribblings/framework/application.scrbl index 6ea610c012..8a6b8e83d3 100644 --- a/collects/scribblings/framework/application.scrbl +++ b/collects/scribblings/framework/application.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Application} -@(require framework/framework-docs) -@(def-fw-procs application) + +@(include-extracted (lib "main.ss" "framework") #rx"^application:") diff --git a/collects/scribblings/framework/autosave.scrbl b/collects/scribblings/framework/autosave.scrbl index 012d5ef80a..f6156bf088 100644 --- a/collects/scribblings/framework/autosave.scrbl +++ b/collects/scribblings/framework/autosave.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Autosave} @@ -14,5 +14,5 @@ } } -@(require framework/framework-docs) -@(def-fw-procs autosave) + +@(include-extracted (lib "main.ss" "framework") #rx"^autosave:") diff --git a/collects/scribblings/framework/canvas.scrbl b/collects/scribblings/framework/canvas.scrbl index d92c178acb..20ba0b885f 100644 --- a/collects/scribblings/framework/canvas.scrbl +++ b/collects/scribblings/framework/canvas.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Canvas} @@ -98,5 +98,5 @@ @defclass[canvas:info% (canvas:info-mixin canvas:basic%) ()]{} @defclass[canvas:delegate% (canvas:delegate-mixin canvas:basic%) ()]{} @defclass[canvas:wide-snip% (canvas:wide-snip-mixin canvas:basic%) ()]{} -@(require framework/framework-docs) -@(def-fw-procs canvas) + +@(include-extracted (lib "main.ss" "framework") #rx"^canvas:") diff --git a/collects/scribblings/framework/color-model.scrbl b/collects/scribblings/framework/color-model.scrbl index b8a2749b68..c34ae19569 100644 --- a/collects/scribblings/framework/color-model.scrbl +++ b/collects/scribblings/framework/color-model.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Color Model} -@(require framework/framework-docs) -@(def-fw-procs color-model) + +@(include-extracted (lib "main.ss" "framework") #rx"^color-model:") diff --git a/collects/scribblings/framework/color-prefs.scrbl b/collects/scribblings/framework/color-prefs.scrbl index 15286937fb..0984a0f434 100644 --- a/collects/scribblings/framework/color-prefs.scrbl +++ b/collects/scribblings/framework/color-prefs.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Color Prefs} -@(require framework/framework-docs) -@(def-fw-procs color-prefs) + +@(include-extracted (lib "main.ss" "framework") #rx"^color-prefs:") diff --git a/collects/scribblings/framework/color.scrbl b/collects/scribblings/framework/color.scrbl index 4d872b799c..98a4ec6bc0 100644 --- a/collects/scribblings/framework/color.scrbl +++ b/collects/scribblings/framework/color.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Color} @@ -231,5 +231,5 @@ } } @defclass[color:text-mode% (color:text-mode-mixin mode:surrogate-text%) ()]{} -@(require framework/framework-docs) -@(def-fw-procs color) + +@(include-extracted (lib "main.ss" "framework") #rx"^color:") diff --git a/collects/scribblings/framework/comment-box.scrbl b/collects/scribblings/framework/comment-box.scrbl index b98cc60911..383b219eb6 100644 --- a/collects/scribblings/framework/comment-box.scrbl +++ b/collects/scribblings/framework/comment-box.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Comment Box} @@ -44,5 +44,5 @@ } } -@(require framework/framework-docs) -@(def-fw-procs comment-box) + +@(include-extracted (lib "main.ss" "framework") #rx"^comment-box:") diff --git a/collects/scribblings/framework/editor.scrbl b/collects/scribblings/framework/editor.scrbl index a303cc42c3..d3fbf0cd97 100644 --- a/collects/scribblings/framework/editor.scrbl +++ b/collects/scribblings/framework/editor.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Editor} @@ -428,5 +428,5 @@ @method[frame:info<%> lock-status-changed]. } } -@(require framework/framework-docs) -@(def-fw-procs editor) + +@(include-extracted (lib "main.ss" "framework") #rx"^editor:") diff --git a/collects/scribblings/framework/exit.scrbl b/collects/scribblings/framework/exit.scrbl index 9bc90ecb5a..3c63c25343 100644 --- a/collects/scribblings/framework/exit.scrbl +++ b/collects/scribblings/framework/exit.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Exit} -@(require framework/framework-docs) -@(def-fw-procs exit) + +@(include-extracted (lib "main.ss" "framework") #rx"^exit:") diff --git a/collects/scribblings/framework/finder.scrbl b/collects/scribblings/framework/finder.scrbl index 95fea33f78..91e3f06f4b 100644 --- a/collects/scribblings/framework/finder.scrbl +++ b/collects/scribblings/framework/finder.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Finder} -@(require framework/framework-docs) -@(def-fw-procs finder) + +@(include-extracted (lib "main.ss" "framework") #rx"^finder:") diff --git a/collects/scribblings/framework/frame.scrbl b/collects/scribblings/framework/frame.scrbl index 4c90a4c311..b9ff227303 100644 --- a/collects/scribblings/framework/frame.scrbl +++ b/collects/scribblings/framework/frame.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Frame} @@ -2380,5 +2380,5 @@ @defclass[frame:searchable% (frame:searchable-text-mixin (frame:searchable-mixin frame:text%)) ()]{} @defclass[frame:delegate% (frame:delegate-mixin frame:searchable%) ()]{} @defclass[frame:pasteboard% (frame:pasteboard-mixin frame:open-here%) ()]{} -@(require framework/framework-docs) -@(def-fw-procs frame) + +@(include-extracted (lib "main.ss" "framework") #rx"^frame:") diff --git a/collects/scribblings/framework/framework.scrbl b/collects/scribblings/framework/framework.scrbl index 47430ff9cb..c94fc09c56 100644 --- a/collects/scribblings/framework/framework.scrbl +++ b/collects/scribblings/framework/framework.scrbl @@ -2,17 +2,15 @@ @(require (for-label framework scheme/gui)) @(require scribble/manual) -@(defmodule framework) @title{@bold{Framework}: PLT GUI Application Framework} +@(defmodule framework) @bold{TODO:} @itemize{ @item{Mode} -@item{``Cannot parse docs for handler:open-file''} @item{Check indexing in preferences:get} @item{Warnings in the translation process} -@item{Get rid of framework-exports.ss} } ------------------------------------------------------------------------------------------ @@ -97,7 +95,6 @@ Johnathan Franklin, Mark Krentel, Corky Cartwright, Michael Ernst, Kennis Koldewyn, Bruce Duba, and many others for their feedback and help. -@include-section["tmp.scrbl"] @include-section["application.scrbl"] @include-section["autosave.scrbl"] @include-section["canvas.scrbl"] diff --git a/collects/scribblings/framework/group.scrbl b/collects/scribblings/framework/group.scrbl index cf3fb44686..42fc53eccc 100644 --- a/collects/scribblings/framework/group.scrbl +++ b/collects/scribblings/framework/group.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Group} @@ -120,5 +120,5 @@ } } -@(require framework/framework-docs) -@(def-fw-procs group) + +@(include-extracted (lib "main.ss" "framework") #rx"^group:") diff --git a/collects/scribblings/framework/gui-utils.scrbl b/collects/scribblings/framework/gui-utils.scrbl index 028fe27e03..172a1be0e7 100644 --- a/collects/scribblings/framework/gui-utils.scrbl +++ b/collects/scribblings/framework/gui-utils.scrbl @@ -3,8 +3,5 @@ @(require (for-label framework)) @(require (for-label scheme/gui)) @title{GUI Utilities} - -@(require framework/framework-docs) @(defmodule framework/gui-utils) - @(include-extracted (lib "gui-utils.ss" "framework")) diff --git a/collects/scribblings/framework/handler.scrbl b/collects/scribblings/framework/handler.scrbl index 454d69bdbf..bc320e595a 100644 --- a/collects/scribblings/framework/handler.scrbl +++ b/collects/scribblings/framework/handler.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Handler} -@(require framework/framework-docs) -@(def-fw-procs handler) + +@(include-extracted (lib "main.ss" "framework") #rx"^handler:") diff --git a/collects/scribblings/framework/icon.scrbl b/collects/scribblings/framework/icon.scrbl index b8a565d37f..6146791735 100644 --- a/collects/scribblings/framework/icon.scrbl +++ b/collects/scribblings/framework/icon.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Icon} -@(require framework/framework-docs) -@(def-fw-procs icon) + +@(include-extracted (lib "main.ss" "framework") #rx"^icon:") diff --git a/collects/scribblings/framework/keymap.scrbl b/collects/scribblings/framework/keymap.scrbl index 2a1605ebb4..5e7db0f578 100644 --- a/collects/scribblings/framework/keymap.scrbl +++ b/collects/scribblings/framework/keymap.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Keymap} @@ -41,5 +41,5 @@ } } @defclass[keymap:aug-keymap% (keymap:aug-keymap-mixin keymap%) ()]{} -@(require framework/framework-docs) -@(def-fw-procs keymap) + +@(include-extracted (lib "main.ss" "framework") #rx"^keymap:") diff --git a/collects/scribblings/framework/main.scrbl b/collects/scribblings/framework/main.scrbl index ed90be3f9b..d169e5250c 100644 --- a/collects/scribblings/framework/main.scrbl +++ b/collects/scribblings/framework/main.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Main} -@(require framework/framework-docs) -@(def-fw-procs main) + +@(include-extracted (lib "main.ss" "framework") #rx"^main:") diff --git a/collects/scribblings/framework/menu.scrbl b/collects/scribblings/framework/menu.scrbl index 2e9b1f6851..4c4bc63e51 100644 --- a/collects/scribblings/framework/menu.scrbl +++ b/collects/scribblings/framework/menu.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Menu} @@ -44,5 +44,5 @@ @defclass[menu:can-restore-menu-item% (menu:can-restore-mixin menu-item%) ()]{} @defclass[menu:can-restore-checkable-menu-item% (menu:can-restore-mixin checkable-menu-item%) ()]{} @defclass[menu:can-restore-underscore-menu% (menu:can-restore-underscore-mixin menu%) ()]{} -@(require framework/framework-docs) -@(def-fw-procs menu) + +@(include-extracted (lib "main.ss" "framework") #rx"^menu:") diff --git a/collects/scribblings/framework/mode.scrbl b/collects/scribblings/framework/mode.scrbl index 5622fdb129..f9f242be61 100644 --- a/collects/scribblings/framework/mode.scrbl +++ b/collects/scribblings/framework/mode.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Mode} -@(require framework/framework-docs) -@(def-fw-procs mode) + +@(include-extracted (lib "main.ss" "framework") #rx"^mode:") diff --git a/collects/scribblings/framework/number-snip.scrbl b/collects/scribblings/framework/number-snip.scrbl index 9a975e5d31..d4c604fc7f 100644 --- a/collects/scribblings/framework/number-snip.scrbl +++ b/collects/scribblings/framework/number-snip.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Number Snip} @@ -11,5 +11,5 @@ Constructs a number snip from its input. } } -@(require framework/framework-docs) -@(def-fw-procs number-snip) + +@(include-extracted (lib "main.ss" "framework") #rx"^number-snip:") diff --git a/collects/scribblings/framework/panel.scrbl b/collects/scribblings/framework/panel.scrbl index d5b7b90d25..3d2233ed0b 100644 --- a/collects/scribblings/framework/panel.scrbl +++ b/collects/scribblings/framework/panel.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Panel} @@ -167,5 +167,5 @@ } @defclass[panel:vertical-dragable% (panel:vertical-dragable-mixin (panel:dragable-mixin vertical-panel%)) ()]{} @defclass[panel:horizontal-dragable% (panel:horizontal-dragable-mixin (panel:dragable-mixin horizontal-panel%)) ()]{} -@(require framework/framework-docs) -@(def-fw-procs panel) + +@(include-extracted (lib "main.ss" "framework") #rx"^panel:") diff --git a/collects/scribblings/framework/pasteboard.scrbl b/collects/scribblings/framework/pasteboard.scrbl index 1604842421..cfb0c6f6a3 100644 --- a/collects/scribblings/framework/pasteboard.scrbl +++ b/collects/scribblings/framework/pasteboard.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Pasteboard} @@ -10,5 +10,5 @@ @defclass[pasteboard:file% (editor:file-mixin pasteboard:keymap%) ()]{} @defclass[pasteboard:backup-autosave% (editor:backup-autosave-mixin pasteboard:file%) ()]{} @defclass[pasteboard:info% (editor:info-mixin pasteboard:backup-autosave%) ()]{} -@(require framework/framework-docs) -@(def-fw-procs pasteboard) + +@(include-extracted (lib "main.ss" "framework") #rx"^pasteboard:") diff --git a/collects/scribblings/framework/path-utils.scrbl b/collects/scribblings/framework/path-utils.scrbl index 16ab124dd5..b3955e2a4e 100644 --- a/collects/scribblings/framework/path-utils.scrbl +++ b/collects/scribblings/framework/path-utils.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Path Utils} -@(require framework/framework-docs) -@(def-fw-procs path-utils) + +@(include-extracted (lib "main.ss" "framework") #rx"^path-utils:") diff --git a/collects/scribblings/framework/preferences-text.scrbl b/collects/scribblings/framework/preferences-text.scrbl index 551e8d12ee..2506cdf3cc 100644 --- a/collects/scribblings/framework/preferences-text.scrbl +++ b/collects/scribblings/framework/preferences-text.scrbl @@ -4,7 +4,6 @@ @(require (for-label scheme/gui)) @title{Preferences, Textual} -@(require framework/framework-docs) @(defmodule framework/preferences) @(include-extracted (lib "preferences.ss" "framework")) diff --git a/collects/scribblings/framework/preferences.scrbl b/collects/scribblings/framework/preferences.scrbl index f99a250871..9e03bb40ef 100644 --- a/collects/scribblings/framework/preferences.scrbl +++ b/collects/scribblings/framework/preferences.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Preferences} -@(require framework/framework-docs) -@(def-fw-procs preferences) + +@(include-extracted (lib "main.ss" "framework") #rx"^preferences:") diff --git a/collects/scribblings/framework/scheme.scrbl b/collects/scribblings/framework/scheme.scrbl index 7018d65da0..941585ddf0 100644 --- a/collects/scribblings/framework/scheme.scrbl +++ b/collects/scribblings/framework/scheme.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Scheme} @@ -269,5 +269,5 @@ } @defclass[scheme:text% (scheme:set-mode-mixin (scheme:text-mixin (text:autocomplete-mixin (mode:host-text-mixin color:text%)))) ()]{} @defclass[scheme:text-mode% (scheme:text-mode-mixin color:text-mode%) ()]{} -@(require framework/framework-docs) -@(def-fw-procs scheme) + +@(include-extracted (lib "main.ss" "framework") #rx"^scheme:") diff --git a/collects/scribblings/framework/test.scrbl b/collects/scribblings/framework/test.scrbl index f23611c829..aaf4d89d64 100644 --- a/collects/scribblings/framework/test.scrbl +++ b/collects/scribblings/framework/test.scrbl @@ -4,7 +4,6 @@ @(require (for-label scheme/gui)) @title{Test} -@(require framework/framework-docs) @(defmodule framework/test) The framework provides several new primitive functions that simulate @@ -114,5 +113,4 @@ actual mouse. @section{Test Functions} -@(def-fw-procs test) @(include-extracted (lib "test.ss" "framework")) diff --git a/collects/scribblings/framework/text.scrbl b/collects/scribblings/framework/text.scrbl index 993d47c132..995db85197 100644 --- a/collects/scribblings/framework/text.scrbl +++ b/collects/scribblings/framework/text.scrbl @@ -1,5 +1,5 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Text} @@ -946,5 +946,5 @@ @defclass[text:backup-autosave% (editor:backup-autosave-mixin text:clever-file-format%) ()]{} @defclass[text:searching% (text:searching-mixin text:backup-autosave%) ()]{} @defclass[text:info% (text:info-mixin (editor:info-mixin text:searching%)) ()]{} -@(require framework/framework-docs) -@(def-fw-procs text) + +@(include-extracted (lib "main.ss" "framework") #rx"^text:") diff --git a/collects/scribblings/framework/version.scrbl b/collects/scribblings/framework/version.scrbl index 843806e56b..6d4023e57c 100644 --- a/collects/scribblings/framework/version.scrbl +++ b/collects/scribblings/framework/version.scrbl @@ -1,8 +1,8 @@ #lang scribble/doc -@(require scribble/manual) +@(require scribble/manual scribble/extract) @(require (for-label framework)) @(require (for-label scheme/gui)) @title{Version} -@(require framework/framework-docs) -@(def-fw-procs version) + +@(include-extracted (lib "main.ss" "framework") #rx"^version:")