Sha256: eb738a5508a25ca9fc4ac02463bd79eb0fe69c5b553c165b387adb79faac7d3b

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

require 'cairo'
require 'squib/input_helpers'

module Squib
  # Back end graphics. Private.
  class Card
    include Squib::InputHelpers

    # :nodoc:
    # @api private
    attr_reader :width, :height

    # :nodoc:
    # @api private
    attr_accessor :cairo_surface, :cairo_context

    # :nodoc:
    # @api private
    def initialize(deck, width, height)
      @deck=deck; @width=width; @height=height
      @cairo_surface = Cairo::ImageSurface.new(width,height)
      @cairo_context = Cairo::Context.new(@cairo_surface)
    end

  # A save/restore wrapper for using Cairo
  # :nodoc:
  # @api private
    def use_cairo(&block)
      @cairo_context.save
      block.yield(@cairo_context)
      @cairo_context.restore
    end

    ########################
    ### BACKEND GRAPHICS ###
    ########################
    require 'squib/graphics/background'
    require 'squib/graphics/image'
    require 'squib/graphics/save_doc'
    require 'squib/graphics/save_images'
    require 'squib/graphics/shapes'
    require 'squib/graphics/showcase'
    require 'squib/graphics/text'

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
squib-0.2.0 lib/squib/card.rb