diff --git a/collects/mred/mred-sig.rkt b/collects/mred/mred-sig.rkt index 989e0ace..1f8aa217 100644 --- a/collects/mred/mred-sig.rkt +++ b/collects/mred/mred-sig.rkt @@ -1,4 +1,3 @@ - #lang scheme/signature add-color<%> @@ -38,8 +37,6 @@ control<%> current-eventspace current-eventspace-has-menu-root? current-eventspace-has-standard-menus? -current-ps-afm-file-paths -current-ps-cmap-file-paths current-ps-setup current-text-keymap-initializer cursor% diff --git a/collects/mred/mred.rkt b/collects/mred/mred.rkt index 5fdbb4e1..5c10a451 100644 --- a/collects/mred/mred.rkt +++ b/collects/mred/mred.rkt @@ -4,6 +4,7 @@ namespace-anchor->empty-namespace make-base-empty-namespace) scheme/class + racket/draw mzlib/etc (prefix wx: "private/kernel.ss") (prefix wx: "private/wxme/style.ss") @@ -101,26 +102,15 @@ add-pasteboard-keymap-functions begin-busy-cursor bell - bitmap% - make-bitmap - read-bitmap - make-monochrome-bitmap - brush% - brush-list% editor-data% editor-data-class% editor-data-class-list<%> check-for-break clipboard<%> clipboard-client% - color% - color-database<%> control-event% current-eventspace - current-ps-setup cursor% - dc<%> - dc-path% get-display-depth end-busy-cursor event% @@ -128,10 +118,7 @@ eventspace? find-graphical-system-path flush-display - font% - font-list% - font-name-directory<%> - get-highlight-background-color + get-highlight-background-color get-highlight-text-color get-the-editor-data-class-list get-the-snip-class-list @@ -152,14 +139,9 @@ editor-wordbreak-map% mouse-event% mult-color<%> - pen% - pen-list% - point% - ps-setup% read-editor-global-footer read-editor-global-header read-editor-version - region% scroll-event% snip% snip-admin% @@ -181,14 +163,7 @@ yield eventspace-shutdown? get-panel-background - gl-context<%> - gl-config% - the-color-database - the-font-name-directory - the-font-list - the-pen-list - the-brush-list the-style-list the-editor-wordbreak-map make-screen-bitmap @@ -197,9 +172,7 @@ (define the-clipboard (wx:get-the-clipboard)) (define the-x-selection-clipboard (wx:get-the-x-selection)) - ;; Obsolete - (define current-ps-afm-file-paths (make-parameter null)) - (define current-ps-cmap-file-paths (make-parameter null)) + (provide (all-from racket/draw)) (provide button% canvas% @@ -277,13 +250,10 @@ get-top-level-edit-target-window register-collecting-blit unregister-collecting-blit - bitmap-dc% - post-script-dc% printer-dc% current-text-keymap-initializer sleep/yield get-window-text-extent - get-family-builtin-face send-message-to-window the-clipboard the-x-selection-clipboard @@ -309,8 +279,6 @@ make-gui-namespace make-gui-empty-namespace file-creator-and-type - current-ps-afm-file-paths - current-ps-cmap-file-paths hide-cursor-until-moved system-position-ok-before-cancel? label-string? diff --git a/collects/mred/private/fontdialog.rkt b/collects/mred/private/fontdialog.rkt index 035f1118..c8c37957 100644 --- a/collects/mred/private/fontdialog.rkt +++ b/collects/mred/private/fontdialog.rkt @@ -39,7 +39,7 @@ (let ([s (send (send edit get-style-list) find-named-style "Standard")]) (send s set-delta (font->delta f))))))] [p (make-object horizontal-pane% f)] - [face (make-object list-box% #f (get-face-list) p refresh-sample)] + [face (make-object list-box% #f (wx:get-face-list) p refresh-sample)] [p2 (make-object vertical-pane% p)] [p3 (instantiate horizontal-pane% (p2) [stretchable-width #f])] [style (let ([pnl (instantiate group-box-panel% ("Style" p3) [stretchable-height #f] [stretchable-width #f])]) @@ -98,7 +98,7 @@ (lambda (font) (let* ([facen (if font (send font get-face) - (get-family-builtin-face 'default))] + (wx:get-family-builtin-face 'default))] [f (and facen (send face find-string facen))]) (and f (>= f 0) (send face set-selection f))) (when font diff --git a/collects/mred/private/gdi.rkt b/collects/mred/private/gdi.rkt index 7ef08bcc..89a847bb 100644 --- a/collects/mred/private/gdi.rkt +++ b/collects/mred/private/gdi.rkt @@ -13,17 +13,13 @@ (provide register-collecting-blit unregister-collecting-blit - bitmap-dc% - post-script-dc% printer-dc% get-window-text-extent - get-family-builtin-face normal-control-font small-control-font tiny-control-font view-control-font - menu-control-font - get-face-list) + menu-control-font) (define register-collecting-blit (case-lambda @@ -50,14 +46,6 @@ (check-instance 'unregister-collecting-blit canvas% 'canvas% #f canvas) (wx:unregister-collecting-blit (mred->wx canvas)))) - (define bitmap-dc% - (class100 wx:bitmap-dc% ([bitmap #f]) - (inherit set-bitmap) - (sequence - (super-init) - (when bitmap - (set-bitmap bitmap))))) - (define-syntax check-page-active (syntax-rules () [(_ check-page-status (id . args) ...) (begin (check-one-page-active check-page-status id args) ...)])) @@ -167,20 +155,6 @@ (super-new))) - (define post-script-dc% - (class (doc+page-check-mixin wx:post-script-dc% 'post-script-dc%) - (init [interactive #t][parent #f][use-paper-bbox #f][as-eps #t]) - - (check-top-level-parent/false '(constructor post-script-dc) parent) - - (define is-eps? (and as-eps #t)) - (define/override (multiple-pages-ok?) (not is-eps?)) - - (as-entry - (lambda () - (let ([p (and parent (mred->wx parent))]) - (as-exit (lambda () (super-make-object interactive p use-paper-bbox as-eps)))))))) - (define printer-dc% (class100 (doc+page-check-mixin wx:printer-dc% 'printer-dc%) ([parent #f]) (sequence @@ -199,37 +173,6 @@ (check-instance 'get-window-text-extent wx:font% 'font% #f font) (let-values ([(w h d a) (get-window-text-extent* string font combine?)]) (values (inexact->exact (ceiling w)) (inexact->exact (ceiling h))))])) - - (define ugly? - (lambda (a) - (and (positive? (string-length a)) - (not (or (char-alphabetic? (string-ref a 0)) - (char-numeric? (string-ref a 0)) - (char=? #\- (string-ref a 0))))))) - - (define compare-face-names - (lambda (a b) - (let ([a-sp? (char=? #\space (string-ref a 0))] - [b-sp? (char=? #\space (string-ref b 0))] - [a-ugly? (ugly? a)] - [b-ugly? (ugly? b)]) - (cond [(eq? a-sp? b-sp?) - (cond - [(eq? a-ugly? b-ugly?) - (string-locale-ci].}) - (define MismatchExn @elem{an @scheme[exn:fail:contract] exception is raised}) - (define AFM @elem{Adobe Font Metrics}) (define (MonitorMethod what by-what method whatsit) @@ -244,18 +250,6 @@ information@|details|, even if the editor currently has delayed refreshing (see (hspace 1) (bytes->string/latin-1 name)))) - (define (res-sym s) - (string->symbol (string-append "GRacket:" s))) - - (define (Resource s) - @elem{@to-element[`(quote ,(res-sym s))] - preference}) - (define (ResourceFirst s) ; fixme -- add index - (let ([r (Resource s)]) - (index* (list (format "~a preference" (res-sym s))) - (list r) - r))) - (define (edsnipsize a b c) @elem{An @scheme[editor-snip%] normally stretches to wrap around the size of the editor it contains. This method @|a| of the snip @@ -269,11 +263,6 @@ information@|details|, even if the editor currently has delayed refreshing (see "smaller" @elem{the editor is @|b|-aligned in the snip})) - (define (boxisfill which what) - @elem{The @|which| box is filled with @|what|.}) - (define (boxisfillnull which what) - @elem{The @|which| box is filled with @|what|, unless @|which| is @scheme[#f].}) - (define (slant . s) (make-element "slant" (decode-content s))) diff --git a/collects/scribblings/gui/font-funcs.scrbl b/collects/scribblings/gui/font-funcs.scrbl index 74923e89..3eef2d2d 100644 --- a/collects/scribblings/gui/font-funcs.scrbl +++ b/collects/scribblings/gui/font-funcs.scrbl @@ -3,28 +3,6 @@ @title{Fonts} - -@defproc[(get-face-list [family (one-of/c 'mono 'all) 'all]) - (listof string?)]{ - -Returns a list of font face names available on the current system. If - @scheme['mono] is provided as the argument, then only faces that are - known to correspond to monospace fonts are included in the list. - -} - -@defproc[(get-family-builtin-face [family (one-of/c 'default 'decorative 'roman 'script - 'swiss 'modern 'symbol 'system)]) - string?]{ - -Returns the built-in default face mapping for a particular font - family. The built-in default can be overridden via preferences, as - described in @secref["fontresources"]. - -See @scheme[font%] for information about @scheme[family]. - -} - @defthing[menu-control-font (is-a?/c font%)]{ This font is the default for @scheme[popup-menu%] objects. diff --git a/collects/scribblings/gui/gui.scrbl b/collects/scribblings/gui/gui.scrbl index 3fced25b..31cdac7a 100644 --- a/collects/scribblings/gui/gui.scrbl +++ b/collects/scribblings/gui/gui.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require "common.ss") -@title{@bold{GUI}: Racket Graphics Toolkit} +@title{@bold{GUI}: Racket Graphical Interface Toolkit} @author["Matthew Flatt" "Robert Bruce Findler" "John Clements"] @@ -9,12 +9,13 @@ @defmodule*/no-declare[(racket/gui/base)]{The @racketmodname[racket/gui/base] library provides all of the class, -interface, and procedure bindings defined in this manual.} +interface, and procedure bindings defined in this manual, in addition +to the bindings of @racketmodname[racket/draw].} @defmodulelang*/no-declare[(racket/gui)]{The @racketmodname[racket/gui] language combines all bindings of the @racketmodname[racket] language and the -@racketmodname[racket/gui/base] modules.} +@racketmodname[racket/gui/base] and @racketmodname[racket/draw] modules.} @table-of-contents[] @@ -23,23 +24,9 @@ interface, and procedure bindings defined in this manual.} @include-section["guide.scrbl"] @include-section["reference.scrbl"] -@include-section["config.scrbl"] +@include-section["prefs.scrbl"] @include-section["dynamic.scrbl"] - -@;------------------------------------------------------------------------ - -@(bibliography - - (bib-entry #:key "Adobe99" - #:author "Adobe Systems Incorporated" - #:title "PostScript Language Reference, third edition" - #:is-book? #t - #:url "http://partners.adobe.com/public/developer/en/ps/PLRM.pdf" - #:date "1999") - - ) - @;------------------------------------------------------------------------ @index-section[] diff --git a/collects/scribblings/gui/guide.scrbl b/collects/scribblings/gui/guide.scrbl index 451958a3..3b4058e5 100644 --- a/collects/scribblings/gui/guide.scrbl +++ b/collects/scribblings/gui/guide.scrbl @@ -4,7 +4,7 @@ @title[#:style '(toc reveal)]{Overview} For documentation purposes, the graphics toolbox is organized into - three parts: + two parts: @itemize[ @@ -13,11 +13,6 @@ For documentation purposes, the graphics toolbox is organized into text fields, and events. The windowing toolbox is described in @secref["windowing-overview"].} - @item{The @deftech{drawing toolbox}, for drawing pictures or - implementing dynamic GUI programs (such as a video game) using - drawing canvases, pens, and brushes. The drawing toolbox is - described in @secref["drawing-overview"].} - @item{The @deftech{editor toolbox}, for developing traditional text editors, editors that mix text and graphics, or free-form layout editors (such as a word processor, HTML editor, or icon-based file @@ -26,11 +21,8 @@ For documentation purposes, the graphics toolbox is organized into ] -These three parts roughly represent layers of increasing - sophistication. Simple GUI programs access only the windowing toolbox - directly, more complex programs use both the windowing and drawing - toolboxes, and large-scale applications rely on all three - toolboxes. +Simple GUI programs access only the windowing toolbox directly, while + large-scale applications tend to use the editor toolbox as well. @local-table-of-contents[] @@ -40,8 +32,4 @@ These three parts roughly represent layers of increasing @;------------------------------------------------------------------------ -@include-section["draw-overview.scrbl"] - -@;------------------------------------------------------------------------ - @include-section["editor-overview.scrbl"] diff --git a/collects/scribblings/gui/prefs.scrbl b/collects/scribblings/gui/prefs.scrbl index 0bc67865..ae694426 100644 --- a/collects/scribblings/gui/prefs.scrbl +++ b/collects/scribblings/gui/prefs.scrbl @@ -20,11 +20,6 @@ The following are the (case-sensitive) preference names used by GRacket: the basic style in a style list, and thus the default font size for an editor.} - @item{@ResourceFirst{controlFontSize} --- sets the font size for - control and menu labels (Windows, X); the font is the @scheme['system] - font, which can be configured as described in - @secref["fontresources"].} - @item{@ResourceFirst{defaultMenuPrefix} --- sets the prefix used by default for menu item shortcuts under X, one of @scheme['ctl], @scheme['meta], or @scheme['alt]. The default is @@ -32,25 +27,10 @@ The following are the (case-sensitive) preference names used by GRacket: @scheme['alt], underlined mnemonics (introduced by @litchar{&} in menu labels) are suppressed.} - @item{@ResourceFirst{altUpSelectsMenu} --- a true value makes - pressing and releasing the Alt key select the first menu in the menu - bar under X.} - @item{@ResourceFirst{emacsUndo} --- a true value makes undo in editors work as in Emacs (i.e., undo operations are themselves kept in the undo stack).} - @item{@ResourceFirst{hiliteColor} --- a string to sets the color for - highlighting text, menus, and other GUI elements under X; the - preference string should contain six hexadecimal digits, two for each - component of the color. For example, set @Resource{hiliteColor} to - @scheme["0000A0"] and set @Resource{hiliteMenuBorder} to @scheme[#t] - for a Bluecurve-like look.} - - @item{@ResourceFirst{hiliteMenuBorder} --- a true value causes a menu - selection to be highlighted with a border (in addition to a color) under - X.} - @item{@ResourceFirst{wheelStep} --- sets the default mouse-wheel step size of @scheme[editor-canvas%] objects.} @@ -61,26 +41,8 @@ The following are the (case-sensitive) preference names used by GRacket: @item{@ResourceFirst{playcmd} --- used to format a sound-playing command; see @scheme[play-sound] for details.} - @item{@ResourceFirst{forceFocus} --- a true value enables extra - effort in GRacket to move the focus to a top-level window that is shown - or raised.} - @item{@ResourceFirst{doubleClickTime} --- overrides the platform-specific default interval (in milliseconds) for double-click events.} - @item{@ResourceFirst{gamma} --- sets the gamma value used in - gamma-correcting PNG files.} - - @item{@ResourceFirst{selectionAsClipboard} --- under X, a true value - causes @scheme[the-clipboard] to be an alias to - @scheme[the-x-selection-clipboard], which means that cut and paste - operations use the X selection instead of the X clipboard. See also - @scheme[clipboard<%>].} - - ] - -In addition, preference names built from font face names can provide - or override default entries for the @scheme[font-name-directory<%>]; - see @secref["fontresources"] for information. diff --git a/collects/scribblings/gui/printer-dc-class.scrbl b/collects/scribblings/gui/printer-dc-class.scrbl index e6078bfd..f75220bd 100644 --- a/collects/scribblings/gui/printer-dc-class.scrbl +++ b/collects/scribblings/gui/printer-dc-class.scrbl @@ -3,13 +3,10 @@ @defclass/title[printer-dc% object% (dc<%>)]{ -A @scheme[printer-dc%] object is a Windows or Mac OS X printer - device context. The class cannot be instantiated under X (an - @scheme[exn:misc:unsupported] exception is raised). - -Under Mac OS X, a newly created @scheme[printer-dc%] object obtains - orientation (portrait versus landscape) and scaling information from - the current @scheme[ps-setup%] object, as determined by the +A @scheme[printer-dc%] object is a printer device context. A newly + created @scheme[printer-dc%] object obtains orientation (portrait + versus landscape) and scaling information from the current + @scheme[ps-setup%] object, as determined by the @scheme[current-ps-setup] parameter. This information can be configured by the user through a dialog shown by @scheme[get-page-setup-from-user]. diff --git a/collects/scribblings/gui/reference.scrbl b/collects/scribblings/gui/reference.scrbl index a6cf354a..707a646f 100644 --- a/collects/scribblings/gui/reference.scrbl +++ b/collects/scribblings/gui/reference.scrbl @@ -7,8 +7,6 @@ @include-section["win-classes.scrbl"] @include-section["win-funcs.scrbl"] -@include-section["draw-classes.scrbl"] -@include-section["draw-funcs.scrbl"] @include-section["editor-classes.scrbl"] @include-section["editor-funcs.scrbl"] @include-section["wxme.scrbl"] diff --git a/collects/scribblings/gui/win-classes.scrbl b/collects/scribblings/gui/win-classes.scrbl index ee89b352..afa5b9ed 100644 --- a/collects/scribblings/gui/win-classes.scrbl +++ b/collects/scribblings/gui/win-classes.scrbl @@ -57,6 +57,7 @@ Alphabetical: @include-section["pane-class.scrbl"] @include-section["panel-class.scrbl"] @include-section["popup-menu-class.scrbl"] +@include-section["printer-dc-class.scrbl"] @include-section["radio-box-class.scrbl"] @include-section["selectable-menu-item-intf.scrbl"] @include-section["separator-menu-item-class.scrbl"] diff --git a/collects/scribblings/gui/win-funcs.scrbl b/collects/scribblings/gui/win-funcs.scrbl index 248d79bb..70bb4e72 100644 --- a/collects/scribblings/gui/win-funcs.scrbl +++ b/collects/scribblings/gui/win-funcs.scrbl @@ -8,4 +8,6 @@ @include-section["dialog-funcs.scrbl"] @include-section["eventspace-funcs.scrbl"] @include-section["system-menu-funcs.scrbl"] +@include-section["global-draw-funcs.scrbl"] +@include-section["font-funcs.scrbl"] @include-section["miscwin-funcs.scrbl"] diff --git a/doc/release-notes/racket/Draw_and_GUI_5_1.txt b/doc/release-notes/racket/Draw_and_GUI_5_1.txt index 26a02390..ddc76d85 100644 --- a/doc/release-notes/racket/Draw_and_GUI_5_1.txt +++ b/doc/release-notes/racket/Draw_and_GUI_5_1.txt @@ -137,3 +137,7 @@ Removed Functions The `write-resource, `get-reource', and `send-event' functions have been removed from `racket/gui/base'. If there is any demand for the removed functionality, it will be implemented in a new library. + +The `current-ps-afm-file-paths' and `current-ps-cmap-file-paths' +functions have been removed, because they no longer apply. PostScript +font information is obtained through Pango.