#!/usr/local/bin/ruby
#
#
# ./filltest.rb

require "ClibPDF"

r1=0.3; r2 = 0.6
xorig = 1.5; yorig = 1.5
psize = 6.0


pdf = ClibPDF::PDF.open(0)
pdf.enableCompression(ClibPDF::YES)
pdf.init
pdf.pageInit(1, ClibPDF::PORTRAIT, ClibPDF::LETTER, ClibPDF::LETTER)
pdf.translate(0.0, 6.5)

xorig = 1.5
yorig = 1.5
pdf.setgrayStroke(0.0)
pdf.setrgbcolorFill(0.7, 0.7, 1.0)
pdf.arc(xorig, yorig, r1, 0.0, 360.0, 1); pdf.closepath()
pdf.arc(xorig, yorig, r2, 0.0, 360.0, 1); pdf.closepath()
pdf.fillAndStroke
pdf.setgrayFill(0.0)
pdf.pointer(xorig+r1, yorig, ClibPDF::PTR_UP, psize)
pdf.pointer(xorig-r1, yorig, ClibPDF::PTR_DOWN, psize)
pdf.pointer(xorig+r2, yorig, ClibPDF::PTR_UP, psize)
pdf.pointer(xorig-r2, yorig, ClibPDF::PTR_DOWN, psize)

xorig = 3.0
yorig = 1.5
pdf.setrgbcolorFill(0.7, 0.7, 1.0)
pdf.arc(xorig, yorig, r1, 360.0, 0.0, 1)
pdf.arc(xorig, yorig, r2, 0.0, 360.0, 1)
pdf.fillAndStroke
pdf.setgrayFill(0.0)
pdf.pointer(xorig+r1, yorig, ClibPDF::PTR_DOWN, psize)
pdf.pointer(xorig-r1, yorig, ClibPDF::PTR_UP, psize)
pdf.pointer(xorig+r2, yorig, ClibPDF::PTR_UP, psize)
pdf.pointer(xorig-r2, yorig, ClibPDF::PTR_DOWN, psize)

pdf.finalizeAll
pdf.savePDFmemoryStreamToFile("filltest.pdf")

pdf.close()
#pdf.launchPreview()
