Skip to content

Instantly share code, notes, and snippets.

View tolmasky's full-sized avatar

Francisco Ryan Tolmasky I tolmasky

View GitHub Profile
NSRect rect = [self bounds];
CGRect bounds = CGRectInset(*(CGRect *)&rect, SHADOW_HORIZONTAL_INSET - 0.5, SHADOW_VERTICAL_INSET - 0.5);
NSShadow * shadow = [[NSShadow alloc] init];
[shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.5]];
[shadow setShadowOffset:NSMakeSize(0.0, -10.0)];
[shadow setShadowBlurRadius:100.0];
NSWindow * window = [[NSWindow alloc] initWithContentRect:NSMakeRect(100.0, 100.0, 300.0, 400.0) styleMask:NSTitledWindowMask | NSClosableWindowMask backing:NSBackingStoreBuffered defer:YES];
NSWindow * windowp = [[NSWindow alloc] initWithContentRect:NSMakeRect(100.0, 100.0, 500.0, 400.0) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
[windowp setContentView:[[View alloc] init]];
[window addChildWindow:windowp ordered:NSWindowBelow];
[windowp orderFront:self];
[window makeKeyAndOrderFront:self];
NSWindow * ontop = [[NSWindow alloc] initWithContentRect:NSMakeRect(100.0, 100.0, 300.0, 400.0) styleMask:NSTitledWindowMask | NSClosableWindowMask backing:NSBackingStoreBuffered defer:YES];
NSWindow * onback = [[NSWindow alloc] initWithContentRect:NSMakeRect(100.0, 100.0, 500.0, 400.0) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
[onback setContentView:[[View alloc] init]];
[ontop makeKeyAndOrderFront:self];
[ontop addChildWindow:onback ordered:NSWindowBelow];
[ontop setLevel:3];
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
CGRect bounds = CGRectInset(*(CGRect *)&aRect, OUTlINE_HORIZONTAL_INSET - 0.5, OUTlINE_VERTICAL_INSET - 0.5);
CGColorRef shadowColor = CGColorCreateGenericGray(0.0, 0.5);
CGContextSetShadowWithColor (context, CGSizeMake(0.0, -10.0), 30.0, shadowColor);
CGColorRelease(shadowColor);
CGColorRef fillColor = CGColorCreateGenericGray(1.0, 1.0);
CGColorRef strokeColor = CGColorCreateGenericGray(0.0, 0.2);
/*
* AppController.j
* takeTwo
*
* Created by Stefan Wallström on November 17, 2009.
* Copyright 2009, 280 North, Inc. All rights reserved.
*/
@import <Foundation/CPObject.j>
/*
By default, a JavaScript method name is produced by concatenating the
components of an ObjectiveC method name, replacing ':' with '_', and
escaping '_' and '$' with a leading '$', such that '_' becomes "$_" and
'$' becomes "$$". For example:
ObjectiveC name Default JavaScript name
moveTo:: moveTo__
moveTo_ moveTo$_
moveTo$_ moveTo$$$_
void renderSubtreeToImage(ImageBuffer* image, RenderObject* item)
{
ASSERT(item);
ASSERT(image);
ASSERT(image->context());
RenderObject::PaintInfo info(image->context(), IntRect(), PaintPhaseForeground, 0, 0, 0);
// FIXME: isSVGContainer returns true for RenderSVGViewportContainer, so if this is ever
// called with one of those, we will read from the wrong offset in an object due to a bad cast.
RenderSVGContainer* svgContainer = 0;
<dict>
<key>begin</key>
<string>\b(id)\s*(?=&lt;)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.type.js.objj</string>
</dict>
<dict>
<key>begin</key>
<string>(?&lt;=[=(:]|^|return)\s*(/)(?![/*+{}?])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.js</string>
</dict>
while (event = [NSApp nextEventMatchingMask:blah inMode:NSDefaultRunLoopMode])
{
while (event = [NSApp nextEventMatchingMask:blah inMode:NSEventTrackingRunLoopMode])
{
while (event = [NSApp nextEventMatchingMask:blah inMode:NSEventTrackingRunLoopMode])
{
performs;