Class: Cairo::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/gir_ffi-cairo/context.rb

Overview

Overrides for CairoContext (cairo_t)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(target) ⇒ Object



8
9
10
11
# File 'lib/gir_ffi-cairo/context.rb', line 8

def self.create(target)
  ptr = Lib.cairo_create target
  wrap ptr
end

Instance Method Details

#arc(xc, yc, radius, angle1, angle2) ⇒ Object



29
30
31
# File 'lib/gir_ffi-cairo/context.rb', line 29

def arc(xc, yc, radius, angle1, angle2)
  Lib.cairo_arc self, xc, yc, radius, angle1, angle2
end

#close_pathObject



21
22
23
# File 'lib/gir_ffi-cairo/context.rb', line 21

def close_path
  Lib.cairo_close_path self
end

#fillObject



33
34
35
# File 'lib/gir_ffi-cairo/context.rb', line 33

def fill
  Lib.cairo_fill self
end

#get_targetObject



41
42
43
44
# File 'lib/gir_ffi-cairo/context.rb', line 41

def get_target
  ptr = Lib.cairo_get_target self
  Surface.wrap ptr
end

#line_to(x, y) ⇒ Object



17
18
19
# File 'lib/gir_ffi-cairo/context.rb', line 17

def line_to(x, y)
  Lib.cairo_line_to self, x, y
end

#move_to(x, y) ⇒ Object



13
14
15
# File 'lib/gir_ffi-cairo/context.rb', line 13

def move_to(x, y)
  Lib.cairo_move_to self, x, y
end

#rectangle(x, y, width, height) ⇒ Object



25
26
27
# File 'lib/gir_ffi-cairo/context.rb', line 25

def rectangle(x, y, width, height)
  Lib.cairo_rectangle self, x, y, width, height
end

#restoreObject



54
55
56
# File 'lib/gir_ffi-cairo/context.rb', line 54

def restore
  Lib.cairo_restore self
end

#saveObject



50
51
52
# File 'lib/gir_ffi-cairo/context.rb', line 50

def save
  Lib.cairo_save self
end

#set_source_rgba(red, green, blue, alpha) ⇒ Object



46
47
48
# File 'lib/gir_ffi-cairo/context.rb', line 46

def set_source_rgba(red, green, blue, alpha)
  Lib.cairo_set_source_rgba self, red, green, blue, alpha
end

#show_pageObject



58
59
60
# File 'lib/gir_ffi-cairo/context.rb', line 58

def show_page
  Lib.cairo_show_page self
end

#strokeObject



37
38
39
# File 'lib/gir_ffi-cairo/context.rb', line 37

def stroke
  Lib.cairo_stroke self
end