mjolnir-io/mjolnir-modules — pull request #12 by yozlet (2014-09-03 19:30:50+00:00)
Title: Added window:transform(topleft,size)

Windows shouldn't just flip into new places and sizes, as it makes it hard to follow which of several windows has gone where. The transition to a new size and location should be animated.

*(This one issue is the whole reason I got interested in mjolnir to begin with. No other OS X window manager seems to do this at all, which is a shame as transitions are a [fundamental part of the OS X Human Interface Guidelines](https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Animation.html).)*

So, say hello to **`window:transform(topleft,size)`** !

It slices, dices and is pulled together from probably-awful ObjC, because this is literally the most ObjC or Lua that I have ever written. (I spend most of my time in JS and Ruby at the moment.)

Usage example:
```lua
win = mjolnir.window.orderedwindows()[4];
xy = win:topleft();
xy.x = xy.x + 400;
wh = win:size();
wh.h = wh.h + 100;
win:transform(xy,wh);

win = mjolnir.window.focusedwindow();
xy = win:topleft();
xy.x = xy.x + 400;
wh = win:size();
wh.h = wh.h + 100;
win:transform(xy,wh);
```

The best thing about the above code is that, because the animation is non-blocking, it kicks off both transformations at the same time.

Things that are probably bad:
* the `#import "MJAnimation.m"` at the top of `window.m`, because I couldn't work out how else to expose the ObjC class symbols to the window code
* the way that `MJAnimation.setCurrentProgress` allocates and destroys a few things for every frame - those should probably be private properties
* lack of tests
* other things, probably