{"size": 2434, "ext": "scrbl", "max_stars_repo_path": "pict-snip-doc/scribblings/pict-snip/pict-snip.scrbl", "max_stars_repo_name": "LiberalArtist/pict-snip", "max_stars_repo_stars_event_min_datetime": "2018-07-29T04:13:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T16:11:17.000Z", "max_issues_repo_path": "pict-snip-doc/scribblings/pict-snip/pict-snip.scrbl", "max_issues_repo_name": "LiberalArtist/pict-snip", "max_issues_repo_issues_event_min_datetime": "2017-08-25T20:26:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:48:40.000Z", "max_forks_repo_path": "pict-snip-doc/scribblings/pict-snip/pict-snip.scrbl", "max_forks_repo_name": "LiberalArtist/pict-snip", "max_forks_repo_forks_event_min_datetime": "2017-04-25T11:04:24.000Z", "max_forks_repo_forks_event_max_datetime": "2017-04-25T11:04:24.000Z"}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": 1, "avg_line_length": 32.0263157895, "max_line_length": 84, "alphanum_fraction": 0.5102711586}
#lang scribble/doc
@(require 
   scribble/manual
   (for-label
    pict/snip
    pict
    racket
    racket/snip
    racket/contract))


@title{Pict Snip: Build Snips from Picts}

@defmodule[pict/snip]{ 
  The @racketmodname[pict/snip] library
  constructs @racket[snip%] instances that
  draw based on a given @racket[pict?] object.
}

@defclass[pict-snip% snip% ()]{
  @defconstructor[([pict pict?])]{
    Creates a @racket[pict-snip%] object, using
    @racket[pict] to draw.
  }
  @defmethod[(get-pict) pict?]{
    Returns the pict passed to the constructor.
  }
  
  @defmethod[(get-extent [dc (is-a?/c dc<%>)] [x real?] [y real?]
                         [w (or/c (box/c (and/c real? (not/c negative?))) #f)]
                         [h (or/c (box/c (and/c real? (not/c negative?))) #f)]
                         [descent (or/c (box/c (and/c real? (not/c negative?))) #f)]
                         [lspace (or/c (box/c (and/c real? (not/c negative?))) #f)]
                         [rspace (or/c (box/c (and/c real? (not/c negative?))) #f)])
             void?]{
    Updates the arguments based on the 
    size of the pict returned from @racket[get-pict].
  }

  @defmethod[#:mode 
             override
             (draw [dc (is-a?/c dc<%>)] [x real?] [y real?]
                   [left real?]
                   [top real?]
                   [right real?]
                   [bottom real?]
                   [dx real?]
                   [dy real?]
                   [draw-caret (or/c 'no-caret 'show-inactive-caret 'show-caret
                                     (cons/c exact-nonnegative-integer?
                                             exact-nonnegative-integer?))])
             void?]{
    Draws the pict returned from @racket[get-pict].
  }
  
  @defmethod[(write [f (is-a?/c editor-stream-out%)]) void?]{
    Uses a @racket[record-dc%] to write the way that the
           result of @racket[get-pict] draws and saves that
           to @racket[f].
  }
                                                                            
  @defmethod[(copy) (is-a?/c pict-snip%)]{
    Returns a snip that has the same pict as @racket[this] one.
 }
  
}

@defthing[snipclass (is-a?/c snip-class%)]{
  The @racket[snip-class%] instance used by
      instances of @racket[pict-snip%].
}
@defthing[reader (is-a?/c snip-reader<%>)]{
  The @racket[snip-reader<%>] instance used
      by the @racketmodname[wxme] library.
}
