### Home Classes Methods

### In Files

- lib/rabbit/renderer/engine/gdk.rb

### Methods

- ::priority
- #alpha_available?
- #background=
- #background_image=
- #draw_arc
- #draw_arc_by_radius
- #draw_layout
- #draw_line
- #draw_lines
- #draw_pixbuf
- #draw_polygon
- #draw_rectangle
- #draw_rounded_rectangle
- #finish_renderer
- #foreground=
- #init_renderer
- #prepare_renderer

### Included Modules

- Rabbit::Renderer::Kernel

### Class/Module Index

Quicksearch

- Rabbit
- Rabbit::AAFigureCanNotHandleError
- Rabbit::Action
- Rabbit::ApplyFinish
- Rabbit::AuthorConfiguration
- Rabbit::BlockDiagCanNotHandleError
- Rabbit::CantAllocateColorError
- Rabbit::CantFindHTMLTemplate
- Rabbit::CantFindThemeRDTemplate
- Rabbit::Canvas
- Rabbit::Command
- Rabbit::Command::Rabbit
- Rabbit::Command::RabbitSlide
- Rabbit::Command::RabbitTheme
- Rabbit::Config
- Rabbit::Console
- Rabbit::Converter
- Rabbit::CursorManager
- Rabbit::DependencyCanvas
- Rabbit::DiaCanNotHandleError
- Rabbit::DirtyCount
- Rabbit::EPSCanNotHandleError
- Rabbit::Element
- Rabbit::Element::Author
- Rabbit::Element::Base
- Rabbit::Element::Base::DrawHook
- Rabbit::Element::BlockElement
- Rabbit::Element::BlockHorizontalCentering
- Rabbit::Element::BlockQuote
- Rabbit::Element::Body
- Rabbit::Element::ClassName
- Rabbit::Element::Code
- Rabbit::Element::Comment
- Rabbit::Element::Container
- Rabbit::Element::ContainerElement
- Rabbit::Element::ContentSource
- Rabbit::Element::CustomTag
- Rabbit::Element::Date
- Rabbit::Element::DeletedText
- Rabbit::Element::DescriptionContent
- Rabbit::Element::DescriptionList
- Rabbit::Element::DescriptionListItem
- Rabbit::Element::DescriptionTerm
- Rabbit::Element::Emphasis
- Rabbit::Element::EnumList
- Rabbit::Element::EnumListItem
- Rabbit::Element::FootText
- Rabbit::Element::FootTextBlock
- Rabbit::Element::Footnote
- Rabbit::Element::HeadLine
- Rabbit::Element::Image
- Rabbit::Element::ImageTitleSlide
- Rabbit::Element::Index
- Rabbit::Element::IndexSlide
- Rabbit::Element::IndexThumbnail
- Rabbit::Element::IndexThumbnailRow
- Rabbit::Element::Institution
- Rabbit::Element::ItemList
- Rabbit::Element::ItemListItem
- Rabbit::Element::Keyboard
- Rabbit::Element::Keyword
- Rabbit::Element::MethodDescription
- Rabbit::Element::MethodKind
- Rabbit::Element::MethodList
- Rabbit::Element::MethodListItem
- Rabbit::Element::MethodName
- Rabbit::Element::MethodTerm
- Rabbit::Element::Note
- Rabbit::Element::Paragraph
- Rabbit::Element::Place
- Rabbit::Element::PopplerPage
- Rabbit::Element::PopplerSlide
- Rabbit::Element::PopplerTitleSlide
- Rabbit::Element::PreformattedBlock
- Rabbit::Element::PreformattedText
- Rabbit::Element::ReferText
- Rabbit::Element::Slide
- Rabbit::Element::SlideElement
- Rabbit::Element::Subscript
- Rabbit::Element::Subtitle
- Rabbit::Element::Superscript
- Rabbit::Element::SyntaxHighlightingBlock
- Rabbit::Element::SyntaxHighlightingText
- Rabbit::Element::Table
- Rabbit::Element::TableBody
- Rabbit::Element::TableCell
- Rabbit::Element::TableHead
- Rabbit::Element::TableHeader
- Rabbit::Element::TableRow
- Rabbit::Element::Text
- Rabbit::Element::TextBlock
- Rabbit::Element::TextBlockElement
- Rabbit::Element::TextContainer
- Rabbit::Element::TextContainerElement
- Rabbit::Element::TextElement
- Rabbit::Element::TextRenderer
- Rabbit::Element::Title
- Rabbit::Element::TitleSlide
- Rabbit::Element::Variable
- Rabbit::Element::Verbatim
- Rabbit::Element::Video
- Rabbit::Element::WaitBlock
- Rabbit::Element::WaitTag
- Rabbit::Element::When
- Rabbit::Element::Where
- Rabbit::EmbedFrame
- Rabbit::Error
- Rabbit::Format
- Rabbit::Format::ConvenienceTextFormatter
- Rabbit::Format::Foreground
- Rabbit::Format::Formatter
- Rabbit::Format::Size
- Rabbit::Format::SpanTextFormatter
- Rabbit::Format::ValueContainerFormatter
- Rabbit::Frame
- Rabbit::Front
- Rabbit::Front::PublicLevel
- Rabbit::GIMPCanNotHandleError
- Rabbit::GemBuilder
- Rabbit::GemFinder
- Rabbit::Gesture
- Rabbit::Gesture::Handler
- Rabbit::Gesture::Processor
- Rabbit::GetText
- Rabbit::Graffiti
- Rabbit::Graffiti::ConfigDialog
- Rabbit::Graffiti::Processor
- Rabbit::HTML
- Rabbit::HTML::Generator
- Rabbit::ImageFileDoesNotExistError
- Rabbit::ImageLoadError
- Rabbit::ImageLoadWithExternalCommandError
- Rabbit::ImageLoader
- Rabbit::ImageManipulable
- Rabbit::ImageManipulable::Base
- Rabbit::ImageManipulable::Default
- Rabbit::ImageManipulable::Dia
- Rabbit::ImageManipulable::EPS
- Rabbit::ImageManipulable::GIMP
- Rabbit::ImageManipulable::PDF
- Rabbit::ImageManipulable::SVG
- Rabbit::ImmutableSourceTypeError
- Rabbit::InfoWindow
- Rabbit::InvalidImageSizeError
- Rabbit::InvalidMotionError
- Rabbit::Keys
- Rabbit::Keys::Alt
- Rabbit::Keys::Control
- Rabbit::Keys::Shift
- Rabbit::Logger
- Rabbit::Logger::Base
- Rabbit::Logger::GUI
- Rabbit::Logger::STDERR
- Rabbit::Logger::Severity
- Rabbit::Menu
- Rabbit::ModuleLoader
- Rabbit::NoPrintSupportError
- Rabbit::NotAvailableInterfaceError
- Rabbit::NotExistError
- Rabbit::NotFileError
- Rabbit::NotReadableError
- Rabbit::NullFrame
- Rabbit::ParseError
- Rabbit::ParseFinish
- Rabbit::Parser
- Rabbit::Parser::Base
- Rabbit::Parser::Ext
- Rabbit::Parser::Ext::AAFigure
- Rabbit::Parser::Ext::BlockDiag
- Rabbit::Parser::Ext::CodeRay
- Rabbit::Parser::Ext::CodeRay::RabbitEncoder
- Rabbit::Parser::Ext::Emacs
- Rabbit::Parser::Ext::Enscript
- Rabbit::Parser::Ext::Entity
- Rabbit::Parser::Ext::Escape
- Rabbit::Parser::Ext::Image
- Rabbit::Parser::Ext::Image::Private
- Rabbit::Parser::Ext::Inline
- Rabbit::Parser::Ext::TeX
- Rabbit::Parser::Ext::Video
- Rabbit::Parser::Image
- Rabbit::Parser::Markdown
- Rabbit::Parser::Markdown::Converter
- Rabbit::Parser::NoteSetter
- Rabbit::Parser::PDF
- Rabbit::Parser::PauseSupport
- Rabbit::Parser::RD
- Rabbit::Parser::RD::Ext
- Rabbit::Parser::RD::Ext::Base
- Rabbit::Parser::RD::Ext::BlockVerbatim
- Rabbit::Parser::RD::Ext::CharacterReference
- Rabbit::Parser::RD::Ext::Image
- Rabbit::Parser::RD::Ext::InlineVerbatim
- Rabbit::Parser::RD::Ext::Refer
- Rabbit::Parser::RD::Ext::Video
- Rabbit::Parser::RD::RD2RabbitVisitor
- Rabbit::Parser::RD::Visitor
- Rabbit::Parser::SlidePropertySetter
- Rabbit::Parser::Wiki
- Rabbit::Parser::Wiki::RabbitOutput
- Rabbit::Parser::Wiki::RabbitOutput::BlockPlugin
- Rabbit::Parser::Wiki::RabbitOutput::InlinePlugin
- Rabbit::Parser::Wiki::RabbitOutput::InlinePlugin::Private
- Rabbit::PathManipulatable
- Rabbit::Progress
- Rabbit::READMEParser
- Rabbit::RT2RabbitVisitor
- Rabbit::Renderer
- Rabbit::Renderer::Base
- Rabbit::Renderer::Color
- Rabbit::Renderer::Display
- Rabbit::Renderer::Display::Base
- Rabbit::Renderer::Display::ButtonHandler
- Rabbit::Renderer::Display::ClutterEmbed
- Rabbit::Renderer::Display::Cursor
- Rabbit::Renderer::Display::DrawingArea
- Rabbit::Renderer::Display::DrawingAreaBase
- Rabbit::Renderer::Display::DrawingAreaPrimitive
- Rabbit::Renderer::Display::DrawingAreaViewOnly
- Rabbit::Renderer::Display::GL
- Rabbit::Renderer::Display::Gesture
- Rabbit::Renderer::Display::Graffiti
- Rabbit::Renderer::Display::HookHandler
- Rabbit::Renderer::Display::Info
- Rabbit::Renderer::Display::KeyHandler
- Rabbit::Renderer::Display::Magnifier
- Rabbit::Renderer::Display::Mask
- Rabbit::Renderer::Display::Menu
- Rabbit::Renderer::Display::Progress
- Rabbit::Renderer::Display::ScrollHandler
- Rabbit::Renderer::Display::Search
- Rabbit::Renderer::Display::Spotlight
- Rabbit::Renderer::Engine
- Rabbit::Renderer::Engine::Cairo
- Rabbit::Renderer::Engine::GDK
- Rabbit::Renderer::GL
- Rabbit::Renderer::Kernel
- Rabbit::Renderer::Pixmap
- Rabbit::Renderer::Pixmap::Base
- Rabbit::Renderer::Pixmap::Cairo
- Rabbit::Renderer::Pixmap::GDK
- Rabbit::Renderer::Pixmap::GL
- Rabbit::Renderer::Print
- Rabbit::Renderer::Print::Base
- Rabbit::Renderer::Print::Cairo
- Rabbit::Renderer::Print::Layout2
- Rabbit::Renderer::Print::LayoutBase
- Rabbit::Renderer::Print::LayoutMore
- Rabbit::Renderer::Print::Multiple
- Rabbit::SOAP
- Rabbit::SOAP::Driver
- Rabbit::SOAP::Server
- Rabbit::ScreenInfo
- Rabbit::SearchWindow
- Rabbit::Searcher
- Rabbit::SlideConfiguration
- Rabbit::Source
- Rabbit::Source::ARGF
- Rabbit::Source::Base
- Rabbit::Source::File
- Rabbit::Source::Hiki
- Rabbit::Source::LimitAccessInterval
- Rabbit::Source::Memory
- Rabbit::Source::SlideShare
- Rabbit::Source::URI
- Rabbit::SourceGenerator
- Rabbit::SourceGenerator::Hiki
- Rabbit::SourceGenerator::Markdown
- Rabbit::SourceGenerator::RD
- Rabbit::SourceUnreadableError
- Rabbit::Stock
- Rabbit::SystemRunner
- Rabbit::Task
- Rabbit::Task::Slide
- Rabbit::Task::SlideShare
- Rabbit::Task::SlideShare::Error
- Rabbit::Task::Theme
- Rabbit::TeXCanNotHandleError
- Rabbit::TemporaryFile
- Rabbit::Theme
- Rabbit::Theme::Applier
- Rabbit::Theme::DirectoryEntry
- Rabbit::Theme::ElementContainer
- Rabbit::Theme::Entry
- Rabbit::Theme::FileEntry
- Rabbit::Theme::GemEntry
- Rabbit::Theme::ImageDirectoryEntry
- Rabbit::Theme::ImageFileEntry
- Rabbit::Theme::ImageGemEntry
- Rabbit::Theme::Manager
- Rabbit::Theme::Searcher
- Rabbit::ThemeConfiguration
- Rabbit::ThemeExit
- Rabbit::TrackBall
- Rabbit::TrackBall::Vector
- Rabbit::UnknownCursorTypeError
- Rabbit::UnknownPropertyError
- Rabbit::UnsupportedFormatError
- Rabbit::Utils
- Rabbit::VideoWindow
- Rabbit::VideoWindow::VideoWidget
- Rabbit::XMLRPC
- Rabbit::XMLRPC::Client
- Rabbit::XMLRPC::Server
- Rabbit::XMLRPC::Servlet
- OptionParser
- OptionParser::Category
- OptionParser::List
- OptionParser::Switch
- Cairo
- Cairo::Context
- Gtk
- Gtk::Action
- Pango
- Pango::Context
- Object

No matching classes.

# Rabbit::Renderer::Engine::GDK

### Public Class Methods

priority() click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 12
    def priority
      0
    end

### Public Instance Methods

alpha_available?() click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 32
    def alpha_available?
      false
    end

background=(color) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 40
    def background=(color)
      @background.set_rgb_fg_color(color.to_gdk_color)
    end

background_image=(pixbuf) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 44
    def background_image=(pixbuf)
      w, h = pixbuf.width, pixbuf.height
      pixmap = Gdk::Pixmap.new(nil, w, h, depth)
      pixmap.draw_rectangle(@background, true, 0, 0, w, h)
      args = [
              @foreground, pixbuf,
              0, 0, 0, 0, w, h,
              Gdk::RGB::DITHER_NORMAL, 0, 0,
             ]
      pixmap.draw_pixbuf(*args)
      @background.set_tile(pixmap)
      @background.fill = Gdk::GC::Fill::TILED
    end

draw_arc(filled, x, y, w, h, a1, a2, color=nil, params={}) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 126
    def draw_arc(filled, x, y, w, h, a1, a2, color=nil, params={})
      gc = make_gc(color, params)
      return if gc.nil?
      a1 *= 64
      a2 *= 64
      @gdk_drawable.draw_arc(gc, filled, x, y, w, h, a1, a2)
    end

draw_arc_by_radius(filled, x, y, r, a1, a2, color=nil, params={}) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 134
    def draw_arc_by_radius(filled, x, y, r, a1, a2, color=nil, params={})
      sx = x - r
      sy = y - r
      w = r * 2
      h = r * 2
      draw_arc(filled, sx, sy, w, h, a1, a2, color, params)
    end

draw_layout(layout, x, y, color=nil, params={}) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 148
    def draw_layout(layout, x, y, color=nil, params={})
      gc = make_gc(color, params)
      return if gc.nil?
      @gdk_drawable.draw_layout(gc, x, y, layout)
    end

draw_line(x1, y1, x2, y2, color=nil, params={}) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 58
    def draw_line(x1, y1, x2, y2, color=nil, params={})
      gc = make_gc(color, params)
      return if gc.nil?
      @gdk_drawable.draw_line(gc, x1, y1, x2, y2)
    end

draw_lines(points, color=nil, params={}) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 64
    def draw_lines(points, color=nil, params={})
      gc = make_gc(color, params)
      return if gc.nil?
      @gdk_drawable.draw_lines(gc, points)
    end

draw_pixbuf(pixbuf, x, y, params={}) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 154
    def draw_pixbuf(pixbuf, x, y, params={})
      gc = make_gc(params[:color], params)
      return if gc.nil?

      draw_scaled_pixbuf = params[:draw_scaled_pixbuf]
      draw_scaled_pixbuf = @draw_scaled_image if draw_scaled_pixbuf.nil?
      width = params[:width] || pixbuf.width
      height = params[:height] || pixbuf.height
      if draw_scaled_pixbuf and
          [width, height] != [pixbuf.width, pixbuf.height]
        pixbuf = pixbuf.scale(width, height)
      end
      args = [0, 0, x, y,
              width, height,
              params[:dither_mode] || Gdk::RGB::DITHER_NORMAL,
              params[:x_dither] || 0,
              params[:y_dither] || 0]
      @gdk_drawable.draw_pixbuf(gc, pixbuf, *args)
    end

draw_polygon(filled, points, color=nil, params={}) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 142
    def draw_polygon(filled, points, color=nil, params={})
      gc = make_gc(color, params)
      return if gc.nil?
      @gdk_drawable.draw_polygon(gc, filled, points)
    end

draw_rectangle(filled, x, y, w, h, color=nil, params={}) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 70
    def draw_rectangle(filled, x, y, w, h, color=nil, params={})
      gc = make_gc(color, params)
      return if gc.nil?
      @gdk_drawable.draw_rectangle(gc, filled, x, y, w, h)
    end

draw_rounded_rectangle(filled, x, y, w, h, radius, color=nil, params={}) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 76
    def draw_rounded_rectangle(filled, x, y, w, h, radius, color=nil, params={})
      x_radius = params[:x_radius] || radius
      y_radius = params[:y_radius] || radius
      x_diameter = x_radius * 2
      y_diameter = y_radius * 2

      line_width = params[:line_width]

      inner_x = x + x_radius
      inner_y = y + y_radius
      inner_w = w - x_diameter
      inner_h = h - y_diameter

      if filled
        draw_rectangle(true, inner_x, inner_y, inner_w, inner_h, color)
      end

      if filled
        top = [inner_x, y, inner_w, y_radius]
        left = [x, inner_y, x_radius, inner_h]
        bottom = [inner_x, inner_y + inner_h, inner_w, y_radius]
        right = [inner_x + inner_w, inner_y, x_radius, inner_h]

        [top, left, bottom, right].each do |rx, ry, rw, rh|
          draw_rectangle(true, rx, ry, rw, rh, color)
        end
      else
        top = [inner_x, y, inner_x + inner_w, y]
        left = [x, inner_y, x, inner_y + inner_h]
        bottom = [inner_x, y + h, inner_x + inner_w, y + h]
        right = [x + w, inner_y, x + w, inner_y + inner_h]
        [top, left, bottom, right].each do |start_x, start_y, end_x, end_y|
          draw_line(start_x, start_y, end_x, end_y, color,
                    {:line_width => line_width})
        end
      end

      upper_left = [x, y, 90]
      lower_left = [x, y + inner_h, 180]
      lower_right = [x + inner_w, y + inner_h, 270]
      upper_right = [x + inner_w, y, 0]
      [
       upper_left, lower_left,
       lower_right, upper_right
      ].each do |ax, ay, start_angle|
        draw_arc(filled, ax, ay, x_diameter, y_diameter,
                 start_angle, 90, color, {:line_width => line_width})
      end
    end

finish_renderer() click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 27
    def finish_renderer
      @gdk_drawables.pop
      @gdk_drawable = @gdk_drawables.pop
    end

foreground=(color) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 36
    def foreground=(color)
      @foreground.set_rgb_fg_color(color.to_gdk_color)
    end

init_renderer(drawable) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 23
    def init_renderer(drawable)
      prepare_renderer(drawable)
    end

prepare_renderer(drawable) click to toggle source

    # File lib/rabbit/renderer/engine/gdk.rb, line 17
    def prepare_renderer(drawable)
      @gdk_drawables ||= []
      @gdk_drawable = drawable
      @gdk_drawables.push(@gdk_drawable)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.