[patch] Add hooks to create new fundamental types

Hi,

Attached patch adds the possibility to register new fundamental
gobject types
with the ruby gnome2 bindings. This is needed to be able to make
bindings for
gstreamer0.10.

For example usage please see [0]:
https://trac.luon.net/ruby-gstreamer0.10/file/trunk/ruby-gstreamer0.10/src/rbgstminiobject.c

Please comment,
Sjoerd

0: These are indeed working gstreamer 0.10 bindings, i’ll make a proper
announcement about them later.

On Sun, Apr 30, 2006 at 03:35:33PM +0200, Sjoerd S. wrote:

Hi,

Attached patch adds the possibility to register new fundamental gobject
types with the ruby gnome2 bindings. This is needed to be able to make
bindings for gstreamer0.10.

Attached is an updated patch. This add code to use conversion functions
registered with rbgobj_register_g2r_func and rbgobj_register_r2g_func
not only
if it was a boxed value, but also as a fullback for a normal value.

This makes it possible to register conversion functions for things like
GST_TYPE_FRACTION, which is obviously needed if you want to bind
gstreamer 0.10
:slight_smile:

Also the interdiff between this and the previous patch is attached.

Thanks,
Sjoerd

Hi,

Attached rbgstminiobject.c is wrong.
Don’t touch it, please :-).

On Thu, 4 May 2006 16:57:26 +0900
Masao M. [email protected] wrote:

Could you fix them?

  • In gst_miniobject_get_superclass, you shouldn’t use

.:% Masao M.[email protected]


Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Hi,

On Sun, 30 Apr 2006 15:35:33 +0200
[email protected] (Sjoerd S.) wrote:

Hi,

Attached patch adds the possibility to register new fundamental gobject types
with the ruby gnome2 bindings. This is needed to be able to make bindings for
gstreamer0.10.

For example usage please see [0]:
https://trac.luon.net/ruby-gstreamer0.10/file/trunk/ruby-gstreamer0.10/src/rbgstminiobject.c

Please comment,

Hmm. GstMiniObject … I don’t like it.

Anyway, your patch is nice.

I have some comments before I’ll apply it to CVS.
Could you fix them?

  • Merge rbgfundamental.h to rbgobject.h.
    I know why you separate it, but I don’t prefer many header files are
    installed to ruby-dir/site-ruby/1.8/i386-xxx/.
  • Rename fundamental_* functions’ prefix as extern functions.
    rbgobj_fundamental_, rbgfund_, rbgobj_fund_* are recommanded.
  • Added glib2.def above informations.
  • I prefer camel case as the structure name for extern symbols.
    So rename fundamental_type something like as RGFundamental.
  • A typo found: fundamental_intialize → fundamental_initialize

0: These are indeed working gstreamer 0.10 bindings, i’ll make a proper
announcement about them later.

Good job!

Could you tell me how can I download latest one?
I think it’s better to discuss with your newest ruby-gstreamer-0.10.

BTW, the comment below is for your rbgstminiobject.c.

  • Typo? Gst::Miniobject should be Gst::MiniObject.
  • In gst_miniobject_get_superclass, you shouldn’t use
    GLib::Instantiatable here. Because it has some methods
    (like #signal_foo) of GLib::Object which doesn’t have Gst::MiniObject.

Keep your great work :wink:

Regards,
Masao.

On Thu, May 04, 2006 at 04:57:26PM +0900, Masao M. wrote:

I have some comments before I’ll apply it to CVS.
Could you fix them?

No problem. I’ll try to send you a new patch in the beginning of next
week.

Could you tell me how can I download latest one?
I think it’s better to discuss with your newest ruby-gstreamer-0.10.

The full trac project page can be found at:
https://trac.luon.net/ruby-gstreamer0.10/

Which includes a browser for the svn repository among other things.

Anonymous access to the svn repository is available through:
http://svn.luon.net/svn/ruby-gstreamer0.10/

And if you don’t want/can’t use svn for some reason, then the svn
browser at
http://svn.luon.net makes it possible to download tarballs of the
current svn
repository.

BTW, the comment below is for your rbgstminiobject.c.

  • Typo? Gst::Miniobject should be Gst::MiniObject.
  • In gst_miniobject_get_superclass, you shouldn’t use
    GLib::Instantiatable here. Because it has some methods
    (like #signal_foo) of GLib::Object which doesn’t have Gst::MiniObject.

Right, will need a closer look to decide the right superclass in this
case.

Sjoerd

A lifetime isn’t nearly long enough to figure out what it’s all about.


Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

On Thu, May 04, 2006 at 04:57:26PM +0900, Masao M. wrote:

  • Rename fundamental_* functions’ prefix as extern functions.
    rbgobj_fundamental_, rbgfund_, rbgobj_fund_* are recommanded.
  • Added glib2.def above informations.
  • I prefer camel case as the structure name for extern symbols.
    So rename fundamental_type something like as RGFundamental.
  • A typo found: fundamental_intialize -> fundamental_initialize

Ok, i’ve done the following things:

  • Move things that should be public from rbgfundamental.h to
    rbgobject.h. And
    no longer install rbgfundamental.h. (public are just the function
    struct and
    G_DEF_FUNDAMENTAL)
  • Prefix all hook functions with rbgobj_fund instead of fundamental
  • Rename the rbgfundamental files to rbgobj_fundamental
  • Rename the function struct to RGFundamental
  • Add G_DEF_FUNDAMENTAL to glib2.def
  • Fix the intialize/initialize typo

If there are more things that need to be changes, please lemme know :slight_smile:

  • Typo? Gst::Miniobject should be Gst::MiniObject.

Fixed thanks!

  • In gst_miniobject_get_superclass, you shouldn’t use
    GLib::Instantiatable here. Because it has some methods
    (like #signal_foo) of GLib::Object which doesn’t have Gst::MiniObject.

Right, i’ve changed it so it’s just a subclass of the normal ruby Object
now.
With the addition of gtype and clone functions just lke
GLib::Instantiatable
has them. Thanks!

Sjoerd

Hi Sjoerd,

Thanks.

I’ll try your patch carefully.
But I’m so busy this weekday, so I’ll work it this weekend.

On Tue, 9 May 2006 12:51:16 +0200
[email protected] (Sjoerd S.) wrote:

installed to ruby-dir/site-ruby/1.8/i386-xxx/.
no longer install rbgfundamental.h. (public are just the function struct and

Sjoerd

In the next world, you’re on your own.

.:% Masao M.[email protected]


Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642