Improved shogi theme. Add shadows.
[kaya.git] / lib / ext / loader.rb
bloba9415c2480d8354622b75fe2893aa8031aa283cf
1 begin
2   require 'ext/extensions'
3 rescue LoadError => e
4   warn "ERROR: could not load extension library, some features may be missing"
5   warn e.message
6 end
8 $ext = $qApp.findChild(Qt::Object, "kaya extensions") if $qApp
9 fake = unless $ext
10   # install fake implementations of the extension functions
11   $ext = Qt::Object.new
12   class << $ext
13     def exp_blur(img, radius)
14     end
15   end
16   true
17 end
18 $ext.metaclass_eval do
19   define_method(:fake) { fake }
20 end
22 # conveniently install extension functions in the appropriate places
24 class Qt::Image
25   def exp_blur(radius)
26     $ext.exp_blur(self, radius)
27   end
28 end