rodrigo is currently certified at Master level.

Name: Rodrigo Moya
Member since: 2000-05-16 09:22:05
Last Login: 2008-06-26 12:06:00

FOAF RDF Share This

Homepage: http://rodrigo.gnome-db.org/

Projects

Recent blog entries by rodrigo

Syndication: RSS 2.0

GObservableCollection

In the last year working at Xamarin, I have learned lots of new things (.NET, Cocoa, …), and since the beginning of that, I was thinking on bringing some of that nice stuff to GNOME, but didn’t really had the chance to finish anything. But, fortunately, being free now (on vacation), I finally finished the 1st thing: GObservableCollection, a thread-safe collection implementation which emits signals on changes.

It is based on ideas from .NET’s ObservableCollection and concurrent collections, which I’ve used successfully for building a multi-thread data processing app (with one thread updating the collection and another consuming it), so I thought it would be a good addition to GLib’s API. This class can be used on single-threaded apps to easily get notifications for changes in a collection, and in multi-threaded ones for, as mentioned above, easily share data between different threads (as can be seen on the simple test I wrote).

This is the 1st working version, so for sure it will need improvements, but instead of keeping it private for a few more months, I thought it would be better getting some feedback before I submit it as a patch for GLib’s GIO (if that’s the best place for it, which I guess it is).

Syndicated 2014-12-16 19:25:24 from Rodrigo Moya

C#/Cocoa – Animate a split view’s collapsing/expanding

When I started working at Xamarin, I had the intention to blog about new technologies I was learning, but it’s been already 6 months and it didn’t happen at all, so better to start late than never. I’ll start then with a nice piece of code I came up with, and which is this:

public static class CocoaExtensions
{
	public static void AnimatedSetPositionOfDivider (this NSSplitView splitView, float position, int divider)
	{
		var view0 = splitView.Subviews [0];
		var view1 = splitView.Subviews [1];

		var newFrame0 = view0.Frame;
		var newFrame1 = view1.Frame;
		if (splitView.IsVertical) {
			newFrame0.Width = position == 0 ? 0 : position - splitView.DividerThickness;
			newFrame1.Width = position == splitView.MaxPositionOfDivider (divider)
				? 0
				: splitView.Bounds.Width - position - splitView.DividerThickness;
		} else {
			newFrame0.Height = position == 0 ? 0 : position - splitView.DividerThickness;
			newFrame1.Height = position == splitView.MaxPositionOfDivider (divider)
				? 0
				: splitView.Bounds.Height - position - splitView.DividerThickness;
		}

		newFrame0.Width = newFrame0.Width < 0 ? 0 : newFrame0.Width;
		newFrame0.Height = newFrame0.Height < 0 ? 0 : newFrame0.Height;
		newFrame1.Width = newFrame1.Width < 0 ? 0 : newFrame1.Width;
		newFrame1.Height = newFrame1.Height < 0 ? 0 : newFrame1.Height;

		view0.Hidden = view1.Hidden = false;
		view0.AutoresizesSubviews = view1.AutoresizesSubviews = true;

		if ((newFrame0.Width == 0 && newFrame0.Height == 0) ||
		    (newFrame1.Width == 0 && newFrame1.Height == 0)) {
			return;
		}

		var singleAnimation0 = new NSMutableDictionary ();
		singleAnimation0 [NSViewAnimation.TargetKey] = view0;
		singleAnimation0 [NSViewAnimation.EndFrameKey] = NSValue.FromRectangleF (newFrame0);

		var singleAnimation1 = new NSMutableDictionary ();
		singleAnimation1 [NSViewAnimation.TargetKey] = view1;
		singleAnimation1 [NSViewAnimation.EndFrameKey] = NSValue.FromRectangleF (newFrame1);

		var animation = new NSViewAnimation (new NSDictionary[] { singleAnimation0, singleAnimation1 });
		animation.Duration = 0.25f;
		animation.StartAnimation ();
	}
}

The main reason to share this code is because I couldn’t find anything that worked to do that (animate the collapsing and expanding of a NSSplitView, which is, yes, you got it right, a split view, like GTK’s GtkPaned), so I hope it is useful for someone. But it also shows a few interesting things about both C# and Cocoa:

  • The most obvious one: writing Cocoa apps in C# is much better than using Objective C (although, to be honest, I also like Objective C).
  • Cocoa (and CoreAnimation) lets you easily add animations to your UI, by having the animations layer tightly integrated into the API. Of course, animations are not always great, but in some cases, like this one where the collapsing/expansion of the split view’s subviews is animated, it makes such a huge difference to the UI that it’s very nice to be able to do it that easily.
  • C# allows extending existing classes, by writing extension methods (static methods in static classes that have a “this” modifier in the 1st argument, which specifies the class the method extends). This is a great way to extend existing classes, without having to do any subclassing. Once you have the extension method, you can just call it on any NSSplitView:
    mySplitView.AnimatedSetPositionOfDivider (position, divider);
    

    You can extend any class, and this what a lot of technologies (LINQ, Reactive Extensions, etc) in the .NET world use.

I started also, when I started working at Xamarin, getting some of the nice ideas from Cocoa and C# into GLib/GTK, so will publish that as soon as I get something useful from it. Hopefully it won’t be another 6 months :-D

And yes, Xamarin is hiring. If interested, drop me a mail, or just apply directly, as you wish.

Syndicated 2014-06-25 11:19:24 from Rodrigo Moya

Xamarin

After some well deserved relaxing time, I am glad to announce that, since last Tuesday, I am a happy member of the Xamarin crew, where I’ll be working on the awesome cross-platform development tools the company makes.

This is indeed a change from what I have been doing in the last years, as I will be focusing on platforms other than Linux, as has been the case for the last 15 years, but to be honest, and after thinking a lot about it during my “well deserved relaxing time”, this is something that I really needed to boost my career. Not working on other platforms, but moving out of my comfort zone and find something new and exciting to work on. And Xamarin really seems to be the perfect place for this: the company is full of ex-Ximianites (Ximian is, till now, the best company I have ever worked for), lead by great people and focused on making great development tools/APIs, which is something that I have always liked but haven’t had the chance to work on as much as I would have wanted.

Of course, this doesn’t mean I will stop caring/using/developing GNOME. On the contrary, I think, and based on what I have been working on during my vacation, this will help me in making a better contribution to the project, as a lot of things I have been/will be learning, I think, are great for making GNOME better. But will talk about all that in separate blog posts, as things progress.

Many thanks to my girlfriend Yolanda and my friend Ismael Olea, who were the ones to pinpoint what I needed, which was to look for some exciting new stuff, rather than only wanting to stay on my comfort zone, and to Miguel, for the great coding challenge he got me to do, which made me learn exciting stuff and convince me finally that Xamarin was the best place for me.

Syndicated 2014-01-10 15:07:58 from Rodrigo Moya

Farewell Collabora

Today has been my last day at Collabora, where I’ve spent the last 2 years having a great time and working on some very cool and some not that cool projects, but always with great people as teammates. On the cool projects front, AF_BUS wins. Even though it didn’t gain upstream acceptance, at least it opened the race to bring D-Bus into the kernel, which I think is a great thing (based on real numbers :-D ).

A big hug to all collaborans I’ve met in these 2 years!

Not sure yet what’s coming up next, but first thing I will do, for the first time in aeons, is to get a few weeks of well deserved relax, work on some personal stuff I haven’t had much time to work on lately, and have fun!

Syndicated 2013-11-08 16:04:03 from Rodrigo Moya

desktop-webapp-browser-extension

A few months ago I started work on a Google Chrome/ium extension for integrating Chrome apps into GNOME Shell. The idea is that, whenever you install a Chrome app, a .desktop file is created in ~/.local/share/applications, for them to show up as normal applications.

Also, for desktop shortcuts for “normal” web pages, since Chrome/ium uses the favicon from the pages, the icons look really ugly on GNOME Shell’s overview. So, this extension also tries to retrieve a higher resolution icon and uses it if found, and if not, retrieves a snapshot from the page and uses that as the icon, making it look much nicer in the overview.

So, nothing really magic, but discussing it with some team mates, I thought it could be helpful for other people, so hence this public announcement :-)

The code can be found here.

Next step, when I have time and find out how, is to submit this to the Google Chrome store, but for now, you can just build it and install the .crx file into your Chrome/ium.

Syndicated 2013-06-13 10:42:12 from Rodrigo Moya

60 older entries...

 

rodrigo certified others as follows:

  • rodrigo certified xose as Journeyer
  • rodrigo certified LotR as Master
  • rodrigo certified mjs as Master
  • rodrigo certified spong as Journeyer
  • rodrigo certified wichert as Master
  • rodrigo certified martin as Master
  • rodrigo certified alvaro as Journeyer
  • rodrigo certified bertrand as Master
  • rodrigo certified Telsa as Journeyer
  • rodrigo certified jamesh as Master
  • rodrigo certified miguel as Master
  • rodrigo certified timj as Master
  • rodrigo certified lauris as Journeyer
  • rodrigo certified tigert as Master
  • rodrigo certified mathieu as Master
  • rodrigo certified terral as Journeyer
  • rodrigo certified sopwith as Master
  • rodrigo certified tml as Master
  • rodrigo certified daniel as Master
  • rodrigo certified kmaraas as Journeyer
  • rodrigo certified federico as Master
  • rodrigo certified hp as Master
  • rodrigo certified ettore as Master
  • rodrigo certified rodrigo as Apprentice
  • rodrigo certified alan as Master
  • rodrigo certified chema as Journeyer
  • rodrigo certified ole as Journeyer
  • rodrigo certified cuenca as Master
  • rodrigo certified jpick as Master
  • rodrigo certified Uraeus as Journeyer
  • rodrigo certified jacob as Master
  • rodrigo certified juantomas as Journeyer
  • rodrigo certified rakholh as Journeyer
  • rodrigo certified cdwiegand as Journeyer
  • rodrigo certified toledo as Journeyer
  • rodrigo certified cactus as Journeyer
  • rodrigo certified notzed as Journeyer
  • rodrigo certified dwmw2 as Master
  • rodrigo certified DV as Master
  • rodrigo certified rms as Master
  • rodrigo certified dneighbors as Master
  • rodrigo certified listen as Journeyer
  • rodrigo certified Barbwired as Journeyer
  • rodrigo certified ben as Master
  • rodrigo certified dsevilla as Master
  • rodrigo certified olea as Master
  • rodrigo certified lxhispano as Master
  • rodrigo certified clahey as Master
  • rodrigo certified fejj as Master
  • rodrigo certified Jody as Master
  • rodrigo certified jpr as Master
  • rodrigo certified rodo as Master
  • rodrigo certified timur as Journeyer
  • rodrigo certified bit as Journeyer
  • rodrigo certified jjamor as Master
  • rodrigo certified alo as Journeyer
  • rodrigo certified gman as Master
  • rodrigo certified murrayc as Master
  • rodrigo certified hadess as Journeyer
  • rodrigo certified dsandras as Master
  • rodrigo certified csv as Journeyer

Others have certified rodrigo as follows:

  • rodrigo certified rodrigo as Apprentice
  • lauris certified rodrigo as Journeyer
  • alvaro certified rodrigo as Master
  • mathieu certified rodrigo as Journeyer
  • listen certified rodrigo as Journeyer
  • ole certified rodrigo as Master
  • Uraeus certified rodrigo as Journeyer
  • jpick certified rodrigo as Master
  • cuenca certified rodrigo as Journeyer
  • cdwiegand certified rodrigo as Journeyer
  • juantomas certified rodrigo as Master
  • toledo certified rodrigo as Journeyer
  • dneighbors certified rodrigo as Master
  • nixnut certified rodrigo as Journeyer
  • olea certified rodrigo as Master
  • dsevilla certified rodrigo as Master
  • lxhispano certified rodrigo as Master
  • fejj certified rodrigo as Journeyer
  • monk certified rodrigo as Journeyer
  • Jordi certified rodrigo as Journeyer
  • Barbwired certified rodrigo as Master
  • grex certified rodrigo as Master
  • Jody certified rodrigo as Journeyer
  • davefx certified rodrigo as Master
  • ViGueTo certified rodrigo as Master
  • ricardo certified rodrigo as Master
  • timur certified rodrigo as Master
  • fxn certified rodrigo as Journeyer
  • jjamor certified rodrigo as Master
  • pau certified rodrigo as Master
  • wacky certified rodrigo as Master
  • alo certified rodrigo as Master
  • murrayc certified rodrigo as Master
  • gman certified rodrigo as Master
  • hadess certified rodrigo as Master
  • dsandras certified rodrigo as Master
  • mhz certified rodrigo as Master
  • Fabian certified rodrigo as Master
  • jfs certified rodrigo as Journeyer
  • bit certified rodrigo as Master
  • apg certified rodrigo as Master
  • alejandro certified rodrigo as Master
  • ariya certified rodrigo as Master
  • acero certified rodrigo as Journeyer
  • gpoo certified rodrigo as Master
  • strider certified rodrigo as Master
  • pasky certified rodrigo as Master
  • tanis certified rodrigo as Master
  • xose certified rodrigo as Master
  • carlosgc certified rodrigo as Master
  • freax certified rodrigo as Master
  • pvanhoof certified rodrigo as Master
  • gicmo certified rodrigo as Master
  • behdad certified rodrigo as Master
  • roozbeh certified rodrigo as Master
  • iagorubio certified rodrigo as Master
  • lucasr certified rodrigo as Master
  • loopback certified rodrigo as Master
  • midal certified rodrigo as Master
  • jaime certified rodrigo as Master
  • badvogato certified rodrigo as Journeyer

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

X
Share this page