|
From: cedlemo <ce...@gm...> - 2015-11-03 15:38:55
|
I have looked at /usr/share/gir-1.0/Gnm-1.12.gir
and it seems that there are some dependencies that are not already done:
Goffice
Gsf
On 03/11/2015 14:19, Michael Uplawski wrote:
> Hi again,
>
> With the example below, I get a name error, having replaced Vte against
> Gnm or Gnumeric.:
> “in `init': uninitialized constant Module::Loader (NameError)”
>
> If I use GObjectIntrospection::Loader.new(self), the error reads.
> -----------------
> /var/lib/gems/2.1.0/gems/gobject-introspection-3.0.7/lib/gobject-introspection/loader.rb:167:in
> `const_set': wrong constant name 3D_NAME (NameError)
> from
> /var/lib/gems/2.1.0/gems/gobject-introspection-3.0.7/lib/gobject-introspection/loader.rb:167:in
> `load_enum_value'
> (...)
> ----------------
>
> On Tue, Nov 03, 2015 at 12:05:44PM +0100, cedlemo wrote:
>> I think that the example I gave you is more simple and better to start with:
>>
>> https://github.com/ruby-gnome2/ruby-gnome2/blob/master/vte3/lib/vte3.rb
>>
>> Just change the Vte name with Gnumeric:
>>
>> require "gobject-introspection"
>> require "gtk3"
>>
>> base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
>> vendor_dir = base_dir + "vendor" + "local"
>> vendor_bin_dir = vendor_dir + "bin"
>> GLib.prepend_dll_path(vendor_bin_dir)
>> vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0"
>> GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
>>
>> # You don't nedd this
>> #require "vte3/loader"
>>
>> module Vte
>> LOG_DOMAIN = "Vte"
>> GLib::Log.set_log_domain(LOG_DOMAIN)
>>
>> class Error < StandardError
>> end
>>
>> class << self
>> def const_missing(name)
>> init
>> if const_defined?(name)
>> const_get(name)
>> else
>> super
>> end
>> end
>>
>> def init
>> class << self
>> remove_method(:init)
>> remove_method(:const_missing)
>> end
>> Gtk.init if Gtk.respond_to?(:init)
>> loader = Loader.new(self)
>> loader.load("Vte")
>> end
>> end
>> end
>>
>>
>> This is the most basic example.
>>
>> Regards.
>>
>> On 03/11/2015 11:10, Michael Uplawski wrote:
>>> Howdy.
>>>
>>> I have been a bit worried to put my question on the list, but your
>>> responses keep me interested in GObject-Introspection.
>>>
>>> On Tue, Nov 03, 2015 at 09:33:54AM +0000, jc...@gm... wrote:
>>>
>>>> Hi, like cedlemo I'm not much of an expert, but I have made a binding
>>>> for my own gobject-based library here:
>>>>
>>>> https://github.com/jcupitt/ruby-vips8
>>>>
>>>> I used the binding for gst as a model, it's pretty simple to understand:
>>>>
>>>> https://github.com/ruby-gnome2/ruby-gnome2/blob/master/gstreamer/lib/gst.rb
>>> You subclass a Loader and I have the immediate feeling, that this must
>>> be crucial for all that follows. I do not have to understand all the
>>> meta-programming which is anyway out of my reach to see clearer now.
>>>
>>> Thank you very much.
>>>
>>> Michael
>>>
>>>> Just copy-paste that and change the names to refer to the gnumeric
>>>> objects instead and it should work.
>>>>
>>>> The gst binding does some extra renaming and overriding to make the
>>>> interface pleasant to use, you probably won't need that, at least to
>>>> start with.
>>>>
>>>> John
>>>>
>>>> ------------------------------------------------------------------------------
>>>> _______________________________________________
>>>> ruby-gnome2-devel-en mailing list
>>>> rub...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en
>>>
>>> ------------------------------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>> ruby-gnome2-devel-en mailing list
>>> rub...@li...
>>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> ruby-gnome2-devel-en mailing list
>> rub...@li...
>> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> ruby-gnome2-devel-en mailing list
> rub...@li...
> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en
|