Seed FFI
August 2nd, 2009
I was bored yesterday and added a simple ffi to Seed…I imagine it might be useful for someone someday.
GObject = imports.GObject;
ffi = imports.ffi;
app = new ffi.Library(); // ffi.Library with no arguments is
//equivalent to g_module_open with
//NULL for filename.
sin = app.sin;
sin.signature = {arguments: [GObject.TYPE_DOUBLE], returns: GObject.TYPE_DOUBLE}
almostzero = sin (3.14);
More interestingly, I have a working computer again! (New 13 inch macbook pro). Hopefully I’ll be blogging and coding a little more often than the last month.
Making your library introspectable.
June 7th, 2009
David posted recently on his experiences adding introspection to GUdev (cool!), and this reminded me to bring up something which I think is very useful.
If you are a maintainer of a library, or an application which exposes an API (to plugins, etc…), please consider adding introspection to your build system! Essentially, what works in the various introspection based bindings, is what we’ve had an opportunity to test, and every new library shows a few new corner cases, finding these is very useful (this is why in the Seed source tree, there are a large number of examples, trying to get an idea of how well introspection works with various libraries).
If you are looking for an example of how to do this, Clutter is a very good one I think. Essentially you first need introspection.m4, and then GOBJECT_INTROSPECTION_CHECK([0.6.3]) in configure.ac. Then, to the appropriate Makefile.am, you need to add the actual calls to the scanner and the compiler. See libclutter’s Makefile.am (around line 248). In most cases it will actually be a little simpler than it is in Clutter.
If you’d like introspection in your library/app, also feel free to email me, and assuming it’s not a complicated case, I’m perfectly willing to cook up a quick patch, and test some things out.
UDS, Seed 0.8
May 27th, 2009
UDS
I’m at UDS this week, and it’s great as always, I’m really excited for Karmic as a release on the desktop front. I’m also looking forward to a session on packaging GObject-introspection stuff later today.
Barcelona seems to be a great city, though I’ve had a little trouble finding places for dinner, etc…I think this is mostly my fault. I’m completely exhausted, as always at UDS.
Seed 0.8 and WebKit upstream
I’m releasing Seed 0.8 later today, with all sorts of cool stuff (cairo bindings!). When looking back through commits to compile a ChangeLog, I was reminded of something that happened since the last release, that I thought might be worth bringing up. In the WebKit v. Mozilla debate, a lot of people have brought up the idea that somehow Mozilla will be a more responsive upstream to GNOME than WebKit (as WebKit is heavily funded by Apple). So, while writing the cairo bindings, I ran in to a bug in the JSCore API, and I mention in a commit message that this is “working around a WebKit bug”, and make a note to file a bug later. However, almost immediately, bdash pings me in #webkit, asking about the bug (someone is watching Seed commit messages I guess), I make a reduced test case, and it’s fixed upstream about 10 minutes later. WebKit upstream has been really friendly, both to me, and the WebKit/GTK+ developers (as mentioned by xan), and though Apple does have less of an interest in free software than Mozilla (though, it could be argued that Mozilla has almost no interest in Linux), there’s a lot of interest in supporting WebKit outside of their platform, and this is good for us.
Seed Logo
May 21st, 2009
I was playing with Algorithm Ink
and I accidentally made what I have decided should be the Seed logo.

It looks sort of like a seed, and is a metaphor for um…It looks sort of like a seed, and looks cool.
In other news, headed back to Troy today, and then Barcelona on Saturday for UDS. Need to find places to explore in Barcelona on Sunday.
Reference documentation in PDF
May 18th, 2009
Today out of (mostly) random curiosity, I wanted to investigate putting gtk-doc/docbook inside pretty PDFs. Googling around there are a lot of solutions, however none of them seem to work too well except dblatex, so for the benefit of anyone else in a similar situation, probably jump straight to this.
I’ve tried running it on a few different things, just to see what the output is like:
http://gnome.org/~racarr/glib-docs.pdf
http://gnome.org/~racarr/pango-docs.pdf
It’s already pretty good, and with a little custom styling (requires making a new LaTeX document class), it could be a lot better. However, I’m not sure how much effort I want to put in, as it’s only somewhat useful.
DBus, sandboxes, REPLs, Life
May 10th, 2009
This is probably going to read very fragmented…I’ve been coding all day and can’t really think right now.
DBus
So. first off, after spending all day porting code from the GJS module…
#!/usr/local/bin/seed
DBus = imports.dbus;
GLib = imports.gi.GLib;
function PlayerEngine() {
this._init();
}
PlayerEngine.prototype = {
_init: function() {
DBus.session.proxifyObject (this, 'org.bansheeproject.Banshee','/org/bansheeproject/Banshee/PlayerEngine');
}
};
var PlayerEngineIface = {
name: 'org.bansheeproject.Banshee.PlayerEngine',
methods: [{name:'Play', inSignature: ''},
{name:'Open', inSignature: 's'}],
};
DBus.proxifyPrototype (PlayerEngine.prototype, PlayerEngineIface);
proxy = new PlayerEngine();
proxy.OpenRemote(Seed.argv[2]);
proxy.PlayRemote(function(){
Seed.print("proxy.PlayRemote returned");
Seed.quit();
});
mainloop = GLib.main_loop_new();
GLib.main_loop_run(mainloop);
It’s pretty fun! Server side part is almost done also (and is really entirely trivial to use API wise…). Big thanks to everyone working on GJS, as a significant portion of the code between the GJS/Seed DBus bindings is shared (and the rest is modeled after the GJS bindings).
Sandboxes and REPLs
Seed also got a REPL with multiline input (like python)
> if (a == 3){
.. Seed.print("a is three!");
..}
It makes it a lot easier to mess around with things, and is just one of those things that seems kind of necessary to have. I also added a “sandbox” module to Seed, which lets you create a (very lightweight) context with a new global object, and you can control what you expose to it, and evaluate code in that context, it’s pretty neat because the default global object has more or less nothing exposed, so you can safely evaluate more or less anything.
Life
This is the obligatory life section of a blog post…I’m hope from RPI for a month, so right now I don’t have one. I do miss everyone though.
Random Updates
April 25th, 2009
Random Seed update.
Quite a few bugs have been fixed since the last Seed release, including some build system improvements, some memory improvements, a few consistency things with how things are mapped, updated examples, some big optimizations to the GObject subclassing code, and a few bugfixes in the new imports sytem.
For some reason this morning I woke up and wrote some documentation something describing how things are mapped when importing namespaces in Seed, as this is one of the most common questions I get. I think, someone who has already programmed with Gtk in C, etc…should be able to install Seed, read this, and then start coding in Seed.
In light of all this, I’m hoping to make a 0.5.5 release in the next week (or maybe delaying a bit if a GObject-introspection release is coming soon). I made a mistake releasing 0.5 depending on introspection from GIT.
I’m trying to use twitter lately, and it’s kind of fun, follow me!
Random Life update
School is almost over for the year, a little hard to imagine I am halfway done with undergrad…this is looking to be a great summer though.
Primarily I’m going to be staying in Troy, which should be really exciting, and living in an apartment by myself will be a new experience.
I’ll be in Barcelona for UDS Karmic (from around May 24-30th), really looking forward to this.
Also hoping to be able to go to Gran Canaria for the desktop summit…but this is still a little up in the air. If I do end up going I have to find a roommate. I’d kind of like to speak about Seed, but missed the deadline for registering to talk (not knowing if I was going to be able to go) and I hope if I do end up going I can work something out.
I’m going to have a lot of time to work on various GNOME things this summer, so maybe some of my old shelved projects will get finished
Hello world!
April 20th, 2009
Welcome to GNOME Blogs. If you are the owner of this brand new blog, you can start posting right now!
Seed documentation
April 17th, 2009
I just found out I have a public_html folder on gnome.org, so I took a little bit of time to update some of the Seed documentation and throw it online.
http://www.gnome.org/~racarr/seed/
Right now it’s just a somewhat outdated tutorial, some disorganized gtk-doc, and some documentation on the Seed builtins, but I think it’s a good start.
Before the next Seed release, I really want to take some time to write a lot more documentation, as I think Seed could be a good opportunity to introduce a lot of people to developing on top of the GNOME platform. I’d also like to put a lot of the examples online, but I have to think of the best way to do this.
Seed 0.5 Released
April 16th, 2009
Seed 0.5 release just hit (finally).
Tarballs are at
http://ftp.gnome.org/pub/GNOME/sources/seed/0.5/
Lots of cool stuff here, and everyone should definitely upgrade as soon as possible. There’s a ChangeLog and all sorts of propoganda on the appropriate mailing lists for interested parties.