@STATIC1.0;p;14;SKAdjustment.jI;21;Foundation/CPObject.jI;20;Foundation/CPCoder.jI;19;AppKit/CGGeometry.jc;2072;


{var the_class = objj_allocateClassPair(CPObject, "SKLinearAdjustment"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_minimumValue"), new objj_ivar("_maximumValue"), new objj_ivar("_value"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("linearAdjustmentWithMinimumValue:maximumValue:"), function(self, _cmd, aMinimumPoint, aMaximumPoint)
{ with(self)
{
    return objj_msgSend(objj_msgSend(self, "alloc"), "initWithMinimumValue:maximumValue:", aMinimumPoint, aMaximumPoint);
}
});
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithMinimumValue:maximumValue:"), function(self, _cmd, aMinimumPoint, aMaximumPoint)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPObject") }, "init");

    if (self)
    {
        _minimumValue = CGPointMakeCopy(aMinimumPoint);
        _maximumValue = CGPointMakeCopy(aMaximumPoint);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("actualValueForProposedValue:"), function(self, _cmd, aValue)
{ with(self)
{
    return CGPointMake(MAX(MIN(aValue.x, _maximumValue.x), _minimumValue.x), MAX(MIN(aValue.y, _maximumValue.y), _minimumValue.y));
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}

{
var the_class = objj_getClass("SKLinearAdjustment")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKLinearAdjustment\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("copy"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(objj_msgSend(self, "class"), "linearAdjustmentWithMinimumValue:maximumValue:", _minimumValue, _maximumValue);
}
});
class_addMethods(the_class, instance_methods);
}

p;9;SKColor.jI;25;Foundation/CPDictionary.jI;21;Foundation/CPObject.jI;21;Foundation/CPString.jI;16;AppKit/CPColor.jc;44323;


SKColorAlphaAdjustmentName = "SKColorAlphaAdjustmentName";
SKColorAlphaModulationAdjustmentName = "SKColorAlphaModulationAdjustmentName";
SKColorAlphaOffsetAdjustmentName = "SKColorAlphaOffsetAdjustmentName";
SKColorBlueAdjustmentName = "SKColorBlueAdjustmentName";
SKColorBlueModulationAdjustmentName = "SKColorBlueModulationAdjustmentName";
SKColorBlueOffsetAdjustmentName = "SKColorBlueOffsetAdjustmentName";
SKColorComplementAdjustmentName = "SKColorComplementAdjustmentName";
SKColorGammaAdjustmentName = "SKColorGammaAdjustmentName";
SKColorGrayAdjustmentName = "SKColorGrayAdjustmentName";
SKColorGreenAdjustmentName = "SKColorGreenAdjustmentName";
SKColorGreenModulationAdjustmentName = "SKColorGreenModulationAdjustmentName";
SKColorGreenOffsetAdjustmentName = "SKColorGreenOffsetAdjustmentName";
SKColorHueAdjustmentName = "SKColorHueAdjustmentName";
SKColorHueModulationAdjustmentName = "SKColorHueModulationAdjustmentName";
SKColorHueOffsetAdjustmentName = "SKColorHueOffsetAdjustmentName";
SKColorInverseAdjustmentName = "SKColorInverseAdjustmentName";
SKColorInverseGammaAdjustmentName = "SKColorInverseGammaAdjustmentName";
SKColorLuminanceAdjustmentName = "SKColorLuminanceAdjustmentName";
SKColorLuminanceModulationAdjustmentName = "SKColorLuminanceModulationAdjustmentName";
SKColorLuminanceOffsetAdjustmentName = "SKColorLuminanceOffsetAdjustmentName";
SKColorRedAdjustmentName = "SKColorRedAdjustmentName";
SKColorRedModulationAdjustmentName = "SKColorRedModulationAdjustmentName";
SKColorRedOffsetAdjustmentName = "SKColorRedOffsetAdjustmentName";
SKColorSaturationAdjustmentName = "SKColorSaturationAdjustmentName";
SKColorSaturationModulationAdjustmentName = "SKColorSaturationModulationAdjustmentName";
SKColorSaturationOffsetAdjustmentName = "SKColorSaturationOffsetAdjustmentName";
SKColorShadeAdjustmentName = "SKColorShadeAdjustmentName";
SKColorTintAdjustmentName = "SKColorTintAdjustmentName";

var _CPColorWithRGBAComponent = function(aColor, aComponent, aValue, anAdjustment)
{
    var components = objj_msgSend(aColor, "components");

    if (anAdjustment == 0)
        components[aComponent] = aValue;
    else if (anAdjustment == 1)
        components[aComponent] *= aValue;
    else
        components[aComponent] += aValue;

    return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", components[0], components[1], components[2], components[3]);
}

{var the_class = objj_allocateClassPair(CPObject, "SKColor"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("colorWithPresetName:adjustments:"), function(self, _cmd, aPresetName, adjustments)
{ with(self)
{
    var color = objj_msgSend(objj_msgSend(SKPresetColor, "alloc"), "initWithName:", aPresetName);

    if (objj_msgSend(adjustments, "count"))
        return objj_msgSend(objj_msgSend(SKCachingAdjustedColor, "alloc"), "initWithColor:adjustments:", color, adjustments);

    return color;
}
});
class_methods[1] = new objj_method(sel_registerName("colorWithSchemeColorKey:adjustments:"), function(self, _cmd, aColorKey, adjustments)
{ with(self)
{
    var color = objj_msgSend(objj_msgSend(SKSchemeColor, "alloc"), "initWithColorKey:", aColorKey);

    if (objj_msgSend(adjustments, "count"))
        return objj_msgSend(objj_msgSend(SKAdjustedColor, "alloc"), "initWithColor:adjustments:", color, adjustments);

    return color;
}
});
class_methods[2] = new objj_method(sel_registerName("colorWithColor:adjustments:"), function(self, _cmd, aColor, adjustments)
{ with(self)
{
    var color = objj_msgSend(objj_msgSend(SKConcreteColor, "alloc"), "initWithColor:", aColor);

    if (objj_msgSend(adjustments, "count"))
        return objj_msgSend(objj_msgSend(SKCachingAdjustedColor, "alloc"), "initWithColor:adjustments:", color, adjustments);

    return color;
}
});
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("adjustments"), function(self, _cmd)
{ with(self)
{
    return nil;
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKColor, "SKAdjustedColor"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_color"), new objj_ivar("_adjustments"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithColor:adjustments:"), function(self, _cmd, aColor, adjustments)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKColor") }, "init");

    if (self)
    {
        _color = aColor;
        _adjustments = adjustments;
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("adjustments"), function(self, _cmd)
{ with(self)
{
    return _adjustments;
}
});
instance_methods[2] = new objj_method(sel_registerName("colorForSlideMaster:"), function(self, _cmd, aSlideMaster)
{ with(self)
{
    var color = objj_msgSend(_color, "colorForSlideMaster:", aSlideMaster),
        adjustmentName = nil,
        adjustmentNames = objj_msgSend(_adjustments, "keyEnumerator");

    while (adjustmentName = objj_msgSend(adjustmentNames, "nextObject"))
    {
        var value = objj_msgSend(_adjustments, "objectForKey:", adjustmentName);

        switch (adjustmentName)
        {
            case SKColorAlphaAdjustmentName: color = _CPColorWithRGBAComponent(color, 3, value, 0);
                                                        break;
            case SKColorAlphaModulationAdjustmentName: color = _CPColorWithRGBAComponent(color, 3, value, 1);
                                                        break;
            case SKColorAlphaOffsetAdjustmentName: color = _CPColorWithRGBAComponent(color, 3, value, 2);
                                                        break;
            case SKColorBlueAdjustmentName: color = _CPColorWithRGBAComponent(color, 2, value, 0);
                                                        break;
            case SKColorBlueModulationAdjustmentName: color = _CPColorWithRGBAComponent(color, 2, value, 1);
                                                        break;
            case SKColorBlueOffsetAdjustmentName: color = _CPColorWithRGBAComponent(color, 2, value, 2);
                                                        break;




            case SKColorGreenAdjustmentName: color = _CPColorWithRGBAComponent(color, 1, value, 0);
                                                        break;
            case SKColorGreenModulationAdjustmentName: color = _CPColorWithRGBAComponent(color, 1, value, 1);
                                                        break;
            case SKColorGreenOffsetAdjustmentName: color = _CPColorWithRGBAComponent(color, 1, value, 2);
                                                        break;



            case SKColorInverseAdjustmentName: var components = objj_msgSend(color, "components");
                                                        color = objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 1.0-components[0], 1.0-components[1], 1.0-components[2], components[3]);
                                                        break;




            case SKColorRedAdjustmentName: color = _CPColorWithRGBAComponent(color, 0, value, 0);
                                                        break;
            case SKColorRedModulationAdjustmentName: color = _CPColorWithRGBAComponent(color, 0, value, 1);
                                                        break;
            case SKColorRedOffsetAdjustmentName: color = _CPColorWithRGBAComponent(color, 0, value, 2);
                                                        break;





        }
    }

    return color;
}
});
class_addMethods(the_class, instance_methods);
}

{var the_class = objj_allocateClassPair(SKAdjustedColor, "SKCachingAdjustedColor"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_cachedColor"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("colorForSlideMaster:"), function(self, _cmd, aSlideMaster)
{ with(self)
{
    if (!_cachedColor)
        _cachedColor = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKAdjustedColor") }, "colorForSlideMaster:", aSlideMaster);

    return _cachedColor;
}
});
class_addMethods(the_class, instance_methods);
}

{var the_class = objj_allocateClassPair(SKColor, "SKConcreteColor"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_color"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithColor:"), function(self, _cmd, aColor)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKColor") }, "init");

    if (self)
        _color = aColor;

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("colorForSlideMaster:"), function(self, _cmd, aSlideMaster)
{ with(self)
{
    return _color;
}
});
class_addMethods(the_class, instance_methods);
}

var SKConcreteColorColorKey = "SKConcreteColorColorKey";

{
var the_class = objj_getClass("SKConcreteColor")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKConcreteColor\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKColor") }, "init");

    if (self)
        _color = objj_msgSend(aCoder, "decodeObjectForKey:", SKConcreteColorColorKey);

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSend(aCoder, "encodeObject:forKey:", _color, SKConcreteColorColorKey);
}
});
class_addMethods(the_class, instance_methods);
}



SKAliceBluePresetColorName = "SKAliceBluePresetColorName";
SKAntiqueWhitePresetColorName = "SKAntiqueWhitePresetColorName";
SKAquaPresetColorName = "SKAquaPresetColorName";
SKAquamarinePresetColorName = "SKAquamarinePresetColorName";
SKAzurePresetColorName = "SKAzurePresetColorName";
SKBeigePresetColorName = "SKBeigePresetColorName";
SKBisquePresetColorName = "SKBisquePresetColorName";
SKBlackPresetColorName = "SKBlackPresetColorName";
SKBlanchedAlmondPresetColorName = "SKBlanchedAlmondPresetColorName";
SKBluePresetColorName = "SKBluePresetColorName";
SKBlueVioletPresetColorName = "SKBlueVioletPresetColorName";
SKBrownPresetColorName = "SKBrownPresetColorName";
SKBurlyWoodPresetColorName = "SKBurlyWoodPresetColorName";
SKCadetBluePresetColorName = "SKCadetBluePresetColorName";
SKChartreusePresetColorName = "SKChartreusePresetColorName";
SKChocolatePresetColorName = "SKChocolatePresetColorName";
SKCoralPresetColorName = "SKCoralPresetColorName";
SKCornflowerBluePresetColorName = "SKCornflowerBluePresetColorName";
SKCornsilkPresetColorName = "SKCornsilkPresetColorName";
SKCrimsonPresetColorName = "SKCrimsonPresetColorName";
SKCyanPresetColorName = "SKCyanPresetColorName";
SKDeepPinkPresetColorName = "SKDeepPinkPresetColorName";
SKDeepSkyBluePresetColorName = "SKDeepSkyBluePresetColorName";
SKDimGrayPresetColorName = "SKDimGrayPresetColorName";
SKDarkBluePresetColorName = "SKDarkBluePresetColorName";
SKDarkCyanPresetColorName = "SKDarkCyanPresetColorName";
SKDarkGoldenrodPresetColorName = "SKDarkGoldenrodPresetColorName";
SKDarkGrayPresetColorName = "SKDarkGrayPresetColorName";
SKDarkGreenPresetColorName = "SKDarkGreenPresetColorName";
SKDarkKhakiPresetColorName = "SKDarkKhakiPresetColorName";
SKDarkMagentaPresetColorName = "SKDarkMagentaPresetColorName";
SKDarkOliveGreenPresetColorName = "SKDarkOliveGreenPresetColorName";
SKDarkOrangePresetColorName = "SKDarkOrangePresetColorName";
SKDarkOrchidPresetColorName = "SKDarkOrchidPresetColorName";
SKDarkRedPresetColorName = "SKDarkRedPresetColorName";
SKDarkSalmonPresetColorName = "SKDarkSalmonPresetColorName";
SKDarkSeaGreenPresetColorName = "SKDarkSeaGreenPresetColorName";
SKDarkSlateBluePresetColorName = "SKDarkSlateBluePresetColorName";
SKDarkSlateGrayPresetColorName = "SKDarkSlateGrayPresetColorName";
SKDarkTurquoisePresetColorName = "SKDarkTurquoisePresetColorName";
SKDarkVioletPresetColorName = "SKDarkVioletPresetColorName";
SKDodgerBluePresetColorName = "SKDodgerBluePresetColorName";
SKFirebrickPresetColorName = "SKFirebrickPresetColorName";
SKFloralWhitePresetColorName = "SKFloralWhitePresetColorName";
SKForestGreenPresetColorName = "SKForestGreenPresetColorName";
SKFuchsiaPresetColorName = "SKFuchsiaPresetColorName";
SKGainsboroPresetColorName = "SKGainsboroPresetColorName";
SKGhostWhitePresetColorName = "SKGhostWhitePresetColorName";
SKGoldPresetColorName = "SKGoldPresetColorName";
SKGoldenrodPresetColorName = "SKGoldenrodPresetColorName";
SKGrayPresetColorName = "SKGrayPresetColorName";
SKGreenPresetColorName = "SKGreenPresetColorName";
SKGreenYellowPresetColorName = "SKGreenYellowPresetColorName";
SKHoneydewPresetColorName = "SKHoneydewPresetColorName";
SKHotPinkPresetColorName = "SKHotPinkPresetColorName";
SKIndianRedPresetColorName = "SKIndianRedPresetColorName";
SKIndigoPresetColorName = "SKIndigoPresetColorName";
SKIvoryPresetColorName = "SKIvoryPresetColorName";
SKKhakiPresetColorName = "SKKhakiPresetColorName";
SKLavenderPresetColorName = "SKLavenderPresetColorName";
SKLavenderBlushPresetColorName = "SKLavenderBlushPresetColorName";
SKLawnGreenPresetColorName = "SKLawnGreenPresetColorName";
SKLemonChiffonPresetColorName = "SKLemonChiffonPresetColorName";
SKLimePresetColorName = "SKLimePresetColorName";
SKLimeGreenPresetColorName = "SKLimeGreenPresetColorName";
SKLinenPresetColorName = "SKLinenPresetColorName";
SKLightBluePresetColorName = "SKLightBluePresetColorName";
SKLightCoralPresetColorName = "SKLightCoralPresetColorName";
SKLightCyanPresetColorName = "SKLightCyanPresetColorName";
SKLightGoldenrodYellowPresetColorName = "SKLightGoldenrodYellowPresetColorName";
SKLightGrayPresetColorName = "SKLightGrayPresetColorName";
SKLightGreenPresetColorName = "SKLightGreenPresetColorName";
SKLightPinkPresetColorName = "SKLightPinkPresetColorName";
SKLightSalmonPresetColorName = "SKLightSalmonPresetColorName";
SKLightSeaGreenPresetColorName = "SKLightSeaGreenPresetColorName";
SKLightSkyBluePresetColorName = "SKLightSkyBluePresetColorName";
SKLightSlateGrayPresetColorName = "SKLightSlateGrayPresetColorName";
SKLightSteelBluePresetColorName = "SKLightSteelBluePresetColorName";
SKLightYellowPresetColorName = "SKLightYellowPresetColorName";
SKMagentaPresetColorName = "SKMagentaPresetColorName";
SKMaroonPresetColorName = "SKMaroonPresetColorName";
SKMediumAquamarinePresetColorName = "SKMediumAquamarinePresetColorName";
SKMediumBluePresetColorName = "SKMediumBluePresetColorName";
SKMediumOrchidPresetColorName = "SKMediumOrchidPresetColorName";
SKMediumPurplePresetColorName = "SKMediumPurplePresetColorName";
SKMediumSeaGreenPresetColorName = "SKMediumSeaGreenPresetColorName";
SKMediumSlateBluePresetColorName = "SKMediumSlateBluePresetColorName";
SKMediumSpringGreenPresetColorName = "SKMediumSpringGreenPresetColorName";
SKMediumTurquoisePresetColorName = "SKMediumTurquoisePresetColorName";
SKMediumVioletRedPresetColorName = "SKMediumVioletRedPresetColorName";
SKMidnightBluePresetColorName = "SKMidnightBluePresetColorName";
SKMintCreamPresetColorName = "SKMintCreamPresetColorName";
SKMistyRosePresetColorName = "SKMistyRosePresetColorName";
SKMoccasinPresetColorName = "SKMoccasinPresetColorName";
SKNavajoWhitePresetColorName = "SKNavajoWhitePresetColorName";
SKNavyPresetColorName = "SKNavyPresetColorName";
SKOldLacePresetColorName = "SKOldLacePresetColorName";
SKOlivePresetColorName = "SKOlivePresetColorName";
SKOliveDrabPresetColorName = "SKOliveDrabPresetColorName";
SKOrangePresetColorName = "SKOrangePresetColorName";
SKOrangeRedPresetColorName = "SKOrangeRedPresetColorName";
SKOrchidPresetColorName = "SKOrchidPresetColorName";
SKPaleGoldenrodPresetColorName = "SKPaleGoldenrodPresetColorName";
SKPaleGreenPresetColorName = "SKPaleGreenPresetColorName";
SKPaleTurquoisePresetColorName = "SKPaleTurquoisePresetColorName";
SKPaleVioletRedPresetColorName = "SKPaleVioletRedPresetColorName";
SKPapayaWhipPresetColorName = "SKPapayaWhipPresetColorName";
SKPeachPuffPresetColorName = "SKPeachPuffPresetColorName";
SKPeruPresetColorName = "SKPeruPresetColorName";
SKPinkPresetColorName = "SKPinkPresetColorName";
SKPlumPresetColorName = "SKPlumPresetColorName";
SKPowderBluePresetColorName = "SKPowderBluePresetColorName";
SKPurplePresetColorName = "SKPurplePresetColorName";
SKRedPresetColorName = "SKRedPresetColorName";
SKRosyBrownPresetColorName = "SKRosyBrownPresetColorName";
SKRoyalBluePresetColorName = "SKRoyalBluePresetColorName";
SKSaddleBrownPresetColorName = "SKSaddleBrownPresetColorName";
SKSalmonPresetColorName = "SKSalmonPresetColorName";
SKSandyBrownPresetColorName = "SKSandyBrownPresetColorName";
SKSeaGreenPresetColorName = "SKSeaGreenPresetColorName";
SKSeaShellPresetColorName = "SKSeaShellPresetColorName";
SKSiennaPresetColorName = "SKSiennaPresetColorName";
SKSilverPresetColorName = "SKSilverPresetColorName";
SKSkyBluePresetColorName = "SKSkyBluePresetColorName";
SKSlateBluePresetColorName = "SKSlateBluePresetColorName";
SKSlateGrayPresetColorName = "SKSlateGrayPresetColorName";
SKSnowPresetColorName = "SKSnowPresetColorName";
SKSpringGreenPresetColorName = "SKSpringGreenPresetColorName";
SKSteelBluePresetColorName = "SKSteelBluePresetColorName";
SKTanPresetColorName = "SKTanPresetColorName";
SKTealPresetColorName = "SKTealPresetColorName";
SKThistlePresetColorName = "SKThistlePresetColorName";
SKTomatoPresetColorName = "SKTomatoPresetColorName";
SKTurquoisePresetColorName = "SKTurquoisePresetColorName";
SKVioletPresetColorName = "SKVioletPresetColorName";
SKWheatPresetColorName = "SKWheatPresetColorName";
SKWhitePresetColorName = "SKWhitePresetColorName";
SKWhiteSmokePresetColorName = "SKWhiteSmokePresetColorName";
SKYellowPresetColorName = "SKYellowPresetColorName";
SKYellowGreenPresetColorName = "SKYellowGreenPresetColorName";

var SKPresetColors = nil;

{var the_class = objj_allocateClassPair(SKColor, "SKPresetColor"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_name"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithName:"), function(self, _cmd, aName)
{ with(self)
{
    if (!SKPresetColors)
        SKPresetColors = objj_msgSend(CPDictionary, "dictionary");

    else
    {
        var color = objj_msgSend(SKPresetColors, "objectForKey:", aName);

        if (color)
            return color;
    }

    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKColor") }, "init");

    if (self)
        _name = aName;

    objj_msgSend(SKPresetColors, "setObject:forKey:", self, aName);

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("colorForSlideMaster:"), function(self, _cmd, aSlideMaster)
{ with(self)
{
    switch (_name)
    {
        case SKAliceBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 240.0/255.0, 248.0/255.0, 255.0/255.0, 1.0);
        case SKAntiqueWhitePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 250.0/255.0, 235.0/255.0, 215.0/255.0, 1.0);
        case SKAquaPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 255.0/255.0, 255.0/255.0, 1.0);
        case SKAquamarinePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 127.0/255.0, 255.0/255.0, 212.0/255.0, 1.0);
        case SKAzurePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 240.0/255.0, 255.0/255.0, 255.0/255.0, 1.0);
        case SKBeigePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 245.0/255.0, 245.0/255.0, 220.0/255.0, 1.0);
        case SKBisquePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 228.0/255.0, 196.0/255.0, 1.0);
        case SKBlackPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 0.0/255.0, 0.0/255.0, 1.0);
        case SKBlanchedAlmondPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 235.0/255.0, 205.0/255.0, 1.0);
        case SKBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 0.0/255.0, 255.0/255.0, 1.0);
        case SKBlueVioletPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 138.0/255.0, 43.0/255.0, 226.0/255.0, 1.0);
        case SKBrownPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 165.0/255.0, 42.0/255.0, 42.0/255.0, 1.0);
        case SKBurlyWoodPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 222.0/255.0, 184.0/255.0, 135.0/255.0, 1.0);
        case SKCadetBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 95.0/255.0, 158.0/255.0, 160.0/255.0, 1.0);
        case SKChartreusePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 127.0/255.0, 255.0/255.0, 0.0/255.0, 1.0);
        case SKChocolatePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 210.0/255.0, 105.0/255.0, 30.0/255.0, 1.0);
        case SKCoralPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 127.0/255.0, 80.0/255.0, 1.0);
        case SKCornflowerBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 100.0/255.0, 149.0/255.0, 237.0/255.0, 1.0);
        case SKCornsilkPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 248.0/255.0, 220.0/255.0, 1.0);
        case SKCrimsonPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 220.0/255.0, 20.0/255.0, 60.0/255.0, 1.0);
        case SKCyanPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 255.0/255.0, 255.0/255.0, 1.0);
        case SKDeepPinkPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 20.0/255.0, 147.0/255.0, 1.0);
        case SKDeepSkyBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 191.0/255.0, 255.0/255.0, 1.0);
        case SKDimGrayPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 105.0/255.0, 105.0/255.0, 105.0/255.0, 1.0);
        case SKDarkBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 0.0/255.0, 139.0/255.0, 1.0);
        case SKDarkCyanPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 139.0/255.0, 139.0/255.0, 1.0);
        case SKDarkGoldenrodPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 184.0/255.0, 134.0/255.0, 11.0/255.0, 1.0);
        case SKDarkGrayPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 169.0/255.0, 169.0/255.0, 169.0/255.0, 1.0);
        case SKDarkGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 100.0/255.0, 0.0/255.0, 1.0);
        case SKDarkKhakiPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 189.0/255.0, 183.0/255.0, 107.0/255.0, 1.0);
        case SKDarkMagentaPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 139.0/255.0, 0.0/255.0, 139.0/255.0, 1.0);
        case SKDarkOliveGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 85.0/255.0, 107.0/255.0, 47.0/255.0, 1.0);
        case SKDarkOrangePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 140.0/255.0, 0.0/255.0, 1.0);
        case SKDarkOrchidPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 153.0/255.0, 50.0/255.0, 204.0/255.0, 1.0);
        case SKDarkRedPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 139.0/255.0, 0.0/255.0, 0.0/255.0, 1.0);
        case SKDarkSalmonPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 233.0/255.0, 150.0/255.0, 122.0/255.0, 1.0);
        case SKDarkSeaGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 143.0/255.0, 188.0/255.0, 139.0/255.0, 1.0);
        case SKDarkSlateBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 72.0/255.0, 61.0/255.0, 139.0/255.0, 1.0);
        case SKDarkSlateGrayPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 47.0/255.0, 79.0/255.0, 79.0/255.0, 1.0);
        case SKDarkTurquoisePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 206.0/255.0, 209.0/255.0, 1.0);
        case SKDarkVioletPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 148.0/255.0, 0.0/255.0, 211.0/255.0, 1.0);
        case SKDodgerBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 30.0/255.0, 144.0/255.0, 255.0/255.0, 1.0);
        case SKFirebrickPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 178.0/255.0, 34.0/255.0, 34.0/255.0, 1.0);
        case SKFloralWhitePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 250.0/255.0, 240.0/255.0, 1.0);
        case SKForestGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 34.0/255.0, 139.0/255.0, 34.0/255.0, 1.0);
        case SKFuchsiaPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 0.0/255.0, 255.0/255.0, 1.0);
        case SKGainsboroPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 220.0/255.0, 220.0/255.0, 220.0/255.0, 1.0);
        case SKGhostWhitePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 248.0/255.0, 248.0/255.0, 255.0/255.0, 1.0);
        case SKGoldPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 215.0/255.0, 0.0/255.0, 1.0);
        case SKGoldenrodPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 218.0/255.0, 165.0/255.0, 32.0/255.0, 1.0);
        case SKGrayPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 128.0/255.0, 128.0/255.0, 128.0/255.0, 1.0);
        case SKGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 128.0/255.0, 0.0/255.0, 1.0);
        case SKGreenYellowPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 173.0/255.0, 255.0/255.0, 47.0/255.0, 1.0);
        case SKHoneydewPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 240.0/255.0, 255.0/255.0, 240.0/255.0, 1.0);
        case SKHotPinkPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 105.0/255.0, 180.0/255.0, 1.0);
        case SKIndianRedPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 205.0/255.0, 92.0/255.0, 92.0/255.0, 1.0);
        case SKIndigoPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 75.0/255.0, 0.0/255.0, 130.0/255.0, 1.0);
        case SKIvoryPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 255.0/255.0, 240.0/255.0, 1.0);
        case SKKhakiPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 240.0/255.0, 230.0/255.0, 140.0/255.0, 1.0);
        case SKLavenderPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 230.0/255.0, 230.0/255.0, 250.0/255.0, 1.0);
        case SKLavenderBlushPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 240.0/255.0, 245.0/255.0, 1.0);
        case SKLawnGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 124.0/255.0, 252.0/255.0, 0.0/255.0, 1.0);
        case SKLemonChiffonPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 250.0/255.0, 205.0/255.0, 1.0);
        case SKLimePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 255.0/255.0, 0.0/255.0, 1.0);
        case SKLimeGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 50.0/255.0, 205.0/255.0, 50.0/255.0, 1.0);
        case SKLinenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 250.0/255.0, 240.0/255.0, 230.0/255.0, 1.0);
        case SKLightBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 173.0/255.0, 216.0/255.0, 230.0/255.0, 1.0);
        case SKLightCoralPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 240.0/255.0, 128.0/255.0, 128.0/255.0, 1.0);
        case SKLightCyanPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 224.0/255.0, 255.0/255.0, 255.0/255.0, 1.0);
        case SKLightGoldenrodYellowPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 250.0/255.0, 250.0/255.0, 120.0/255.0, 1.0);
        case SKLightGrayPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 211.0/255.0, 211.0/255.0, 211.0/255.0, 1.0);
        case SKLightGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 144.0/255.0, 238.0/255.0, 144.0/255.0, 1.0);
        case SKLightPinkPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 182.0/255.0, 193.0/255.0, 1.0);
        case SKLightSalmonPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 160.0/255.0, 122.0/255.0, 1.0);
        case SKLightSeaGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 32.0/255.0, 178.0/255.0, 170.0/255.0, 1.0);
        case SKLightSkyBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 135.0/255.0, 206.0/255.0, 250.0/255.0, 1.0);
        case SKLightSlateGrayPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 119.0/255.0, 136.0/255.0, 153.0/255.0, 1.0);
        case SKLightSteelBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 176.0/255.0, 196.0/255.0, 222.0/255.0, 1.0);
        case SKLightYellowPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 255.0/255.0, 224.0/255.0, 1.0);
        case SKMagentaPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 0.0/255.0, 255.0/255.0, 1.0);
        case SKMaroonPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 128.0/255.0, 0.0/255.0, 0.0/255.0, 1.0);
        case SKMediumAquamarinePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 102.0/255.0, 205.0/255.0, 170.0/255.0, 1.0);
        case SKMediumBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 0.0/255.0, 205.0/255.0, 1.0);
        case SKMediumOrchidPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 186.0/255.0, 85.0/255.0, 211.0/255.0, 1.0);
        case SKMediumPurplePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 147.0/255.0, 112.0/255.0, 219.0/255.0, 1.0);
        case SKMediumSeaGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 60.0/255.0, 179.0/255.0, 113.0/255.0, 1.0);
        case SKMediumSlateBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 123.0/255.0, 104.0/255.0, 238.0/255.0, 1.0);
        case SKMediumSpringGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 250.0/255.0, 154.0/255.0, 1.0);
        case SKMediumTurquoisePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 72.0/255.0, 209.0/255.0, 204.0/255.0, 1.0);
        case SKMediumVioletRedPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 199.0/255.0, 21.0/255.0, 133.0/255.0, 1.0);
        case SKMidnightBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 25.0/255.0, 25.0/255.0, 112.0/255.0, 1.0);
        case SKMintCreamPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 245.0/255.0, 255.0/255.0, 250.0/255.0, 1.0);
        case SKMistyRosePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 228.0/255.0, 225.0/255.0, 1.0);
        case SKMoccasinPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 228.0/255.0, 181.0/255.0, 1.0);
        case SKNavajoWhitePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 222.0/255.0, 173.0/255.0, 1.0);
        case SKNavyPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 0.0/255.0, 128.0/255.0, 1.0);
        case SKOldLacePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 253.0/255.0, 245.0/255.0, 230.0/255.0, 1.0);
        case SKOlivePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 128.0/255.0, 128.0/255.0, 0.0/255.0, 1.0);
        case SKOliveDrabPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 107.0/255.0, 142.0/255.0, 35.0/255.0, 1.0);
        case SKOrangePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 165.0/255.0, 0.0/255.0, 1.0);
        case SKOrangeRedPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 69.0/255.0, 0.0/255.0, 1.0);
        case SKOrchidPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 218.0/255.0, 112.0/255.0, 214.0/255.0, 1.0);
        case SKPaleGoldenrodPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 238.0/255.0, 232.0/255.0, 170.0/255.0, 1.0);
        case SKPaleGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 152.0/255.0, 251.0/255.0, 152.0/255.0, 1.0);
        case SKPaleTurquoisePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 175.0/255.0, 238.0/255.0, 238.0/255.0, 1.0);
        case SKPaleVioletRedPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 219.0/255.0, 112.0/255.0, 147.0/255.0, 1.0);
        case SKPapayaWhipPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 239.0/255.0, 213.0/255.0, 1.0);
        case SKPeachPuffPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 218.0/255.0, 185.0/255.0, 1.0);
        case SKPeruPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 205.0/255.0, 133.0/255.0, 63.0/255.0, 1.0);
        case SKPinkPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 192.0/255.0, 203.0/255.0, 1.0);
        case SKPlumPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 221.0/255.0, 160.0/255.0, 221.0/255.0, 1.0);
        case SKPowderBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 176.0/255.0, 224.0/255.0, 230.0/255.0, 1.0);
        case SKPurplePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 128.0/255.0, 0.0/255.0, 128.0/255.0, 1.0);
        case SKRedPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 0.0/255.0, 0.0/255.0, 1.0);
        case SKRosyBrownPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 188.0/255.0, 143.0/255.0, 143.0/255.0, 1.0);
        case SKRoyalBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 65.0/255.0, 105.0/255.0, 225.0/255.0, 1.0);
        case SKSaddleBrownPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 139.0/255.0, 69.0/255.0, 19.0/255.0, 1.0);
        case SKSalmonPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 250.0/255.0, 128.0/255.0, 114.0/255.0, 1.0);
        case SKSandyBrownPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 244.0/255.0, 164.0/255.0, 96.0/255.0, 1.0);
        case SKSeaGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 46.0/255.0, 139.0/255.0, 87.0/255.0, 1.0);
        case SKSeaShellPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 245.0/255.0, 238.0/255.0, 1.0);
        case SKSiennaPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 160.0/255.0, 82.0/255.0, 45.0/255.0, 1.0);
        case SKSilverPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 192.0/255.0, 192.0/255.0, 192.0/255.0, 1.0);
        case SKSkyBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 135.0/255.0, 206.0/255.0, 235.0/255.0, 1.0);
        case SKSlateBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 106.0/255.0, 90.0/255.0, 205.0/255.0, 1.0);
        case SKSlateGrayPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 112.0/255.0, 128.0/255.0, 144.0/255.0, 1.0);
        case SKSnowPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 250.0/255.0, 250.0/255.0, 1.0);
        case SKSpringGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 255.0/255.0, 127.0/255.0, 1.0);
        case SKSteelBluePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 70.0/255.0, 130.0/255.0, 180.0/255.0, 1.0);
        case SKTanPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 210.0/255.0, 180.0/255.0, 140.0/255.0, 1.0);
        case SKTealPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 0.0/255.0, 128.0/255.0, 128.0/255.0, 1.0);
        case SKThistlePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 216.0/255.0, 191.0/255.0, 216.0/255.0, 1.0);
        case SKTomatoPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 99.0/255.0, 71.0/255.0, 1.0);
        case SKTurquoisePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 64.0/255.0, 224.0/255.0, 208.0/255.0, 1.0);
        case SKVioletPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 238.0/255.0, 130.0/255.0, 238.0/255.0, 1.0);
        case SKWheatPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 245.0/255.0, 222.0/255.0, 179.0/255.0, 1.0);
        case SKWhitePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 255.0/255.0, 255.0/255.0, 1.0);
        case SKWhiteSmokePresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 245.0/255.0, 245.0/255.0, 245.0/255.0, 1.0);
        case SKYellowPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 255.0/255.0, 255.0/255.0, 0.0/255.0, 1.0);
        case SKYellowGreenPresetColorName: return objj_msgSend(CPColor, "colorWithCalibratedRed:green:blue:alpha:", 154.0/255.0, 205.0/255.0, 50.0/255.0, 1.0);
    }

    return nil;
}
});
class_addMethods(the_class, instance_methods);
}

var SKPresetColorNameKey = "SKPresetColorNameKey";

{
var the_class = objj_getClass("SKPresetColor")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKPresetColor\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKColor") }, "init");

    if (self)
        _name = objj_msgSend(aCoder, "decodeObjectForKey:", SKPresetColorNameKey);

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSend(aCoder, "encodeObject:forKey:", _name, SKPresetColorNameKey);
}
});
class_addMethods(the_class, instance_methods);
}

var SKSchemeColors = nil;

{var the_class = objj_allocateClassPair(SKColor, "SKSchemeColor"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_colorKey"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithColorKey:"), function(self, _cmd, aColorKey)
{ with(self)
{
    if (!SKSchemeColors)
        SKSchemeColors = objj_msgSend(CPDictionary, "dictionary");

    else
    {
        var color = objj_msgSend(SKSchemeColors, "objectForKey:", aColorKey);

        if (color)
            return color;
    }

    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKColor") }, "init");

    if (self)
        _colorKey = aColorKey;

    objj_msgSend(SKSchemeColors, "setObject:forKey:", self, aColorKey);

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("colorForSlideMaster:"), function(self, _cmd, aSlideMaster)
{ with(self)
{
    var colorKey = objj_msgSend(aSlideMaster, "colorKeyMappedByColorKey:", _colorKey);

    return objj_msgSend(objj_msgSend(objj_msgSend(aSlideMaster, "theme"), "schemeColorForKey:", colorKey), "colorForSlideMaster:", aSlideMaster);
}
});
class_addMethods(the_class, instance_methods);
}

p;12;SKEditable.jI;21;Foundation/CPObject.jI;25;Foundation/CPDictionary.jI;33;Foundation/CPNotificationCenter.jI;26;Foundation/CPUndoManager.jc;3011;


{var the_class = objj_allocateClassPair(CPObject, "SKEditable"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_undoManager"), new objj_ivar("_isEditing"), new objj_ivar("_didRegisterUndo"), new objj_ivar("_editingNotifications"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setUndoManager:"), function(self, _cmd, anUndoManager)
{ with(self)
{
    _undoManager = anUndoManager;
}
});
instance_methods[1] = new objj_method(sel_registerName("undoManager"), function(self, _cmd)
{ with(self)
{
    return _undoManager;
}
});
instance_methods[2] = new objj_method(sel_registerName("beginEditing"), function(self, _cmd)
{ with(self)
{
    _isEditing = YES;
    _didRegisterUndo = NO;

    _editingNotifications = objj_msgSend(CPDictionary, "dictionary");
}
});
instance_methods[3] = new objj_method(sel_registerName("endEditing"), function(self, _cmd)
{ with(self)
{
    var notification = nil,
        notifications = objj_msgSend(_editingNotifications, "objectEnumerator"),
        defaultCenter = objj_msgSend(CPNotificationCenter, "defaultCenter");

    while (notification = objj_msgSend(notifications, "nextObject"))
        objj_msgSend(defaultCenter, "postNotification:", notification);

    if (_didRegisterUndo)
        objj_msgSend(self, "registerEditingUndoWithSelector:object:", sel_registerName("beginEditing"), nil);

    _isEditing = NO;
}
});
instance_methods[4] = new objj_method(sel_registerName("isEditing"), function(self, _cmd)
{ with(self)
{
    return _isEditing;
}
});
instance_methods[5] = new objj_method(sel_registerName("registerEditingNotification:"), function(self, _cmd, aNotification)
{ with(self)
{
    if (!_isEditing)
        return;

    objj_msgSend(_editingNotifications, "setObject:forKey:", aNotification, objj_msgSend(aNotification, "name"));
}
});
instance_methods[6] = new objj_method(sel_registerName("registerEditingUndoWithSelector:object:"), function(self, _cmd, aSelector, anObject)
{ with(self)
{
    if (!_isEditing)
        return;

    if (!_didRegisterUndo)
    {
        objj_msgSend(_undoManager, "registerUndoWithTarget:selector:object:", self, sel_registerName("endEditing"), nil);

        _didRegisterUndo = YES;
    }

    objj_msgSend(_undoManager, "registerUndoWithTarget:selector:object:", self, aSelector, anObject);
}
});
instance_methods[7] = new objj_method(sel_registerName("prepareWithInvocationTarget:"), function(self, _cmd, aTarget)
{ with(self)
{
    if (!_isEditing)
        return nil;

    if (!_didRegisterUndo)
    {
        objj_msgSend(_undoManager, "registerUndoWithTarget:selector:object:", self, sel_registerName("endEditing"), nil);

        _didRegisterUndo = YES;
    }

    return objj_msgSend(_undoManager, "prepareWithInvocationTarget:", aTarget);
}
});
class_addMethods(the_class, instance_methods);
}

p;8;SKFill.jI;20;Foundation/CPCoder.jI;21;Foundation/CPObject.jI;21;Foundation/CPString.jI;16;AppKit/CPImage.ji;9;SKColor.jc;5990;


SKFillDidLoadNotification = "SKFillDidLoadNotification";

{var the_class = objj_allocateClassPair(CPObject, "SKFill"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("solidFillWithColor:"), function(self, _cmd, aColor)
{ with(self)
{
    return objj_msgSend(objj_msgSend(SKSolidFill, "alloc"), "initWithColor:", aColor);
}
});
class_methods[1] = new objj_method(sel_registerName("pictureFillWithImage:tile:"), function(self, _cmd, anImage, aTile)
{ with(self)
{
    return objj_msgSend(objj_msgSend(SKPictureFill, "alloc"), "initWithImage:tile:", anImage, aTile);
}
});
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("isLoaded"), function(self, _cmd)
{ with(self)
{
    return YES;
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKFill, "SKSolidFill"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_color"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithColor:"), function(self, _cmd, aColor)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKFill") }, "init");

    if (self)
        _color = aColor;

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("color"), function(self, _cmd)
{ with(self)
{
    return _color;
}
});
class_addMethods(the_class, instance_methods);
}

var SKSolidFillColorKey = "SKSolidFillColorKey";

{
var the_class = objj_getClass("SKSolidFill")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSolidFill\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKFill") }, "init");

    if (self)
        _color = objj_msgSend(aCoder, "decodeObjectForKey:", SKSolidFillColorKey);

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSend(aCoder, "encodeObject:forKey:", _color, SKSolidFillColorKey);
}
});
class_addMethods(the_class, instance_methods);
}

{var the_class = objj_allocateClassPair(SKFill, "SKPictureFill"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_image"), new objj_ivar("_tile"), new objj_ivar("_opacity"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithImage:tile:"), function(self, _cmd, anImage, aTile)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKFill") }, "init");

    if (self)
    {
        _image = anImage;
        _tile = aTile;

        if (objj_msgSend(_image, "loadStatus") != CPImageLoadStatusCompleted)
        {
            _image = objj_msgSend(objj_msgSend(CPImage, "alloc"), "initByReferencingFile:size:", objj_msgSend(_image, "filename"), CGSizeMakeCopy(objj_msgSend(_image, "size")));
            objj_msgSend(_image, "setDelegate:", self);
        }
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("isLoaded"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(_image, "loadStatus") == CPImageLoadStatusCompleted;
}
});
instance_methods[2] = new objj_method(sel_registerName("load"), function(self, _cmd)
{ with(self)
{
    if (objj_msgSend(_image, "loadStatus") == CPImageLoadStatusInitialized)
        objj_msgSend(_image, "load");
}
});
instance_methods[3] = new objj_method(sel_registerName("imageDidLoad:"), function(self, _cmd, anImage)
{ with(self)
{
    objj_msgSend(objj_msgSend(CPNotificationCenter, "defaultCenter"), "postNotificationName:object:", SKFillDidLoadNotification, self);
}
});
instance_methods[4] = new objj_method(sel_registerName("image"), function(self, _cmd)
{ with(self)
{
    return _image;
}
});
instance_methods[5] = new objj_method(sel_registerName("tile"), function(self, _cmd)
{ with(self)
{
    return _tile;
}
});
instance_methods[6] = new objj_method(sel_registerName("opacity"), function(self, _cmd)
{ with(self)
{
    return _opacity;
}
});
instance_methods[7] = new objj_method(sel_registerName("setOpacity:"), function(self, _cmd, anOpacity)
{ with(self)
{
    _opacity = anOpacity;
}
});
class_addMethods(the_class, instance_methods);
}

var SKPictureFillImageKey = "SKPictureFillImageKey",
    SKPictureFillTileKey = "SKPictureFillTileKey";

{
var the_class = objj_getClass("SKPictureFill")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKPictureFill\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    return objj_msgSend(self, "initWithImage:tile:", objj_msgSend(aCoder, "decodeObjectForKey:", SKPictureFillImageKey), objj_msgSend(aCoder, "decodeObjectForKey:", SKPictureFillTileKey));
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSend(aCoder, "encodeObject:forKey:", _image, SKPictureFillImageKey);
    objj_msgSend(aCoder, "encodeObject:forKey:", _tile, SKPictureFillTileKey);
}
});
class_addMethods(the_class, instance_methods);
}

p;15;SKFillDrawing.jI;18;AppKit/CGContext.ji;8;SKFill.jc;1587;


{
var the_class = objj_getClass("SKSolidFill")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSolidFill\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("fillPathInLayer:Context:"), function(self, _cmd, aLayer, aContext)
{ with(self)
{
    CGContextSetFillColor(aContext, objj_msgSend(objj_msgSend(self, "color"), "colorForSlideMaster:", objj_msgSend(aLayer, "slideMaster")));
    CGContextFillPath(aContext);
}
});
instance_methods[1] = new objj_method(sel_registerName("fillLayer:inContext:"), function(self, _cmd, aLayer, aContext)
{ with(self)
{
    CGContextSetFillColor(aContext, objj_msgSend(objj_msgSend(self, "color"), "colorForSlideMaster:", objj_msgSend(aLayer, "slideMaster")));
    CGContextFillRect(aContext, objj_msgSend(aLayer, "naturalBounds"));
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKPictureFill")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKPictureFill\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("fillLayer:inContext:"), function(self, _cmd, aLayer, aContext)
{ with(self)
{
    var bounds = objj_msgSend(aLayer, "naturalBounds");

    if (_tile)
    {
    }
    else
        CGContextDrawImage(aContext, bounds, _image);
}
});
class_addMethods(the_class, instance_methods);
}

p;12;SKGeometry.jI;21;Foundation/CPObject.jI;25;Foundation/CPDictionary.jI;21;Foundation/CPString.jI;19;AppKit/CGGeometry.ji;14;SKAdjustment.jc;7087;


SKRectangleGeometryName = "SKRectangleGeometryName";
SKOvalGeometryName = "SKOvalGeometryName";
SKTriangleGeometryName = "SKTriangleGeometryName";
SKRightTriangleGeometryName = "SKRightTriangleGeometryName";
SKPentagonGeometryName = "SKPentagonGeometryName";
SKStarGeometryName = "SKStarGeometryName";
SKBlockArrowGeometryName = "SKBlockArrowGeometryName";
SKBlockDoubleArrowGeometryName = "SKBlockDoubleArrowGeometryName";

var SKGeometriesForNames = nil;

{var the_class = objj_allocateClassPair(CPObject, "SKGeometry"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("initialize"), function(self, _cmd)
{ with(self)
{
    if (self != objj_msgSend(SKGeometry, "class"))
        return;

    SKGeometriesForNames = objj_msgSend(CPDictionary, "dictionary");
}
});
class_methods[1] = new objj_method(sel_registerName("setGeometry:forName:"), function(self, _cmd, aGeometry, aName)
{ with(self)
{
    objj_msgSend(SKGeometriesForNames, "setObject:forKey:", aGeometry, aName);
}
});
class_methods[2] = new objj_method(sel_registerName("geometryForName:"), function(self, _cmd, aName)
{ with(self)
{
    return objj_msgSend(SKGeometriesForNames, "objectForKey:", aName);
}
});
class_methods[3] = new objj_method(sel_registerName("geometryNames"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(SKGeometriesForNames, "allKeys");
}
});
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("adjustments"), function(self, _cmd)
{ with(self)
{
    return nil;
}
});
instance_methods[1] = new objj_method(sel_registerName("defaultAdjustmentValues"), function(self, _cmd)
{ with(self)
{
    return nil;
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKGeometry, "SKRectangleGeometry"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
}

SKTriangleAdjustment = "SKTriangleAdjustment";

{var the_class = objj_allocateClassPair(SKGeometry, "SKTriangleGeometry"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("adjustments"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(CPDictionary, "dictionaryWithObject:forKey:", objj_msgSend(SKLinearAdjustment, "linearAdjustmentWithMinimumValue:maximumValue:", CGPointMake(0.0,0.0), CGPointMake(1.0,0.0)), SKTriangleAdjustment);
}
});
instance_methods[1] = new objj_method(sel_registerName("defaultAdjustmentValues"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(CPDictionary, "dictionaryWithObject:forKey:", CGPointMake(0.5,0.0), SKTriangleAdjustment);
}
});
class_addMethods(the_class, instance_methods);
}

{var the_class = objj_allocateClassPair(SKGeometry, "SKRightTriangleGeometry"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
}

{var the_class = objj_allocateClassPair(SKGeometry, "SKOvalGeometry"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
}

{var the_class = objj_allocateClassPair(SKGeometry, "SKPentagonGeometry"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
}

{var the_class = objj_allocateClassPair(SKGeometry, "SKStarGeometry"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
}

SKBlockArrowAdjustment = "SKBlockArrowAdjustment";

{var the_class = objj_allocateClassPair(SKGeometry, "SKBlockArrowGeometry"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("adjustments"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(CPDictionary, "dictionaryWithObject:forKey:", objj_msgSend(SKLinearAdjustment, "linearAdjustmentWithMinimumValue:maximumValue:", CGPointMake(0.0,0.0), CGPointMake(1.0,0.5)), SKBlockArrowAdjustment);
}
});
instance_methods[1] = new objj_method(sel_registerName("defaultAdjustmentValues"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(CPDictionary, "dictionaryWithObject:forKey:", CGPointMake(0.7,0.3), SKBlockArrowAdjustment);
}
});
class_addMethods(the_class, instance_methods);
}

SKBlockDoubleArrowAdjustment = "SKBlockDoubleArrowAdjustment";

{var the_class = objj_allocateClassPair(SKGeometry, "SKBlockDoubleArrowGeometry"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("adjustments"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(CPDictionary, "dictionaryWithObject:forKey:", objj_msgSend(SKLinearAdjustment, "linearAdjustmentWithMinimumValue:maximumValue:", CGPointMake(0.0,0.0), CGPointMake(0.5,0.5)), SKBlockDoubleArrowAdjustment);
}
});
instance_methods[1] = new objj_method(sel_registerName("defaultAdjustmentValues"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(CPDictionary, "dictionaryWithObject:forKey:", CGPointMake(0.3,0.3), SKBlockDoubleArrowAdjustment);
}
});
class_addMethods(the_class, instance_methods);
}

objj_msgSend(SKGeometry, "setGeometry:forName:", objj_msgSend(objj_msgSend(SKRectangleGeometry, "alloc"), "init"), SKRectangleGeometryName);
objj_msgSend(SKGeometry, "setGeometry:forName:", objj_msgSend(objj_msgSend(SKOvalGeometry, "alloc"), "init"), SKOvalGeometryName);
objj_msgSend(SKGeometry, "setGeometry:forName:", objj_msgSend(objj_msgSend(SKTriangleGeometry, "alloc"), "init"), SKTriangleGeometryName);
objj_msgSend(SKGeometry, "setGeometry:forName:", objj_msgSend(objj_msgSend(SKRightTriangleGeometry, "alloc"), "init"), SKRightTriangleGeometryName);
objj_msgSend(SKGeometry, "setGeometry:forName:", objj_msgSend(objj_msgSend(SKPentagonGeometry, "alloc"), "init"), SKPentagonGeometryName);
objj_msgSend(SKGeometry, "setGeometry:forName:", objj_msgSend(objj_msgSend(SKStarGeometry, "alloc"), "init"), SKStarGeometryName);
objj_msgSend(SKGeometry, "setGeometry:forName:", objj_msgSend(objj_msgSend(SKBlockArrowGeometry, "alloc"), "init"), SKBlockArrowGeometryName);
objj_msgSend(SKGeometry, "setGeometry:forName:", objj_msgSend(objj_msgSend(SKBlockDoubleArrowGeometry, "alloc"), "init"), SKBlockDoubleArrowGeometryName);

p;19;SKGeometryDrawing.jI;16;AppKit/CALayer.jI;18;AppKit/CGContext.jI;19;AppKit/CGGeometry.ji;12;SKGeometry.jc;8264;


{
var the_class = objj_getClass("SKRectangleGeometry")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKRectangleGeometry\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setPathForContext:bounds:adjustments:"), function(self, _cmd, aContext, bounds, adjustments)
{ with(self)
{
    CGContextBeginPath(aContext);
    CGContextAddRect(aContext, bounds);
    CGContextClosePath(aContext);
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKOvalGeometry")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKOvalGeometry\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setPathForContext:bounds:adjustments:"), function(self, _cmd, aContext, bounds, adjustments)
{ with(self)
{
    CGContextAddEllipseInRect(aContext, bounds);
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKTriangleGeometry")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKTriangleGeometry\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setPathForContext:bounds:adjustments:"), function(self, _cmd, aContext, bounds, adjustments)
{ with(self)
{
    var adjustment = objj_msgSend(adjustments, "objectForKey:", SKTriangleAdjustment);

 CGContextBeginPath(aContext);

 CGContextMoveToPoint(aContext, CGRectGetMaxX(bounds), CGRectGetMaxY(bounds));
 CGContextAddLineToPoint(aContext, CGRectGetMinX(bounds), CGRectGetMaxY(bounds));
 CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * adjustment.x, 0.0);

 CGContextClosePath(aContext);
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKRightTriangleGeometry")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKRightTriangleGeometry\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setPathForContext:bounds:adjustments:"), function(self, _cmd, aContext, bounds, adjustments)
{ with(self)
{
 CGContextBeginPath(aContext);

 CGContextMoveToPoint(aContext, CGRectGetMaxX(bounds), CGRectGetMaxY(bounds));
 CGContextAddLineToPoint(aContext, CGRectGetMinX(bounds), CGRectGetMaxY(bounds));
 CGContextAddLineToPoint(aContext, CGRectGetMinX(bounds), CGRectGetMinY(bounds));

 CGContextClosePath(aContext);
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKPentagonGeometry")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKPentagonGeometry\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setPathForContext:bounds:adjustments:"), function(self, _cmd, aContext, bounds, adjustments)
{ with(self)
{
    var halfWidth = CGRectGetWidth(bounds) / 2.0,
        halfHeight = CGRectGetHeight(bounds) / 2.0;

 CGContextBeginPath(aContext);

    var index = 0,
        points = 5.0;

 for (; index < points; ++index)
 {
    var percent = index / points,
        x = (SIN(percent * PI2 + PI) + 1.0) * halfWidth,
        y = (COS(percent * PI2 + PI) + 1.0) * halfHeight;

  if (index == 0)
   CGContextMoveToPoint(aContext, x, y);
  else
   CGContextAddLineToPoint(aContext, x, y);
 }

 CGContextClosePath(aContext);
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKStarGeometry")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKStarGeometry\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setPathForContext:bounds:adjustments:"), function(self, _cmd, aContext, bounds, adjustments)
{ with(self)
{
    var halfWidth = CGRectGetWidth(bounds) / 2.0,
        halfHeight = CGRectGetHeight(bounds) / 2.0;

 CGContextBeginPath(aContext);

    var index = 0,
        points = 5,
        star_percent = 0.5;

 for (; index < points; ++index)
    {
        var percent = index / points,
            x = (SIN(percent * PI2 + PI) + 1.0) * halfWidth,
            y = (COS(percent * PI2 + PI) + 1.0) * halfHeight;

  if (index == 0)
   CGContextMoveToPoint(aContext, x, y);
  else
   CGContextAddLineToPoint(aContext, x, y);

        var percent = (index + 0.5) / points,
            x = SIN(percent * PI2 + PI) * (halfWidth * star_percent) + halfWidth,
            y = COS(percent * PI2 + PI) * (halfHeight * star_percent) + halfHeight;

  CGContextAddLineToPoint(aContext, x, y);
 }

 CGContextClosePath(aContext);
 CGContextFillPath(aContext);
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKBlockArrowGeometry")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKBlockArrowGeometry\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setPathForContext:bounds:adjustments:"), function(self, _cmd, aContext, bounds, adjustments)
{ with(self)
{
    var point = objj_msgSend(adjustments, "objectForKey:", SKBlockArrowAdjustment);

    CGContextMoveToPoint(aContext, CGRectGetMinX(bounds), CGRectGetHeight(bounds) * point.y);

    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * point.x, CGRectGetHeight(bounds) * point.y);
    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * point.x, CGRectGetMinY(bounds));

    CGContextAddLineToPoint(aContext, CGRectGetMaxX(bounds), CGRectGetMidY(bounds));
    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * point.x, CGRectGetMaxY(bounds));

    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * point.x, CGRectGetHeight(bounds) * (1 - point.y));
    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * point.x, CGRectGetHeight(bounds) * (1 - point.y));

    CGContextAddLineToPoint(aContext, CGRectGetMinX(bounds), CGRectGetHeight(bounds) * (1 - point.y));

    CGContextClosePath(aContext);
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKBlockDoubleArrowGeometry")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKBlockDoubleArrowGeometry\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setPathForContext:bounds:adjustments:"), function(self, _cmd, aContext, bounds, adjustments)
{ with(self)
{
    var point = objj_msgSend(adjustments, "objectForKey:", SKBlockDoubleArrowAdjustment);

    CGContextMoveToPoint(aContext, CGRectGetMinX(bounds), CGRectGetMidY(bounds));

    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * point.x, CGRectGetMinY(bounds));
    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * point.x, CGRectGetHeight(bounds) * point.y);

    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * (1 - point.x), CGRectGetHeight(bounds) * point.y);
    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * (1 - point.x), CGRectGetMinY(bounds));

    CGContextAddLineToPoint(aContext, CGRectGetMaxX(bounds), CGRectGetMidY(bounds));
    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * (1 - point.x), CGRectGetMaxY(bounds));

    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * (1 - point.x), CGRectGetHeight(bounds) * (1 - point.y));
    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * point.x, CGRectGetHeight(bounds) * (1 - point.y));

    CGContextAddLineToPoint(aContext, CGRectGetWidth(bounds) * point.x, CGRectGetMaxY(bounds));

    CGContextClosePath(aContext);
}
});
class_addMethods(the_class, instance_methods);
}

p;9;SKMovie.jI;21;Foundation/CPString.ji;9;SKShape.jc;3224;


{var the_class = objj_allocateClassPair(SKShape, "SKMovie"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_movieURL"), new objj_ivar("_smallThumbnailURL"), new objj_ivar("_largeThumbnailURL"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKShape") }, "init");

    if (self)
        _locks = SKShapeLocksNoChangeAspect;

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("setMovieURL:"), function(self, _cmd, aMovieURL)
{ with(self)
{
    _movieURL = aMovieURL;
}
});
instance_methods[2] = new objj_method(sel_registerName("movieURL"), function(self, _cmd)
{ with(self)
{
    return _movieURL;
}
});
instance_methods[3] = new objj_method(sel_registerName("setSmallThumbnailURL:"), function(self, _cmd, aSmallThumbnailURL)
{ with(self)
{
    _smallThumbnailURL = aSmallThumbnailURL;
}
});
instance_methods[4] = new objj_method(sel_registerName("smallThumbnailURL"), function(self, _cmd)
{ with(self)
{
    return _smallThumbnailURL;
}
});
instance_methods[5] = new objj_method(sel_registerName("setLargeThumbnailURL:"), function(self, _cmd, aLargeThumbnailURL)
{ with(self)
{
    _largeThumbnailURL = aLargeThumbnailURL;
}
});
instance_methods[6] = new objj_method(sel_registerName("largeThumbnailURL"), function(self, _cmd)
{ with(self)
{
    return _largeThumbnailURL;
}
});
class_addMethods(the_class, instance_methods);
}

var SKMovieMovieURL = "SKMovieMovieURL",
    SKMovieSmallThumbnailURL = "SKMovieSmallThumbnailURL",
    SKMovieLargeThumbnailURL = "SKMovieLargeThumbnailURL";

{
var the_class = objj_getClass("SKMovie")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKMovie\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKShape") }, "initWithCoder:", aCoder);

    if (self)
    {
        _movieURL = objj_msgSend(aCoder, "decodeObjectForKey:", SKMovieMovieURL);
        _smallThumbnailURL = objj_msgSend(aCoder, "decodeObjectForKey:", SKMovieSmallThumbnailURL);
        _largeThumbnailURL = objj_msgSend(aCoder, "decodeObjectForKey:", SKMovieLargeThumbnailURL);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKShape") }, "encodeWithCoder:", aCoder);

    objj_msgSend(aCoder, "encodeObject:forKey:", _movieURL, SKMovieMovieURL);
    objj_msgSend(aCoder, "encodeObject:forKey:", _smallThumbnailURL, SKMovieSmallThumbnailURL);
    objj_msgSend(aCoder, "encodeObject:forKey:", _largeThumbnailURL, SKMovieLargeThumbnailURL);
}
});
class_addMethods(the_class, instance_methods);
}

p;14;SKMovieLayer.jI;16;AppKit/CALayer.jI;21;AppKit/CAFlashLayer.jI;21;AppKit/CPFlashMovie.ji;9;SKMovie.ji;14;SKShapeLayer.jc;3502;


{var the_class = objj_allocateClassPair(SKShapeLayer, "SKMovieLayer"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_flashLayer"), new objj_ivar("_image"), new objj_ivar("_displaysAsThumbnail"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setDisplaysAsThumbnail:"), function(self, _cmd, shouldDisplayAsThumbnail)
{ with(self)
{
    if (_displaysAsThumbnail == shouldDisplayAsThumbnail)
        return;

    _displaysAsThumbnail = shouldDisplayAsThumbnail;

    if (_displaysAsThumbnail)
    {
        objj_msgSend(_flashLayer, "removeFromSuperlayer");

        _flashLayer = nil;
    }
    else
    {
        objj_msgSend(self, "_createFlashLayerIfNecessary");

        var movie = objj_msgSend(self, "shape");

        if (movie)
            objj_msgSend(_flashLayer, "setFlashMovie:", objj_msgSend(CPFlashMovie, "flashMovieWithFile:", objj_msgSend(movie, "movieURL")));

    }
}
});
instance_methods[1] = new objj_method(sel_registerName("displaysAsThumbnail"), function(self, _cmd)
{ with(self)
{
    return _displaysAsThumbnail;
}
});
instance_methods[2] = new objj_method(sel_registerName("_createFlashLayerIfNecessary"), function(self, _cmd)
{ with(self)
{
    if (_flashLayer)
        return;

    _flashLayer = objj_msgSend(CAFlashLayer, "layer");

    objj_msgSend(_flashLayer, "setAnchorPoint:", CGPointMake(0.0,0.0));
    objj_msgSend(_flashLayer, "setPosition:", CGPointMake(0.0,0.0));
    objj_msgSend(_flashLayer, "setBounds:", CGRectCreateCopy(objj_msgSend(self, "bounds")));

    objj_msgSend(self, "addSublayer:", _flashLayer);
}
});
instance_methods[3] = new objj_method(sel_registerName("setShape:"), function(self, _cmd, aMovie)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKShapeLayer") }, "setShape:", aMovie);

    if (!_displaysAsThumbnail)
    {
        objj_msgSend(self, "_createFlashLayerIfNecessary");

        objj_msgSend(_flashLayer, "setFlashMovie:", objj_msgSend(CPFlashMovie, "flashMovieWithFile:", objj_msgSend(aMovie, "movieURL")));
    }

    objj_msgSend(_image, "setDelegate:", nil);

    _image = objj_msgSend(objj_msgSend(CPImage, "alloc"), "initWithContentsOfFile:", objj_msgSend(aMovie, "largeThumbnailURL"));
    objj_msgSend(_image, "setDelegate:", self);

    objj_msgSend(self, "setNeedsDisplay");
}
});
instance_methods[4] = new objj_method(sel_registerName("imageDidLoad:"), function(self, _cmd, anImage)
{ with(self)
{
    objj_msgSend(self, "setNeedsDisplay");
}
});
instance_methods[5] = new objj_method(sel_registerName("drawInContext:"), function(self, _cmd, aContext)
{ with(self)
{
    if (!_displaysAsThumbnail)
        return;

    var bounds = objj_msgSend(self, "bounds");

    if (objj_msgSend(_image, "loadStatus") != CPImageLoadStatusCompleted)
    {
        CGContextSetFillColor(aContext, objj_msgSend(CPColor, "grayColor"));
        CGContextFillRect(aContext, bounds);
    }
    else
        CGContextDrawImage(aContext, bounds, _image);
}
});
instance_methods[6] = new objj_method(sel_registerName("setBounds:"), function(self, _cmd, bounds)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKShapeLayer") }, "setBounds:", bounds);

    objj_msgSend(_flashLayer, "setBounds:", bounds);
}
});
class_addMethods(the_class, instance_methods);
}

p;11;SKPicture.jI;20;Foundation/CPCoder.jI;21;Foundation/CPString.ji;9;SKShape.jc;1980;


{var the_class = objj_allocateClassPair(SKShape, "SKPicture"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_imageURL"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKShape") }, "init");

    if (self)
        _locks = SKShapeLocksNoChangeAspect;

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("setImageURL:"), function(self, _cmd, anImageURL)
{ with(self)
{
    _imageURL = anImageURL;
}
});
instance_methods[2] = new objj_method(sel_registerName("imageURL"), function(self, _cmd)
{ with(self)
{
    return _imageURL;
}
});
class_addMethods(the_class, instance_methods);
}

var SKPictureImageURLKey = "SKPictureImageURLKey";

{
var the_class = objj_getClass("SKPicture")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKPicture\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKShape") }, "initWithCoder:", aCoder);

    if (self)
        _imageURL = objj_msgSend(aCoder, "decodeObjectForKey:", SKPictureImageURLKey);

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKShape") }, "encodeWithCoder:", aCoder);

    objj_msgSend(aCoder, "encodeObject:forKey:", _imageURL, SKPictureImageURLKey);
}
});
class_addMethods(the_class, instance_methods);
}

p;16;SKPictureLayer.jI;18;AppKit/CGContext.jI;16;AppKit/CPImage.ji;11;SKPicture.ji;14;SKShapeLayer.jc;1874;


var SKImageClass = objj_msgSend(CPImage, "class");

SKSetImageClass= function( aClass)
{
    SKImageClass = aClass;
}

{var the_class = objj_allocateClassPair(SKShapeLayer, "SKPictureLayer"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_image"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setShape:"), function(self, _cmd, aPicture)
{ with(self)
{
    if (_shape == aPicture)
        return;

    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKShapeLayer") }, "setShape:", aPicture);

    objj_msgSend(_image, "setDelegate:", nil);

    _image = objj_msgSend(objj_msgSend(SKImageClass, "alloc"), "initWithContentsOfFile:", objj_msgSend(aPicture, "imageURL"));
    objj_msgSend(_image, "setDelegate:", self);

    objj_msgSend(self, "setNeedsDisplay");
}
});
instance_methods[1] = new objj_method(sel_registerName("imageDidLoad:"), function(self, _cmd, anImage)
{ with(self)
{

    objj_msgSend(_shape, "setImageURL:", objj_msgSend(anImage, "filename"));

    objj_msgSend(self, "setNeedsDisplay");
}
});
instance_methods[2] = new objj_method(sel_registerName("drawInContext:"), function(self, _cmd, aContext)
{ with(self)
{
    var bounds = objj_msgSend(self, "bounds");

    if (objj_msgSend(_image, "loadStatus") != CPImageLoadStatusCompleted)
    {
        CGContextSetFillColor(aContext, objj_msgSend(CPColor, "grayColor"));
        CGContextFillRect(aContext, bounds);
    }
    else
        CGContextDrawImage(aContext, bounds, _image);
}
});
instance_methods[3] = new objj_method(sel_registerName("allowsTextContent"), function(self, _cmd)
{ with(self)
{
    return NO;
}
});
class_addMethods(the_class, instance_methods);
}

p;16;SKPresentation.jI;20;Foundation/CPArray.jI;19;AppKit/CGGeometry.ji;12;SKEditable.ji;9;SKSlide.ji;15;SKSlideLayout.ji;15;SKSlideMaster.jc;11795;


SKPresentationDidInsertSlidesNotification = "SKPresentationDidInsertSlidesNotification";
SKPresentationInsertedSlides = "SKPresentationInsertedSlides";
SKPresentationInsertedIndexes = "SKPresentationInsertedIndexes";

SKPresentationDidRemoveSlidesNotification = "SKPresentationDidRemoveSlidesNotification";
SKPresentationRemovedSlides = "SKPresentationRemovedSlides";
SKPresentationRemovedIndexes = "SKPresentationRemovedIndexes";

SKPresentationDidRemoveSlidesNotification = "SKPresentationDidRemoveSlidesNotification";
SKPresentationRemovedSlides = "SKPresentationRemovedSlides";
SKPresentationRemovedIndexes = "SKPresentationRemovedIndexes";

SKPresentationDidMoveSlidesNotification = "SkPresentationDidMoveSlidesNotification";
SKPresentationOldSlideIndexes = "SKPresentationOldSlideIndexes";
SKPresentationNewSlideIndexes = "SKPresentationNewSlideIndexes";

var SKPresentationDefaultSlideMaster = nil;

{var the_class = objj_allocateClassPair(SKEditable, "SKPresentation"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_slideSize"), new objj_ivar("_notesSize"), new objj_ivar("_slides"), new objj_ivar("_slideMasters"), new objj_ivar("_theme"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("defaultSlideMaster"), function(self, _cmd)
{ with(self)
{
    if (!SKPresentationDefaultSlideMaster)
    {
        SKPresentationDefaultSlideMaster = objj_msgSend(objj_msgSend(SKSlideMaster, "alloc"), "init");
        objj_msgSend(SKPresentationDefaultSlideMaster, "addSlideLayout:", objj_msgSend(objj_msgSend(SKSlideLayout, "alloc"), "initWithType:", SKSlideLayoutBlankType));
    }

    return SKPresentationDefaultSlideMaster;
}
});
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(self, "initWithSlideMaster:", objj_msgSend(objj_msgSend(self, "class"), "defaultSlideMaster"));
}
});
instance_methods[1] = new objj_method(sel_registerName("initWithSlideMaster:"), function(self, _cmd, aSlideMaster)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKEditable") }, "init");

    if (self)
    {
        _slideSize = CGSizeMake(800.0, 600.0);
        _notesSize = CGSizeMake(800.0, 600.0);

        _slides = [];
        _slideMasters = [aSlideMaster];


        var firstSlide = objj_msgSend(objj_msgSend(SKSlide, "alloc"), "initWithPresentation:", self),
            titleSlideLayout = objj_msgSend(aSlideMaster, "firstSlideLayoutWithType:", SKSlideLayoutTitleType);

        objj_msgSend(firstSlide, "setSlideLayout:", titleSlideLayout?titleSlideLayout:objj_msgSend(aSlideMaster, "slideLayouts")[0]);

        objj_msgSend(self, "insertSlide:atIndex:", firstSlide, CPNotFound);
    }

    return self;
}
});
instance_methods[2] = new objj_method(sel_registerName("slideSize"), function(self, _cmd)
{ with(self)
{
    return _slideSize;
}
});
instance_methods[3] = new objj_method(sel_registerName("notesSize"), function(self, _cmd)
{ with(self)
{
    return _notesSize;
}
});
instance_methods[4] = new objj_method(sel_registerName("size"), function(self, _cmd)
{ with(self)
{
    return _slideSize;
}
});
instance_methods[5] = new objj_method(sel_registerName("setTheme:"), function(self, _cmd, aTheme)
{ with(self)
{
    if (_theme == aTheme)
        return;

    _theme = aTheme;
}
});
instance_methods[6] = new objj_method(sel_registerName("theme"), function(self, _cmd)
{ with(self)
{
    return _theme;
}
});
instance_methods[7] = new objj_method(sel_registerName("slides"), function(self, _cmd)
{ with(self)
{
    return _slides;
}
});
instance_methods[8] = new objj_method(sel_registerName("insertSlides:atIndexes:"), function(self, _cmd, slides, indexes)
{ with(self)
{
    var index = 0,
        position = CPNotFound;

    while ((position = objj_msgSend(indexes, "indexGreaterThanIndex:", position)) != CPNotFound)
    {
        var slide = slides[index++];


        slide._presentation = self;
        slide._undoManager = _undoManager;

        _slides.splice(position, 0, slide);
    }

    if (!objj_msgSend(self, "isEditing"))
        return;

    var userInfo = objj_msgSend(CPDictionary, "dictionary");

    objj_msgSend(userInfo, "setObject:forKey:", slides, SKPresentationInsertedSlides);
    objj_msgSend(userInfo, "setObject:forKey:", indexes, SKPresentationInsertedIndexes);

    objj_msgSend(self, "registerEditingUndoWithSelector:object:", sel_registerName("removeSlidesAtIndexes:"), objj_msgSend(indexes, "copy"));
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:userInfo:", SKPresentationDidInsertSlidesNotification, self, userInfo));
}
});
instance_methods[9] = new objj_method(sel_registerName("removeSlidesAtIndexes:"), function(self, _cmd, indexes)
{ with(self)
{
    var position = objj_msgSend(indexes, "lastIndex"),
        removed = [];

    while (position != CPNotFound)
    {
        removed.splice(0, 0, _slides[position]);
        _slides.splice(position, 1);

        position = objj_msgSend(indexes, "indexLessThanIndex:", position);
    }

    if (!objj_msgSend(self, "isEditing"))
        return;

    var userInfo = objj_msgSend(CPDictionary, "dictionary");

    objj_msgSend(userInfo, "setObject:forKey:", indexes, SKPresentationRemovedIndexes);
    objj_msgSend(userInfo, "setObject:forKey:", removed, SKPresentationRemovedSlides);

    objj_msgSend(objj_msgSend(self, "prepareWithInvocationTarget:", self), "insertSlides:atIndexes:", removed, objj_msgSend(indexes, "copy"));
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:userInfo:", SKPresentationDidRemoveSlidesNotification, self, userInfo));
}
});
instance_methods[10] = new objj_method(sel_registerName("insertSlide:atIndex:"), function(self, _cmd, aSlide, anIndex)
{ with(self)
{
    var count = _slides.length;

    if (anIndex > count || anIndex == CPNotFound)
        anIndex = count;

    objj_msgSend(self, "insertSlides:atIndexes:", [aSlide], objj_msgSend(CPIndexSet, "indexSetWithIndex:", anIndex));
}
});
instance_methods[11] = new objj_method(sel_registerName("moveSlidesAtIndexes:toIndexes:"), function(self, _cmd, oldIndexes, newIndexes)
{ with(self)
{
    var position = objj_msgSend(oldIndexes, "lastIndex"),
        slides = [];

    while (position != CPNotFound)
    {
        slides.push(_slides[position]);
        _slides.splice(position, 1);

        position = objj_msgSend(oldIndexes, "indexLessThanIndex:", position);
    }

    var count = slides.length,
        position = CPNotFound;

    while ((position = objj_msgSend(newIndexes, "indexGreaterThanIndex:", position)) != CPNotFound)
        _slides.splice(position, 0, slides[--count]);

    if (!objj_msgSend(self, "isEditing"))
        return;

    var userInfo = objj_msgSend(CPDictionary, "dictionary");

    objj_msgSend(userInfo, "setObject:forKey:", oldIndexes, SKPresentationOldSlideIndexes);
    objj_msgSend(userInfo, "setObject:forKey:", newIndexes, SKPresentationNewSlideIndexes);

    objj_msgSend(objj_msgSend(self, "prepareWithInvocationTarget:", self), "moveSlidesAtIndexes:toIndexes:", objj_msgSend(newIndexes, "copy"), objj_msgSend(oldIndexes, "copy"));
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:userInfo:", SKPresentationDidMoveSlidesNotification, self, userInfo));
}
});
instance_methods[12] = new objj_method(sel_registerName("setUndoManager:"), function(self, _cmd, anUndoManager)
{ with(self)
{
    if (_undoManager == anUndoManager)
        return;

    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKEditable") }, "setUndoManager:", anUndoManager);

    var count = _slides.length;

    while (count--)
        objj_msgSend(_slides[count], "setUndoManager:", anUndoManager);
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}

{
var the_class = objj_getClass("SKPresentation")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKPresentation\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("slideMasters"), function(self, _cmd)
{ with(self)
{
    return _slideMasters;
}
});
instance_methods[1] = new objj_method(sel_registerName("setSlideMaster:forSlidesWithSlideMaster:"), function(self, _cmd, aSlideMaster, oldSlideMaster)
{ with(self)
{
    if (aSlideMaster == oldSlideMaster)
        return;



    var location = objj_msgSend(_slideMasters, "indexOfObjectIdenticalTo:", oldSlideMaster);

    if (location == CPNotFound)
        return;

    _slideMasters[location] = aSlideMaster;


    var index = 0,
        count = objj_msgSend(_slides, "count");

    for (; index < count; ++index)
    {
        var slide = _slides[index];


        if (objj_msgSend(slide, "slideMaster") == oldSlideMaster)
        {
            var layout = objj_msgSend(_slides[index], "slideLayout"),
                replacement = objj_msgSend(aSlideMaster, "firstSlideLayoutWithType:", objj_msgSend(layout, "type"));

            if (!replacement)
                replacement = objj_msgSend(layout, "copy");

            objj_msgSend(slide, "beginEditing");
            objj_msgSend(slide, "setSlideLayout:", replacement);
            objj_msgSend(slide, "endEditing");
        }
    }
}
});
instance_methods[2] = new objj_method(sel_registerName("defaultSlideLayout"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(_slideMasters[0], "slideLayouts")[0];
}
});
class_addMethods(the_class, instance_methods);
}

var SKPresentationSlideSize = "SKPresentationSlideSize",
    SKPresentationNotesSize = "SKPresentationNotesSize",
    SKPresentationSlides = "SKPresentationSlides",
    SKPresentationSlideMasters = "SKPresentationSlideMasters";

{
var the_class = objj_getClass("SKPresentation")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKPresentation\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKEditable") }, "init");

    if (self)
    {
        _slideSize = objj_msgSend(aCoder, "decodeSizeForKey:", SKPresentationSlideSize);
        _notesSize = objj_msgSend(aCoder, "decodeSizeForKey:", SKPresentationNotesSize);

        _slides = objj_msgSend(aCoder, "decodeObjectForKey:", SKPresentationSlides);
        _slideMasters = objj_msgSend(aCoder, "decodeObjectForKey:", SKPresentationSlideMasters);



        var index = 0,
            count = _slides.length;

        for (; index < count; ++index)
            _slides[index]._slideLayout = objj_msgSend(_slideMasters[0], "firstSlideLayoutWithType:", objj_msgSend(_slides[index]._slideLayout, "type"));
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSend(aCoder, "encodeSize:forKey:", _slideSize, SKPresentationSlideSize);
    objj_msgSend(aCoder, "encodeSize:forKey:", _notesSize, SKPresentationNotesSize);

    objj_msgSend(aCoder, "encodeObject:forKey:", _slides, SKPresentationSlides);
    objj_msgSend(aCoder, "encodeObject:forKey:", _slideMasters, SKPresentationSlideMasters);
}
});
class_addMethods(the_class, instance_methods);
}

p;20;SKPresentationView.ji;16;SKPresentation.ji;13;SKSlideView.ji;14;SKTransition.ji;23;SKTransitionAnimation.jI;15;AppKit/CPView.jc;14018;






{var the_class = objj_allocateClassPair(CPView, "SKPresentationView"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_presentation"), new objj_ivar("_slideAspectRatio"), new objj_ivar("_blackedView"), new objj_ivar("_blackedLabel"), new objj_ivar("_clipView"), new objj_ivar("_slideView"), new objj_ivar("_transitionView"), new objj_ivar("_nextSlideView"), new objj_ivar("_nextSlide"), new objj_ivar("_slideNumber"), new objj_ivar("_isBlacked"), new objj_ivar("_isTransitioning"), new objj_ivar("_isEnd"), new objj_ivar("_jumpString"), new objj_ivar("_jumpTimeout"), new objj_ivar("_advanceTimeout"), new objj_ivar("_delegate"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithFrame:"), function(self, _cmd, aFrame)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "initWithFrame:", aFrame);

    if (self)
    {
        objj_msgSend(self, "setBackgroundColor:", objj_msgSend(CPColor, "blackColor"));

        var bounds = objj_msgSend(self, "bounds");

        _blackedView = objj_msgSend(objj_msgSend(CPView, "alloc"), "initWithFrame:", CGRectMakeCopy(bounds));
        objj_msgSend(_blackedView, "setHidden:", YES);
        objj_msgSend(_blackedView, "setAutoresizingMask:", CPViewWidthSizable|CPViewHeightSizable);

        _blackedLabel = objj_msgSend(objj_msgSend(CPTextField, "alloc"), "initWithFrame:", CPRectMakeZero());
        objj_msgSend(_blackedLabel, "setFont:", objj_msgSend(CPFont, "systemFontOfSize:", 16.0));
        objj_msgSend(_blackedLabel, "setTextColor:", objj_msgSend(CPColor, "whiteColor"));
        objj_msgSend(_blackedLabel, "setStringValue:", "End of slide show, click to exit.");
        objj_msgSend(_blackedLabel, "sizeToFit");
        objj_msgSend(_blackedLabel, "setFrameOrigin:", CPPointMake((bounds.size.width/2.0)-(objj_msgSend(_blackedLabel, "frame").size.width/2.0),10.0));
        objj_msgSend(_blackedLabel, "setAutoresizingMask:", CPViewMinXMargin|CPViewMaxXMargin);
        objj_msgSend(_blackedView, "addSubview:", _blackedLabel);

        _clipView = objj_msgSend(objj_msgSend(CPView, "alloc"), "initWithFrame:", CGRectMakeCopy(bounds));
        objj_msgSend(_clipView, "setBackgroundColor:", objj_msgSend(CPColor, "blackColor"));
        objj_msgSend(_clipView, "setAutoresizingMask:", CPViewWidthSizable|CPViewHeightSizable);

        _slideView = objj_msgSend(objj_msgSend(SKSlideView, "alloc"), "initWithFrame:", CGRectMakeCopy(bounds));
        objj_msgSend(_slideView, "setAutoresizingMask:", CPViewWidthSizable|CPViewHeightSizable);
        objj_msgSend(_slideView, "setBackgroundColor:", objj_msgSend(CPColor, "blackColor"));
        objj_msgSend(_slideView, "setScalesContentToFit:", YES);

        _transitionView = objj_msgSend(objj_msgSend(SKSlideView, "alloc"), "initWithFrame:", CGRectMakeCopy(bounds));
        objj_msgSend(_transitionView, "setAutoresizingMask:", CPViewWidthSizable|CPViewHeightSizable);
        objj_msgSend(_transitionView, "setBackgroundColor:", objj_msgSend(CPColor, "blackColor"));
        objj_msgSend(_transitionView, "setScalesContentToFit:", YES);

        _nextSlideView = objj_msgSend(objj_msgSend(SKSlideView, "alloc"), "initWithFrame:", CGRectMakeCopy(bounds));
        objj_msgSend(_nextSlideView, "setAutoresizingMask:", CPViewWidthSizable|CPViewHeightSizable);
        objj_msgSend(_nextSlideView, "setBackgroundColor:", objj_msgSend(CPColor, "blackColor"));
        objj_msgSend(_nextSlideView, "setScalesContentToFit:", YES);

        _nextSlide = -1;

        objj_msgSend(_clipView, "addSubview:", _nextSlideView);
        objj_msgSend(_clipView, "addSubview:", _transitionView);
        objj_msgSend(_clipView, "addSubview:", _slideView);

        objj_msgSend(self, "addSubview:", _clipView);
        objj_msgSend(self, "addSubview:", _blackedView);

        _jumpString = "";
        _jumpTimeout = null;
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("setPresentation:"), function(self, _cmd, aPresentation)
{ with(self)
{
    _slideNumber = -1;
    _presentation = aPresentation;
    _totalSlides = objj_msgSend(objj_msgSend(aPresentation, "slides"), "count");
}
});
instance_methods[2] = new objj_method(sel_registerName("presentation"), function(self, _cmd)
{ with(self)
{
    return _presentation;
}
});
instance_methods[3] = new objj_method(sel_registerName("startPresentation"), function(self, _cmd)
{ with(self)
{
    objj_msgSend(self, "startPresentationAtIndex:", 0);
}
});
instance_methods[4] = new objj_method(sel_registerName("startPresentationAtIndex:enterFullScreen:"), function(self, _cmd, anIndex, shouldEnterFullScreen)
{ with(self)
{
    _isEnd = NO;
    objj_msgSend(self, "setColorScreen:", nil);
    objj_msgSend(self, "showSlide:useTransition:", anIndex, NO);

    if (shouldEnterFullScreen)
        objj_msgSend(self, "enterFullScreenMode:withOptions:", nil, nil);
}
});
instance_methods[5] = new objj_method(sel_registerName("endPresentation"), function(self, _cmd)
{ with(self)
{
    if (objj_msgSend(_delegate, "respondsToSelector:", sel_registerName("presentationDidEnd")))
        objj_msgSend(_delegate, "presentationDidEnd");

    if (objj_msgSend(self, "isInFullScreenMode"))
        objj_msgSend(self, "exitFullScreenModeWithOptions:", nil);
}
});
instance_methods[6] = new objj_method(sel_registerName("slideNumber"), function(self, _cmd)
{ with(self)
{
    return _slideNumber;
}
});
instance_methods[7] = new objj_method(sel_registerName("count"), function(self, _cmd)
{ with(self)
{
    return _totalSlides;
}
});
instance_methods[8] = new objj_method(sel_registerName("nextSlide"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(self, "showSlide:", _slideNumber+1);
}
});
instance_methods[9] = new objj_method(sel_registerName("previousSlide"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(self, "showSlide:", _slideNumber-1);
}
});
instance_methods[10] = new objj_method(sel_registerName("showSlide:"), function(self, _cmd, num)
{ with(self)
{
    objj_msgSend(self, "showSlide:useTransition:", num, YES);
}
});
instance_methods[11] = new objj_method(sel_registerName("showSlide:useTransition:"), function(self, _cmd, num, useTransition)
{ with(self)
{


    var slides = objj_msgSend(_presentation, "slides");
    if (!_isTransitioning && slides && slides.length > 0)
    {
        if (num == slides.length)
        {
            if (_isEnd)
                objj_msgSend(self, "endPresentation");
            else
            {
                _isEnd = YES;

                objj_msgSend(self, "setColorScreen:withLabel:", objj_msgSend(CPColor, "blackColor"), "End of slide show, click to exit.");

                if (objj_msgSend(_delegate, "respondsToSelector:", sel_registerName("presentationWillEnd:")))
                    objj_msgSend(_delegate, "presentationWillEnd:", self);
            }

            return;
        }

        if (_isEnd)
        {
            objj_msgSend(self, "setColorScreen:", nil);
            _isEnd = NO;
            return;
        }

        var newSlideNumber = MIN(MAX(num, 0), slides.length-1);
        if (newSlideNumber == _slideNumber)
           return;

        _slideNumber = newSlideNumber;
        var slide = slides[_slideNumber];
        objj_msgSend(_transitionView, "setSlide:", slide);

        if (_nextSlide == newSlideNumber)
        {
            _slideNumber = _nextSlide;

            var temp = _transitionView;
            _transitionView = _nextSlideView;
            _nextSlideView = temp;

            _nextSlide = ++newSlideNumber;

            objj_msgSend(_nextSlideView, "setSlide:", slides[_nextSlide]);
        }
        else
        {
            _slideNumber = newSlideNumber;
            var slide = slides[_slideNumber];
            objj_msgSend(_transitionView, "setSlide:", slide);

            _nextSlide = _slideNumber + 1;
            objj_msgSend(_nextSlideView, "setSlide:", slides[_nextSlide]);
        }

        var transition = objj_msgSend(slide, "transition");
        if (useTransition && transition && objj_msgSend(transition, "class") != SKNoTransition)
        {
            var currentAnimation = objj_msgSend(objj_msgSend(SKTransitionAnimation, "alloc"), "initWithPreviousSlideView:nextSlideView:transition:", _slideView, _transitionView, transition);
            objj_msgSend(currentAnimation, "setDelegate:", self);
            objj_msgSend(currentAnimation, "startAnimation");
        }
        else
        {
            objj_msgSend(_slideView, "setHidden:", YES);
            objj_msgSend(_transitionView, "setHidden:", NO);
            objj_msgSend(self, "swapViews");

            if (objj_msgSend(_delegate, "respondsToSelector:", sel_registerName("presentationView:didChangeSlide:")))
                objj_msgSend(_delegate, "presentationView:didChangeSlide:", self, _slideNumber);
        }
    }
}
});
instance_methods[12] = new objj_method(sel_registerName("animationShouldStart:"), function(self, _cmd, animation)
{ with(self)
{
    _isTransitioning = YES;

    objj_msgSend(_slideView, "setDisplaysMoviesAsThumbnails:", YES);
    objj_msgSend(_transitionView, "setDisplaysMoviesAsThumbnails:", YES);

    return YES;
}
});
instance_methods[13] = new objj_method(sel_registerName("animationDidEnd:"), function(self, _cmd, animation)
{ with(self)
{
    objj_msgSend(self, "swapViews");

    _isTransitioning = NO;

    if (objj_msgSend(_delegate, "respondsToSelector:", sel_registerName("presentationView:slideIndexDidChange:")))
        objj_msgSend(_delegate, "presentationView:slideIndexDidChange:", self, _slideNumber);
}
});
instance_methods[14] = new objj_method(sel_registerName("swapViews"), function(self, _cmd)
{ with(self)
{
    var tempView = _slideView;

    _slideView = _transitionView;
    _transitionView = tempView;

    objj_msgSend(_slideView, "setDisplaysMoviesAsThumbnails:", NO);
}
});
instance_methods[15] = new objj_method(sel_registerName("startTimer:"), function(self, _cmd, duration)
{ with(self)
{
    window.clearTimeout(_advanceTimeout);
    if (duration != nil)
    {
        _advanceTimeout = window.setTimeout(function() {
            objj_msgSend(self, "nextSlide");
            objj_msgSend(objj_msgSend(CPRunLoop, "currentRunLoop"), "performSelectors");
        }, duration);
    }
}
});
instance_methods[16] = new objj_method(sel_registerName("toggleColorScreen:"), function(self, _cmd, aColor)
{ with(self)
{
    _isBlacked = !_isBlacked;
    objj_msgSend(self, "setColorScreen:", (_isBlacked?aColor:nil))
}
});
instance_methods[17] = new objj_method(sel_registerName("setColorScreen:"), function(self, _cmd, aColor)
{ with(self)
{
    objj_msgSend(self, "setColorScreen:withLabel:", aColor, nil);
}
});
instance_methods[18] = new objj_method(sel_registerName("setColorScreen:withLabel:"), function(self, _cmd, aColor, aLabel)
{ with(self)
{
    if (aColor)
    {
        objj_msgSend(_slideView, "setDisplaysMoviesAsThumbnails:", YES);

        objj_msgSend(_blackedLabel, "setStringValue:", (aLabel||""));

        objj_msgSend(_blackedView, "setBackgroundColor:", aColor);
        objj_msgSend(_blackedView, "setHidden:", NO);
    }
    else
    {
        objj_msgSend(_slideView, "setDisplaysMoviesAsThumbnails:", NO);

        objj_msgSend(_blackedView, "setHidden:", YES);
    }
}
});
instance_methods[19] = new objj_method(sel_registerName("keyDown:"), function(self, _cmd, anEvent)
{ with(self)
{
    var key = objj_msgSend(anEvent, "keyCode");

    if (_isBlacked)
    {
        objj_msgSend(self, "toggleColorScreen:", nil);
        return;
    }

    switch (key)
    {
        case 13:
                    if (_jumpString == "")
                        objj_msgSend(self, "nextSlide");
                    else
                    {
                        window.clearTimeout(_jumpTimeout);
                        _jumpTimeout = null;
                        objj_msgSend(self, "showSlide:", parseInt(_jumpString)-1);
                        _jumpString = "";
                    }

                    break;

        case 27:
                    objj_msgSend(self, "endPresentation");
                    break;

        case 32:
        case 34:
        case 39:
        case 40:
        case 78:
                    if(window.controller && _isEnd) break;
                        objj_msgSend(self, "nextSlide");

                    break;

        case 8:
        case 33:
        case 37:
        case 38:
        case 80:
                    objj_msgSend(self, "previousSlide");
                    break;

        case 66:
        case 190:
                    objj_msgSend(self, "toggleColorScreen:", objj_msgSend(CPColor, "blackColor"));
                    break;

        case 87:
        case 188:
                    objj_msgSend(self, "toggleColorScreen:", objj_msgSend(CPColor, "whiteColor"));
                    break;
    }


    if ((key >= 48 && key <= 57) || (key >= 96 && key <= 105))
    {
        _jumpString += objj_msgSend(anEvent, "characters");

        window.clearTimeout(_jumpTimeout);
        _jumpTimeout = window.setTimeout(function() { _jumpString = ""; }, 3000);
    }
    else
    {

    }
}
});
instance_methods[20] = new objj_method(sel_registerName("mouseDown:"), function(self, _cmd, anEvent)
{ with(self)
{
    objj_msgSend(self, "nextSlide");
}
});
instance_methods[21] = new objj_method(sel_registerName("acceptsFirstResponder"), function(self, _cmd)
{ with(self)
{
    return YES;
}
});
instance_methods[22] = new objj_method(sel_registerName("setDelegate:"), function(self, _cmd, aDelegate)
{ with(self)
{
    _delegate = aDelegate;
}
});
instance_methods[23] = new objj_method(sel_registerName("delegate"), function(self, _cmd)
{ with(self)
{
    return _delegate;
}
});
class_addMethods(the_class, instance_methods);
}

p;9;SKShape.jI;21;Foundation/CPObject.ji;12;SKEditable.ji;8;SKFill.ji;12;SKGeometry.jc;22476;


SKShapesPboardType = "SKShapesPboardType";

SKShapeTransformationDidChangeNotification = "SKShapeTransformationDidChangeNotification";

ElementGeometryDidChangeNotification = "ElementGeometryDidChangeNotification";

SKShapeAdjustmentValueDidChangeNotification = "SKShapeAdjustmentValueDidChangeNotification";
SKShapeAdjustmentName = "SKShapeAdjustmentName";

SKShapeFillDidChangeNotification = "SKShapeFillDidChangeNotification";

SKShapeOpacityDidChangeNotification = "SKShapeOpacityDidChangeNotification";

SKShapeStrokeColorDidChangeNotification = "SKShapeStrokeColorDidChangeNotification";
SKShapeStrokeWidthDidChangeNotification = "SKShapeStrokeWidthDidChangeNotification";

SKShapeTextBodyDidChangeNotification = "SKShapeTextBodyDidChangeNotification";

SKShapeLocksNoAdjustHandles = 1;
SKShapeLocksNoChangeArrowheads = 1 << 1;
SKShapeLocksNoChangeAspect = 1 << 2;
SKShapeLocksNoChangeShapeType = 1 << 3;
SKShapeLocksNoEditPoints = 1 << 4;
SKShapeLocksNoGroup = 1 << 5;
SKShapeLocksNoMove = 1 << 6;
SKShapeLocksNoRotation = 1 << 7;
SKShapeLocksNoSelect = 1 << 8;
SKShapeLocksNoTextEdit = 1 << 9;
SKShapeLocksNoResize = 1 << 10;
SKShapeLocksNoCrop = 1 << 11;

SKShapeBodyPlaceholderType = 0;


SKShapeCenterdTitlePlaceholderType = 3;
SKShapeSubtitlePlaceholderType = 13;
SKShapeTitlePlaceholderType = 15;
{var the_class = objj_allocateClassPair(SKEditable, "SKShape"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_slideBase"), new objj_ivar("_locks"), new objj_ivar("_size"), new objj_ivar("_position"), new objj_ivar("_isFlippedHorizontal"), new objj_ivar("_isFlippedVertical"), new objj_ivar("_rotationRadians"), new objj_ivar("_geometryName"), new objj_ivar("_adjustments"), new objj_ivar("_adjustmentValues"), new objj_ivar("_fill"), new objj_ivar("_fillColor"), new objj_ivar("_strokeColor"), new objj_ivar("_strokeWidth"), new objj_ivar("_opacity"), new objj_ivar("_textBody"), new objj_ivar("_isPlaceholder"), new objj_ivar("_placeholderType"), new objj_ivar("_placeholderIdx"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKEditable") }, "init");
    if (self)
    {
        _locks = 0;
        _size = CGSizeMakeZero();
        _position = CGPointMakeZero();
        _rotationRadians = 0.0;
        _isFlippedHorizontal = NO;
        _isFlippedVertical = NO;
        _opacity = 1.0;
        _textBody = "";
        _isPlaceholder = NO;
        _type = SKShapeBodyPlaceholderType;
        _idx = 0;
    }
    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("initWithShape:"), function(self, _cmd, aShape)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKEditable") }, "init");
    if (self)
    {
        _locks = aShape._locks;
        _size = CGSizeMakeCopy(aShape._size);
        _position = CGPointMakeCopy(aShape._position);
        _isFlippedHorizontal = aShape._isFlippedHorizontal;
        _isFlippedVertical = aShape._isFlippedVertical;
        _rotationRadians = aShape._rotationRadians;
        _geometryName = aShape._geometryName;
        _adjustments = objj_msgSend(objj_msgSend(SKGeometry, "geometryForName:", _geometryName), "adjustments");
        _adjustmentValues = objj_msgSend(CPDictionary, "dictionary");
        var values = objj_msgSend(aShape, "adjustmentValues"),
            key,
            keys = objj_msgSend(values, "keyEnumerator");
        while (key = objj_msgSend(keys, "nextObject"))
            objj_msgSend(_adjustmentValues, "setObject:forKey:", CGPointMakeCopy(objj_msgSend(values, "objectForKey:", key)), key);
        _fillColor = aShape._fillColor;
        _strokeColor = aShape._strokeColor;
        _strokeWidth = aShape._strokeWidth;
        _opacity = aShape._opacity;
        _textBody = objj_msgSend(aShape._textBody, "copy");
        _isPlaceholder = aShape._isPlaceholder;
        _placeholderType = aShape._placeholderType;
        _placeholderIdx = aShape._placeholderIdx;
    }
    return self;
}
});
instance_methods[2] = new objj_method(sel_registerName("copyPropertiesFromPlaceholder:"), function(self, _cmd, aShape)
{ with(self)
{
    _locks = aShape._locks;
    _size = CGSizeMakeCopy(aShape._size);
    _position = CGPointMakeCopy(aShape._position);
    _isFlippedHorizontal = aShape._isFlippedHorizontal;
    _isFlippedVertical = aShape._isFlippedVertical;
    _rotationRadians = aShape._rotationRadians;
    _geometryName = aShape._geometryName;
    _adjustments = objj_msgSend(objj_msgSend(SKGeometry, "geometryForName:", _geometryName), "adjustments");
    _adjustmentValues = objj_msgSend(CPDictionary, "dictionary");
    var values = objj_msgSend(aShape, "adjustmentValues"),
        key,
        keys = objj_msgSend(values, "keyEnumerator");
    while (key = objj_msgSend(keys, "nextObject"))
        objj_msgSend(_adjustmentValues, "setObject:forKey:", CGPointMakeCopy(objj_msgSend(values, "objectForKey:", key)), key);
    _fillColor = aShape._fillColor;
    _strokeColor = aShape._strokeColor;
    _strokeWidth = aShape._strokeWidth;
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", ElementGeometryDidChangeNotification, self));
}
});
instance_methods[3] = new objj_method(sel_registerName("slide"), function(self, _cmd)
{ with(self)
{
    return _slideBase;
}
});
instance_methods[4] = new objj_method(sel_registerName("slideBase"), function(self, _cmd)
{ with(self)
{
    return _slideBase;
}
});
instance_methods[5] = new objj_method(sel_registerName("slideMaster"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(_slideBase, "slideMaster");
}
});
instance_methods[6] = new objj_method(sel_registerName("locks"), function(self, _cmd)
{ with(self)
{
    return _locks;
}
});
instance_methods[7] = new objj_method(sel_registerName("setPosition:"), function(self, _cmd, aPosition)
{ with(self)
{
    if (CGPointEqualToPoint(_position, aPosition))
        return;
    objj_msgSend(self, "registerEditingUndoWithSelector:object:", sel_registerName("setPosition:"), CGPointMakeCopy(_position));
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", ElementGeometryDidChangeNotification, self));
    _position = CGPointMakeCopy(aPosition);
}
});
instance_methods[8] = new objj_method(sel_registerName("position"), function(self, _cmd)
{ with(self)
{
    return _position;
}
});
instance_methods[9] = new objj_method(sel_registerName("setSize:"), function(self, _cmd, aSize)
{ with(self)
{
    if (CGSizeEqualToSize(_size, aSize))
        return;
    objj_msgSend(self, "registerEditingUndoWithSelector:object:", sel_registerName("setSize:"), CGSizeMakeCopy(_size));
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", ElementGeometryDidChangeNotification, self));
    _size = aSize;
}
});
instance_methods[10] = new objj_method(sel_registerName("size"), function(self, _cmd)
{ with(self)
{
    return _size;
}
});
instance_methods[11] = new objj_method(sel_registerName("setRotationRadians:"), function(self, _cmd, aRotationRadians)
{ with(self)
{
    if (_rotationRadians == aRotationRadians)
        return;
    objj_msgSend(self, "registerEditingUndoWithSelector:object:", sel_registerName("setRotationRadians:"), _rotationRadians);
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", ElementGeometryDidChangeNotification, self));
    _rotationRadians = aRotationRadians;
}
});
instance_methods[12] = new objj_method(sel_registerName("rotationRadians"), function(self, _cmd)
{ with(self)
{
    return _rotationRadians;
}
});
instance_methods[13] = new objj_method(sel_registerName("rotationDegrees"), function(self, _cmd)
{ with(self)
{
    return _rotationDegrees * 180 / PI;
}
});
instance_methods[14] = new objj_method(sel_registerName("isFlippedHorizontal"), function(self, _cmd)
{ with(self)
{
    return _isFlippedHorizontal;
}
});
instance_methods[15] = new objj_method(sel_registerName("setFlippedHorizontal:"), function(self, _cmd, isFlippedHorizontal)
{ with(self)
{
    if (_isFlippedHorizontal == isFlippedHorizontal)
        return;
    objj_msgSend(self, "registerEditingUndoWithSelector:object:", sel_registerName("setFlippedHorizontal:"), _isFlippedHorizontal);
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", ElementGeometryDidChangeNotification, self));
    _isFlippedHorizontal = isFlippedHorizontal;
}
});
instance_methods[16] = new objj_method(sel_registerName("isFlippedVertical"), function(self, _cmd)
{ with(self)
{
    return _isFlippedVertical;
}
});
instance_methods[17] = new objj_method(sel_registerName("setFlippedVertical:"), function(self, _cmd, isFlippedVertical)
{ with(self)
{
    if (_isFlippedVertical == isFlippedVertical)
        return;
    objj_msgSend(self, "registerEditingUndoWithSelector:object:", sel_registerName("setFlippedVertical:"), _isFlippedVertical);
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", ElementGeometryDidChangeNotification, self));
    _isFlippedVertical = isFlippedVertical;
}
});
instance_methods[18] = new objj_method(sel_registerName("setGeometryName:"), function(self, _cmd, aName)
{ with(self)
{
    if (_geometryName == aName)
        return;
    _geometryName = aName;
    _adjustments = objj_msgSend(objj_msgSend(SKGeometry, "geometryForName:", _geometryName), "adjustments");
    _adjustmentValues = objj_msgSend(objj_msgSend(SKGeometry, "geometryForName:", _geometryName), "defaultAdjustmentValues");
}
});
instance_methods[19] = new objj_method(sel_registerName("geometryName"), function(self, _cmd)
{ with(self)
{
    return _geometryName;
}
});
instance_methods[20] = new objj_method(sel_registerName("adjustments"), function(self, _cmd)
{ with(self)
{
    return _adjustments;
}
});
instance_methods[21] = new objj_method(sel_registerName("adjustmentValues"), function(self, _cmd)
{ with(self)
{
    return _adjustmentValues;
}
});
instance_methods[22] = new objj_method(sel_registerName("valueForAdjustmentWithName:"), function(self, _cmd, aName)
{ with(self)
{
    return objj_msgSend(_adjustmentValues, "objectForKey:", aName);
}
});
instance_methods[23] = new objj_method(sel_registerName("setValue:forAdjustmentWithName:"), function(self, _cmd, aValue, aName)
{ with(self)
{
    var oldValue = objj_msgSend(self, "valueForAdjustmentWithName:", aName),
        newValue = objj_msgSend(objj_msgSend(_adjustments, "objectForKey:", aName), "actualValueForProposedValue:", aValue);
    if (CGPointEqualToPoint(oldValue, newValue))
        return;
    objj_msgSend(_adjustmentValues, "setObject:forKey:", newValue, aName);
    var userInfo = objj_msgSend(CPDictionary, "dictionaryWithObject:forKey:", aName, SKShapeAdjustmentName);
    objj_msgSend(objj_msgSend(self, "prepareWithInvocationTarget:", self), "setValue:forAdjustmentWithName:", oldValue, aName);
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:userInfo:", SKShapeAdjustmentValueDidChangeNotification, self, userInfo));
}
});
instance_methods[24] = new objj_method(sel_registerName("setFill:"), function(self, _cmd, aFill)
{ with(self)
{
    if (_fill == aFill)
        return;
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", SKShapeFillDidChangeNotification, self));
    _fill = aFill;
}
});
instance_methods[25] = new objj_method(sel_registerName("fill"), function(self, _cmd)
{ with(self)
{
    return _fill;
}
});
instance_methods[26] = new objj_method(sel_registerName("setFillColor:"), function(self, _cmd, aColor)
{ with(self)
{
    objj_msgSend(self, "setFill:", objj_msgSend(SKFill, "solidFillWithColor:", aColor));
}
});
instance_methods[27] = new objj_method(sel_registerName("fillColor"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(_fill, "color");
}
});
instance_methods[28] = new objj_method(sel_registerName("setStrokeColor:"), function(self, _cmd, aColor)
{ with(self)
{
    if (_strokeColor == aColor)
        return;
    objj_msgSend(self, "registerEditingEditingUndoWithSelector:object:", sel_registerName("setStrokeColor:"), _strokeColor);
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", SKShapeStrokeColorDidChangeNotification, self));
    _strokeColor = aColor;
}
});
instance_methods[29] = new objj_method(sel_registerName("strokeColor"), function(self, _cmd)
{ with(self)
{
    return _strokeColor;
}
});
instance_methods[30] = new objj_method(sel_registerName("setStrokeWidth:"), function(self, _cmd, aWidth)
{ with(self)
{
    if (_strokeWidth == aWidth)
        return;
    objj_msgSend(self, "registerEditingUndoWithSelector:object:", sel_registerName("setStrokeWidth:"), _strokeColor);
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", SKShapeStrokeWidthDidChangeNotification, self));
    _strokeWidth = aWidth;
}
});
instance_methods[31] = new objj_method(sel_registerName("strokeWidth"), function(self, _cmd)
{ with(self)
{
    return _strokeWidth;
}
});
instance_methods[32] = new objj_method(sel_registerName("setOpacity:"), function(self, _cmd, anOpacity)
{ with(self)
{
    if (_opacity == anOpacity)
        return;
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", SKShapeOpacityDidChangeNotification, self));
    _opacity = anOpacity;
}
});
instance_methods[33] = new objj_method(sel_registerName("opacity"), function(self, _cmd)
{ with(self)
{
    return _opacity;
}
});
instance_methods[34] = new objj_method(sel_registerName("computedDefaultTextAttributes"), function(self, _cmd)
{ with(self)
{
    var slideMaster = objj_msgSend(self, "slideMaster");
    if (objj_msgSend(self, "isPlaceholder"))
    {
        var placeholderType = objj_msgSend(self, "placeholderType");
        if (placeholderType == SKShapeCenterdTitlePlaceholderType || placeholderType == SKShapeSubtitlePlaceholderType || placeholderType == SKShapeTitlePlaceholderType)
            return objj_msgSend(slideMaster, "titleTextAttributes");
        return objj_msgSend(slideMaster, "bodyTextAttributes");
    }
    return objj_msgSend(slideMaster, "otherTextAttributes");
}
});
instance_methods[35] = new objj_method(sel_registerName("setTextBody:"), function(self, _cmd, aString)
{ with(self)
{
    if (_textBody == aString)
        return;
    _textBody = aString;
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:", SKShapeTextBodyDidChangeNotification, self));
}
});
instance_methods[36] = new objj_method(sel_registerName("textBody"), function(self, _cmd)
{ with(self)
{
    return _textBody;
}
});
instance_methods[37] = new objj_method(sel_registerName("setIsPlaceholder:"), function(self, _cmd, shouldBePlaceholder)
{ with(self)
{
    _isPlaceholder = shouldBePlaceholder;
}
});
instance_methods[38] = new objj_method(sel_registerName("isPlaceholder"), function(self, _cmd)
{ with(self)
{
    return _isPlaceholder;
}
});
instance_methods[39] = new objj_method(sel_registerName("setPlaceholderType:"), function(self, _cmd, aPlaceholderType)
{ with(self)
{
    _placeholderType = aPlaceholderType;
}
});
instance_methods[40] = new objj_method(sel_registerName("placeholderType"), function(self, _cmd)
{ with(self)
{
    return _placeholderType;
}
});
instance_methods[41] = new objj_method(sel_registerName("setPlaceholderIdx:"), function(self, _cmd, aPlaceholderIdx)
{ with(self)
{
    _placeholderIdx = aPlaceholderIdx;
}
});
instance_methods[42] = new objj_method(sel_registerName("placeholderIdx"), function(self, _cmd)
{ with(self)
{
    return _placeholderIdx;
}
});
instance_methods[43] = new objj_method(sel_registerName("placeholderPrompt"), function(self, _cmd)
{ with(self)
{
    if (!_isPlaceholder)
        return nil;
    if (_placeholderType == SKShapeBodyPlaceholderType)
        return "Double-click to add text";
    if (_placeholderType == SKShapeCenterdTitlePlaceholderType)
        return "Double-click to add title";
    if (_placeholderType == SKShapeSubtitlePlaceholderType)
        return "Double-click to add subtitle";
    if (_placeholderType == SKShapeTitlePlaceholderType)
        return "Double-click to add title";
    return "Double-click to add text";
}
});
class_addMethods(the_class, instance_methods);
}
{
var the_class = objj_getClass("SKShape")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKShape\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("copy"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(objj_msgSend(SKShape, "alloc"), "initWithShape:", self);
}
});
class_addMethods(the_class, instance_methods);
}
var SKShapeSlideBaseKey = "SKShapeSlideBaseKey",
    SKShapeLocksKey = "SKShapeLocksKeys",
    SKShapeSizeKey = "SKShapeSizeKey",
    SKShapePositionKey = "SKShapePositionKey",
    SKShapeRotationRadiansKey = "SKShapeRotationRadiansKey",
    SKShapeFlippedHorizontalKey = "SKShapeFlippedHorizontalKey",
    SKShapeFlippedVerticalKey = "SKShapeFlippedVerticalKey",
    SKShapeGeometryNameKey = "SKShapeGeometryNameKey",
    SKShapeFillKey = "SKShapeFillKey",
    SKShapeFillColorKey = "SKShapeFillColorKey",
    SKShapeStrokeColorKey = "SKShapeStrokeColorKey",
    SKShapeStrokeWidthKey = "SKShapeStrokeWidthKey",
    SKShapeOpacityKey = "SKShapeOpacityKey",
    SKShapeAdjustmentValuesKey = "SKShapeAdjustmentValuesKey",
    SKShapeTextBodyKey = "SKShapeTextBodyKey",
    SKShapeIsPlaceholderKey = "SKShapeIsPlaceholderKey",
    SKShapePlaceholderTypeKey = "SKShapePlaceholderTypeKey",
    SKShapePlaceholderIdxKey = "SKShapePlaceholderIdxKey";
{
var the_class = objj_getClass("SKShape")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKShape\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKEditable") }, "init");
    if (self)
    {
        _slideBase = objj_msgSend(aCoder, "decodeObjectForKey:", SKShapeSlideBaseKey);
        _locks = objj_msgSend(aCoder, "decodeIntForKey:", SKShapeLocksKey);
        _size = objj_msgSend(aCoder, "decodeSizeForKey:", SKShapeSizeKey);
        _position = objj_msgSend(aCoder, "decodePointForKey:", SKShapePositionKey);
        _isFlippedHorizontal = objj_msgSend(aCoder, "decodeBoolForKey:", SKShapeFlippedHorizontalKey);
        _isFlippedVertical = objj_msgSend(aCoder, "decodeBoolForKey:", SKShapeFlippedVerticalKey);
        _rotationRadians = objj_msgSend(aCoder, "decodeFloatForKey:", SKShapeRotationRadiansKey);
        _geometryName = objj_msgSend(aCoder, "decodeObjectForKey:", SKShapeGeometryNameKey);
        _adjustments = objj_msgSend(objj_msgSend(SKGeometry, "geometryForName:", _geometryName), "adjustments");
        _fill = objj_msgSend(aCoder, "decodeObjectForKey:", SKShapeFillKey);
        if (objj_msgSend(aCoder, "containsValueForKey:", SKShapeOpacityKey))
            _opacity = objj_msgSend(aCoder, "decodeFloatForKey:", SKShapeOpacityKey);
        else
            _opacity = 1.0;
        _fillColor = objj_msgSend(aCoder, "decodeObjectForKey:", SKShapeFillColorKey);
        _strokeColor = objj_msgSend(aCoder, "decodeObjectForKey:", SKShapeStrokeColorKey);
        _strokeWidth = objj_msgSend(aCoder, "decodeFloatForKey:", SKShapeStrokeWidthKey);
        if (!_fill && _fillColor)
            _fill = objj_msgSend(SKFill, "solidFillWithColor:", objj_msgSend(SKColor, "colorWithColor:adjustments:", _fillColor, nil));
        _adjustmentValues = objj_msgSend(aCoder, "decodeObjectForKey:", SKShapeAdjustmentValuesKey);
        _textBody = objj_msgSend(aCoder, "decodeObjectForKey:", SKShapeTextBodyKey);
        _isPlaceholder = objj_msgSend(aCoder, "decodeObjectForKey:", SKShapeIsPlaceholderKey);
        if (_isPlaceholder)
        {
            _placeholderType = objj_msgSend(aCoder, "decodeIntForKey:", SKShapePlaceholderTypeKey);
            _placeholderIdx = objj_msgSend(aCoder, "decodeIntForKey:", SKShapePlaceholderIdxKey);
        }
    }
    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSend(aCoder, "encodeConditionalObject:forKey:", _slideBase, SKShapeSlideBaseKey);
    objj_msgSend(aCoder, "encodeInt:forKey:", _locks, SKShapeLocksKey);
    objj_msgSend(aCoder, "encodeSize:forKey:", _size, SKShapeSizeKey);
    objj_msgSend(aCoder, "encodePoint:forKey:", _position, SKShapePositionKey);
    objj_msgSend(aCoder, "encodeBool:forKey:", _isFlippedHorizontal, SKShapeFlippedHorizontalKey);
    objj_msgSend(aCoder, "encodeBool:forKey:", _isFlippedVertical, SKShapeFlippedVerticalKey);
    objj_msgSend(aCoder, "encodeFloat:forKey:", _rotationRadians, SKShapeRotationRadiansKey);
    objj_msgSend(aCoder, "encodeObject:forKey:", _geometryName, SKShapeGeometryNameKey);
    objj_msgSend(aCoder, "encodeObject:forKey:", _adjustmentValues, SKShapeAdjustmentValuesKey);
    objj_msgSend(aCoder, "encodeObject:forKey:", _fill, SKShapeFillKey);
    objj_msgSend(aCoder, "encodeFloat:forKey:", _opacity, SKShapeOpacityKey);
    objj_msgSend(aCoder, "encodeObject:forKey:", objj_msgSend(_textBody, "string"), SKShapeTextBodyKey);
    objj_msgSend(aCoder, "encodeBool:forKey:", _isPlaceholder, SKShapeIsPlaceholderKey);
    if (_isPlaceholder)
    {
        objj_msgSend(aCoder, "encodeInt:forKey:", _placeholderType, SKShapePlaceholderTypeKey);
        objj_msgSend(aCoder, "encodeInt:forKey:", _placeholderIdx, SKShapePlaceholderIdxKey);
    }
}
});
class_addMethods(the_class, instance_methods);
}

p;14;SKShapeLayer.ji;9;SKShape.ji;19;SKGeometryDrawing.ji;11;TextLayer.jc;28539;



var SKShapeLayerPlaceholderBorderColor = nil;

{var the_class = objj_allocateClassPair(CALayer, "SKShapeLayer"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_shape"), new objj_ivar("_isFlippedHorizontal"), new objj_ivar("_isFlippedVertical"), new objj_ivar("_rotationRadians"), new objj_ivar("_adjustmentValues"), new objj_ivar("_geometry"), new objj_ivar("_fill"), new objj_ivar("_opacity"), new objj_ivar("_allowsRotation"), new objj_ivar("_slideLayer"), new objj_ivar("_displaysPlaceholderPrompt"), new objj_ivar("_isTextEditing"), new objj_ivar("_textLayer"), new objj_ivar("_auxiliaryLayers"), new objj_ivar("_auxiliaryLayersForObservedKeyPaths"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("initialize"), function(self, _cmd)
{ with(self)
{
    if (self != objj_msgSend(SKShapeLayer, "class"))
        return;

    SKShapeLayerPlaceholderBorderColor = objj_msgSend(CPColor, "lightGrayColor");
}
});
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CALayer") }, "init");

    if (self)
    {
        _isFlippedHorizontal = NO;
        _isFlippedVertical = NO;
        _allowsRotation = YES;

        _auxiliaryLayers = objj_msgSend(CPDictionary, "dictionary");
        _auxiliaryLayersForObservedKeyPaths = objj_msgSend(CPDictionary, "dictionary");

        objj_msgSend(self, "setNeedsDisplayOnBoundsChange:", YES);

        _fill = objj_msgSend(objj_msgSend(SKSolidFill, "alloc"), "initWithColor:", objj_msgSend(SKColor, "colorWithPresetName:adjustments:", SKAliceBluePresetColorName, nil));


    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("setShape:"), function(self, _cmd, aShape)
{ with(self)
{
    if (_shape == aShape)
        return;

    var defaultCenter = objj_msgSend(CPNotificationCenter, "defaultCenter");

    if (_shape)
        objj_msgSend(defaultCenter, "removeObserver:name:object:", self, nil, _shape);

    _shape = aShape;


    _adjustmentValues = objj_msgSend(CPDictionary, "dictionary");

    var values = objj_msgSend(_shape, "adjustmentValues"),
        key,
        keys = objj_msgSend(values, "keyEnumerator");

    while (key = objj_msgSend(keys, "nextObject"))
        objj_msgSend(_adjustmentValues, "setObject:forKey:", CGPointMakeCopy(objj_msgSend(values, "objectForKey:", key)), key);
    _geometry = objj_msgSend(SKGeometry, "geometryForName:", objj_msgSend(_shape, "geometryName"));


    if (_shape)
    {
        objj_msgSend(defaultCenter, "addObserver:selector:name:object:", self, sel_registerName("elementDidChangeGeometry:"), ElementGeometryDidChangeNotification, _shape);

        objj_msgSend(defaultCenter, "addObserver:selector:name:object:", self, sel_registerName("shapeDidChangeAdjustmentValue:"), SKShapeAdjustmentValueDidChangeNotification, _shape);

        objj_msgSend(defaultCenter, "addObserver:selector:name:object:", self, sel_registerName("shapeDidChangeTextBody:"), SKShapeTextBodyDidChangeNotification, _shape);

        objj_msgSend(defaultCenter, "addObserver:selector:name:object:", self, sel_registerName("shapeDidChangeFill:"), SKShapeFillDidChangeNotification, _shape);

        objj_msgSend(defaultCenter, "addObserver:selector:name:object:", self, sel_registerName("shapeDidChangeOpacity:"), SKShapeOpacityDidChangeNotification, _shape);

        var size = objj_msgSend(_shape, "size");

        objj_msgSend(self, "setBounds:", CGRectMake(0.0,0.0,size.width,size.height));
        objj_msgSend(self, "setPosition:", objj_msgSend(_shape, "position"));
        objj_msgSend(self, "setRotationRadians:", objj_msgSend(_shape, "rotationRadians"));
        objj_msgSend(self, "setFlippedHorizontal:", objj_msgSend(_shape, "isFlippedHorizontal"));
        objj_msgSend(self, "setFlippedVertical:", objj_msgSend(_shape, "isFlippedVertical"));

        objj_msgSend(self, "setFill:", objj_msgSend(_shape, "fill"));


        objj_msgSend(self, "setOpacity:", objj_msgSend(_shape, "opacity"));

        if (objj_msgSend(objj_msgSend(_shape, "textBody"), "length"))
        {
            objj_msgSend(self, "createTextLayerIfNecessary");

            objj_msgSend(_textLayer, "setDelegate:", nil);
            objj_msgSend(_textLayer, "setTextBody:", objj_msgSend(_shape, "textBody"));
            objj_msgSend(_textLayer, "setDelegate:", self);
        }
        else if (objj_msgSend(_shape, "isPlaceholder") && _displaysPlaceholderPrompt)
        {
            objj_msgSend(self, "createTextLayerIfNecessary");
            objj_msgSend(self, "updatePlaceholderPrompt");
        }
    }
}
});
instance_methods[2] = new objj_method(sel_registerName("shape"), function(self, _cmd)
{ with(self)
{
    return _shape;
}
});
instance_methods[3] = new objj_method(sel_registerName("slideMaster"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(_shape, "slideMaster");
}
});
instance_methods[4] = new objj_method(sel_registerName("elementDidChangeGeometry:"), function(self, _cmd, aNotification)
{ with(self)
{
    var size = objj_msgSend(_shape, "size");

    objj_msgSend(self, "setBounds:", CGRectMake(0.0,0.0,size.width,size.height));
    objj_msgSend(self, "setPosition:", CGPointMakeCopy(objj_msgSend(_shape, "position")));
    objj_msgSend(self, "setRotationRadians:", objj_msgSend(_shape, "rotationRadians"));
    objj_msgSend(self, "setFlippedHorizontal:", objj_msgSend(_shape, "isFlippedHorizontal"));
    objj_msgSend(self, "setFlippedVertical:", objj_msgSend(_shape, "isFlippedVertical"));
}
});
instance_methods[5] = new objj_method(sel_registerName("shapeDidChangeAdjustmentValue:"), function(self, _cmd, aNotification)
{ with(self)
{
    var adjustmentName = objj_msgSend(objj_msgSend(aNotification, "userInfo"), "objectForKey:", SKShapeAdjustmentName);

    objj_msgSend(self, "setValue:forAdjustmentWithName:", objj_msgSend(_shape, "valueForAdjustmentWithName:", adjustmentName), adjustmentName);
}
});
instance_methods[6] = new objj_method(sel_registerName("shapeDidChangeTextBody:"), function(self, _cmd, aNotification)
{ with(self)
{
    var textBody = objj_msgSend(_shape, "textBody");

    if (objj_msgSend(textBody, "isEqual:", objj_msgSend(_textLayer, "textBody")))
        return;

    objj_msgSend(self, "createTextLayerIfNecessary");

    objj_msgSend(_textLayer, "setTextBody:", objj_msgSend(_shape, "textBody"));
}
});
instance_methods[7] = new objj_method(sel_registerName("shapeDidChangeFill:"), function(self, _cmd, aNotification)
{ with(self)
{
    objj_msgSend(self, "setFill:", objj_msgSend(_shape, "fill"));
}
});
instance_methods[8] = new objj_method(sel_registerName("shapeDidChangeOpacity:"), function(self, _cmd, aNotification)
{ with(self)
{
    objj_msgSend(self, "setOpacity:", objj_msgSend(_shape, "opacity"));
}
});
instance_methods[9] = new objj_method(sel_registerName("setBounds:"), function(self, _cmd, bounds)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CALayer") }, "setBounds:", bounds);
    objj_msgSend(_textLayer, "setBounds:", bounds);

    objj_msgSend(self, "updateAuxiliaryLayersObservingKeyPath:", "bounds");
}
});
instance_methods[10] = new objj_method(sel_registerName("setPosition:"), function(self, _cmd, aPosition)
{ with(self)
{
    if (CGPointEqualToPoint(_position, aPosition))
        return;

    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CALayer") }, "setPosition:", aPosition);

    objj_msgSend(self, "updateAuxiliaryLayersObservingKeyPath:", "position");
}
});
instance_methods[11] = new objj_method(sel_registerName("setRotationRadians:"), function(self, _cmd, rotationRadians)
{ with(self)
{
    if (_rotationRadians == rotationRadians)
        return;

    _rotationRadians = rotationRadians;

    objj_msgSend(self, "transform");

    objj_msgSend(self, "updateAuxiliaryLayersObservingKeyPath:", "rotationRadians");
}
});
instance_methods[12] = new objj_method(sel_registerName("rotationRadians"), function(self, _cmd)
{ with(self)
{



    return _rotationRadians;
}
});
instance_methods[13] = new objj_method(sel_registerName("setFlippedHorizontal:"), function(self, _cmd, isFlippedHorizontal)
{ with(self)
{
    if (_isFlippedHorizontal == isFlippedHorizontal)
        return;

    _isFlippedHorizontal = isFlippedHorizontal;

    objj_msgSend(self, "transform");
}
});
instance_methods[14] = new objj_method(sel_registerName("isFlippedHorizontal"), function(self, _cmd)
{ with(self)
{
    return _isFlippedHorizontal;
}
});
instance_methods[15] = new objj_method(sel_registerName("setFlippedVertical:"), function(self, _cmd, isFlippedVertical)
{ with(self)
{
    if (_isFlippedVertical == isFlippedVertical)
        return;

    _isFlippedVertical = isFlippedVertical;

    objj_msgSend(self, "transform");
}
});
instance_methods[16] = new objj_method(sel_registerName("isFlippedVertical"), function(self, _cmd)
{ with(self)
{
    return _isFlippedVertical;
}
});
instance_methods[17] = new objj_method(sel_registerName("transform"), function(self, _cmd)
{ with(self)
{

    objj_msgSend(self, "setAffineTransform:", CGAffineTransformScale(CGAffineTransformMakeRotation(_rotationRadians),_isFlippedHorizontal?-1.0:1.0,_isFlippedVertical?-1.0:1.0));

}
});
instance_methods[18] = new objj_method(sel_registerName("increaseBulletLevel"), function(self, _cmd)
{ with(self)
{
    if(!_isTextEditing)
        return;

    if(_textLayer)
        objj_msgSend(_textLayer, "increaseBulletLevel");

    objj_msgSend(self, "setNeedsDisplay");

}
});
instance_methods[19] = new objj_method(sel_registerName("decreaseBulletLevel"), function(self, _cmd)
{ with(self)
{
    if(!_isTextEditing)
        return;

    if(_textLayer)
        objj_msgSend(_textLayer, "decreaseBulletLevel");

    objj_msgSend(self, "setNeedsDisplay");

}
});
instance_methods[20] = new objj_method(sel_registerName("setFontSize:"), function(self, _cmd, aSize)
{ with(self)
{
    objj_msgSend(_textLayer, "setFontSize:", aSize);
}
});
instance_methods[21] = new objj_method(sel_registerName("setFontFamily:"), function(self, _cmd, aFontFamily)
{ with(self)
{
    objj_msgSend(_textLayer, "setFontFamily:", aFontFamily);
}
});
instance_methods[22] = new objj_method(sel_registerName("setFill:"), function(self, _cmd, aFill)
{ with(self)
{
    if (_fill == aFill)
        return;

    _fill = aFill;

    objj_msgSend(self, "setNeedsDisplay");
}
});
instance_methods[23] = new objj_method(sel_registerName("setFillColor:"), function(self, _cmd, aColor)
{ with(self)
{
    objj_msgSend(self, "setFill:", objj_msgSend(SKFill, "solidFillWithColor:", aColor));
}
});
instance_methods[24] = new objj_method(sel_registerName("fillColor"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(_fill, "color");
}
});
instance_methods[25] = new objj_method(sel_registerName("setStrokeColor:"), function(self, _cmd, aColor)
{ with(self)
{
    if (_strokeColor == aColor)
        return;

    _strokeColor = aColor;

    objj_msgSend(self, "setNeedsDisplay");
}
});
instance_methods[26] = new objj_method(sel_registerName("strokeColor"), function(self, _cmd)
{ with(self)
{
    return _strokeColor;
}
});
instance_methods[27] = new objj_method(sel_registerName("adjustments"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(_shape, "adjustments");
}
});
instance_methods[28] = new objj_method(sel_registerName("adjustmentValues"), function(self, _cmd)
{ with(self)
{
    return _adjustmentValues;
}
});
instance_methods[29] = new objj_method(sel_registerName("valueForAdjustmentWithName:"), function(self, _cmd, aName)
{ with(self)
{
    return objj_msgSend(_adjustmentValues, "objectForKey:", aName);
}
});
instance_methods[30] = new objj_method(sel_registerName("setValue:forAdjustmentWithName:"), function(self, _cmd, aValue, aName)
{ with(self)
{
    objj_msgSend(_adjustmentValues, "setObject:forKey:", objj_msgSend(objj_msgSend(objj_msgSend(self, "adjustments"), "objectForKey:", aName), "actualValueForProposedValue:", aValue), aName);

    objj_msgSend(self, "setNeedsDisplay");

    objj_msgSend(self, "updateAuxiliaryLayersObservingKeyPath:", "adjustmentValues."+aName);
}
});
instance_methods[31] = new objj_method(sel_registerName("hitTest:"), function(self, _cmd, aPoint)
{ with(self)
{

    if (objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CALayer") }, "hitTest:", aPoint))
        return self;

    return nil;
}
});
instance_methods[32] = new objj_method(sel_registerName("setDisplaysPlaceholderPrompt:"), function(self, _cmd, shouldDisplayPlaceholderPrompt)
{ with(self)
{
    if (_displaysPlaceholderPrompt == shouldDisplayPlaceholderPrompt)
        return;

    _displaysPlaceholderPrompt = shouldDisplayPlaceholderPrompt;

    objj_msgSend(self, "setNeedsDisplay");

    if (objj_msgSend(_shape, "isPlaceholder") && _displaysPlaceholderPrompt)
    {
        objj_msgSend(self, "createTextLayerIfNecessary");
        objj_msgSend(self, "updatePlaceholderPrompt");
    }
}
});
instance_methods[33] = new objj_method(sel_registerName("displaysPlaceholderPrompt"), function(self, _cmd)
{ with(self)
{
    return _displaysPlaceholderPrompt;
}
});
instance_methods[34] = new objj_method(sel_registerName("setDefaultTextAttributes:"), function(self, _cmd, attributes)
{ with(self)
{
    objj_msgSend(_textLayer, "setDefaultTextAttributes:", attributes);
}
});
instance_methods[35] = new objj_method(sel_registerName("applyDefaultTextAttributes"), function(self, _cmd)
{ with(self)
{
    var slideMaster = objj_msgSend(objj_msgSend(objj_msgSend(self, "shape"), "slideBase"), "slideMaster");

    if (_textLayer)
        _textLayer._slideMaster = slideMaster;

    if (objj_msgSend(_shape, "isPlaceholder"))
    {
        var placeholderType = objj_msgSend(_shape, "placeholderType");

        if (placeholderType == SKShapeCenterdTitlePlaceholderType || placeholderType == SKShapeTitlePlaceholderType)
            objj_msgSend(_textLayer, "setDefaultTextAttributes:", objj_msgSend(slideMaster, "titleTextAttributes"));
        else if (placeholderType == SKShapeSubtitlePlaceholderType)
            objj_msgSend(_textLayer, "setDefaultTextAttributes:", objj_msgSend(slideMaster, "otherTextAttributes"));
        else
            objj_msgSend(_textLayer, "setDefaultTextAttributes:", objj_msgSend(slideMaster, "bodyTextAttributes"));
    }
    else
        objj_msgSend(_textLayer, "setDefaultTextAttributes:", objj_msgSend(slideMaster, "otherTextAttributes"));
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}

{
var the_class = objj_getClass("SKShapeLayer")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKShapeLayer\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("createTextLayerIfNecessary"), function(self, _cmd)
{ with(self)
{
    if (_textLayer)
        return;

    var bounds = objj_msgSend(self, "bounds");

    _textLayer = objj_msgSend(TextLayer, "layer");
    _textLayer._undoManager = objj_msgSend(_shape, "undoManager");

    objj_msgSend(_textLayer, "setBounds:", objj_msgSend(self, "bounds"));

    objj_msgSend(_textLayer, "setAnchorPoint:", CGPointMake(0.0,0.0));
    objj_msgSend(_textLayer, "setPosition:", CGPointMake(0.0,0.0));

    var size = objj_msgSend(self, "bounds").size;

    objj_msgSend(_textLayer, "setBounds:", CGRectMake(0.0,0.0,size.width,size.height));

    objj_msgSend(self, "applyDefaultTextAttributes");

    if (objj_msgSend(self, "superlayer"))
        objj_msgSend(_textLayer, "setTextScale:", objj_msgSend(objj_msgSend(self, "superlayer"), "textScale"));

    objj_msgSend(self, "addSublayer:", _textLayer);

    objj_msgSend(_textLayer, "setDelegate:", self);
}
});
instance_methods[1] = new objj_method(sel_registerName("FIXME_updateTextScale"), function(self, _cmd)
{ with(self)
{
    objj_msgSend(_textLayer, "setTextScale:", objj_msgSend(objj_msgSend(self, "superlayer"), "textScale"));
}
});
instance_methods[2] = new objj_method(sel_registerName("updatePlaceholderPrompt"), function(self, _cmd)
{ with(self)
{
    if (_displaysPlaceholderPrompt && objj_msgSend(_shape, "isPlaceholder") && objj_msgSend(objj_msgSend(_shape, "textBody"), "length") == 0)
    {
        objj_msgSend(_textLayer, "setDelegate:", nil);
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");
        objj_msgSend(_textLayer, "setStringValue:", objj_msgSend(_shape, "placeholderPrompt"));
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
        objj_msgSend(_textLayer, "setDelegate:", self);
    }
}
});
instance_methods[3] = new objj_method(sel_registerName("allowsTextEditing"), function(self, _cmd)
{ with(self)
{
    return _rotationRadians == 0.0;
}
});
instance_methods[4] = new objj_method(sel_registerName("beginTextEditing"), function(self, _cmd)
{ with(self)
{
    _isTextEditing = YES;

    objj_msgSend(self, "createTextLayerIfNecessary");

    objj_msgSend(_textLayer, "becomeFirstResponder");

    if (objj_msgSend(objj_msgSend(_shape, "textBody"), "length") == 0)
    {
        objj_msgSend(_textLayer, "setDelegate:", nil);
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");
        objj_msgSend(_textLayer, "setStringValue:", "");
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
        objj_msgSend(_textLayer, "setDelegate:", self);
    }

    objj_msgSend(self, "setNeedsDisplay");
}
});
instance_methods[5] = new objj_method(sel_registerName("endTextEditing"), function(self, _cmd)
{ with(self)
{

    objj_msgSend(_textLayer, "resignFirstResponder");

    _isTextEditing = NO;

    objj_msgSend(self, "setNeedsDisplay");

    objj_msgSend(self, "updatePlaceholderPrompt");
}
});
instance_methods[6] = new objj_method(sel_registerName("isTextEditing"), function(self, _cmd)
{ with(self)
{
    return _isTextEditing;
}
});
instance_methods[7] = new objj_method(sel_registerName("textDidChange:"), function(self, _cmd, aTextLayer)
{ with(self)
{
    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        return;

    objj_msgSend(_shape, "beginEditing");
    objj_msgSend(_shape, "setTextBody:", objj_msgSend(aTextLayer, "textBody"));
    objj_msgSend(_shape, "endEditing");
}
});
instance_methods[8] = new objj_method(sel_registerName("keyDown:"), function(self, _cmd, anEvent)
{ with(self)
{
    objj_msgSend(_textLayer, "keyDown:", anEvent);
}
});
instance_methods[9] = new objj_method(sel_registerName("mouseUp:"), function(self, _cmd, anEvent)
{ with(self)
{
    objj_msgSend(_textLayer, "mouseUp:", anEvent);
}
});
instance_methods[10] = new objj_method(sel_registerName("mouseDown:"), function(self, _cmd, anEvent)
{ with(self)
{
    objj_msgSend(_textLayer, "mouseDown:", anEvent);
}
});
instance_methods[11] = new objj_method(sel_registerName("mouseDragged:"), function(self, _cmd, anEvent)
{ with(self)
{
    objj_msgSend(_textLayer, "mouseDragged:", anEvent);
}
});
instance_methods[12] = new objj_method(sel_registerName("drawInContext:"), function(self, _cmd, aContext)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CALayer") }, "drawInContext:", aContext);

    var bounds = objj_msgSend(self, "bounds");

    if (_fill && _geometry)
    {
        objj_msgSend(_geometry, "setPathForContext:bounds:adjustments:", aContext, bounds, _adjustmentValues);
        objj_msgSend(_fill, "fillPathInLayer:Context:", self, aContext);

        return;
    }


    if (_isTextEditing || objj_msgSend(_shape, "isPlaceholder") && !objj_msgSend(objj_msgSend(_shape, "textBody"), "length") && _displaysPlaceholderPrompt)
    {
        var scale = objj_msgSend(objj_msgSend(self, "superlayer"), "textScale");

        CGContextSetLineWidth(aContext, 1.0 / scale);
        CGContextSetStrokeColor(aContext, SKShapeLayerPlaceholderBorderColor);
        CGContextStrokeRect(aContext, CGRectInset(bounds, 1.0 / scale, 1.0 / scale));
    }
}
});
instance_methods[13] = new objj_method(sel_registerName("isDisplayingPlaceholderPrompt"), function(self, _cmd)
{ with(self)
{
    return _displaysPlaceholderPrompt && !_isTextEditing && objj_msgSend(_shape, "isPlaceholder") && !objj_msgSend(objj_msgSend(_shape, "textBody"), "length");
}
});
instance_methods[14] = new objj_method(sel_registerName("bold:"), function(self, _cmd, aSender)
{ with(self)
{
    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");

    objj_msgSend(_textLayer, "bold:", aSender);

    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
}
});
instance_methods[15] = new objj_method(sel_registerName("unbold:"), function(self, _cmd, aSender)
{ with(self)
{
    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");

    objj_msgSend(_textLayer, "unbold:", aSender);

    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
}
});
instance_methods[16] = new objj_method(sel_registerName("italicize:"), function(self, _cmd, aSender)
{ with(self)
{
    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");

    objj_msgSend(_textLayer, "italicize:", aSender);

    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
}
});
instance_methods[17] = new objj_method(sel_registerName("unitalicize:"), function(self, _cmd, aSender)
{ with(self)
{
    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");

    objj_msgSend(_textLayer, "unitalicize:", aSender);

    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
}
});
instance_methods[18] = new objj_method(sel_registerName("underline:"), function(self, _cmd, aSender)
{ with(self)
{
    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");

    objj_msgSend(_textLayer, "underline:", aSender);

    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
}
});
instance_methods[19] = new objj_method(sel_registerName("ununderline:"), function(self, _cmd, aSender)
{ with(self)
{
    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");

    objj_msgSend(_textLayer, "ununderline:", aSender);

    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
}
});
instance_methods[20] = new objj_method(sel_registerName("setTextColor:"), function(self, _cmd, aColor)
{ with(self)
{
    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");

    objj_msgSend(_textLayer, "setTextColor:", aColor);

    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
}
});
instance_methods[21] = new objj_method(sel_registerName("align:"), function(self, _cmd, anAlignmentMask)
{ with(self)
{
    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");

    objj_msgSend(_textLayer, "align:", anAlignmentMask);

    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
}
});
instance_methods[22] = new objj_method(sel_registerName("bulletStyle:"), function(self, _cmd, aBulletStyleMask)
{ with(self)
{
    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "disableUndoRegistration");

    objj_msgSend(_textLayer, "bulletStyle:", aBulletStyleMask);

    if (objj_msgSend(self, "isDisplayingPlaceholderPrompt"))
        objj_msgSend(objj_msgSend(_shape, "undoManager"), "enableUndoRegistration");
}
});
instance_methods[23] = new objj_method(sel_registerName("selectedTextAttributes"), function(self, _cmd)
{ with(self)
{
    if (_textLayer)
        return objj_msgSend(_textLayer, "typingTextAttributes");

    return objj_msgSend(objj_msgSend(self, "shape"), "computedDefaultTextAttributes");
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKShapeLayer")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKShapeLayer\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("auxiliaryLayers"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(_auxiliaryLayers, "allValues");
}
});
instance_methods[1] = new objj_method(sel_registerName("addAuxiliaryLayer:forKey:"), function(self, _cmd, aLayer, aKey)
{ with(self)
{
    objj_msgSend(window.the_layer, "addSublayer:", aLayer);

    objj_msgSend(_auxiliaryLayers, "setObject:forKey:", aLayer, aKey);

    objj_msgSend(aLayer, "setElementLayer:", self);

    var observedKeyPaths = objj_msgSend(aLayer, "observedKeyPaths"),
        count = observedKeyPaths.length;

    while (count--)
    {
        var array = objj_msgSend(_auxiliaryLayersForObservedKeyPaths, "objectForKey:", observedKeyPaths[count]);

        if (!array)
            objj_msgSend(_auxiliaryLayersForObservedKeyPaths, "setObject:forKey:", [aLayer], observedKeyPaths[count]);
        else
            array.push(aLayer);
    }
}
});
instance_methods[2] = new objj_method(sel_registerName("removeAuxiliaryLayerForKey:"), function(self, _cmd, aKey)
{ with(self)
{
    var layer = objj_msgSend(_auxiliaryLayers, "objectForKey:", aKey);

    objj_msgSend(layer, "setElementLayer:", nil);
    objj_msgSend(_auxiliaryLayers, "removeObjectForKey:", aKey);

    var observedKeyPaths = objj_msgSend(layer, "observedKeyPaths"),
        count = objj_msgSend(observedKeyPaths, "count");

    while (count--)
        objj_msgSend(objj_msgSend(_auxiliaryLayersForObservedKeyPaths, "objectForKey:", observedKeyPaths[count]), "removeObjectIdenticalTo:", layer);

    objj_msgSend(layer, "removeFromSuperlayer");
}
});
instance_methods[3] = new objj_method(sel_registerName("removeAuxiliaryLayersForKeys:"), function(self, _cmd, keys)
{ with(self)
{
    var count = objj_msgSend(keys, "count");

    while (count--)
        objj_msgSend(self, "removeAuxiliaryLayerForKey:", keys[count]);
}
});
instance_methods[4] = new objj_method(sel_registerName("auxiliaryLayerForKey:"), function(self, _cmd, aKey)
{ with(self)
{
    return objj_msgSend(_auxiliaryLayers, "objectForKey:", aKey);
}
});
instance_methods[5] = new objj_method(sel_registerName("updateAuxiliaryLayersObservingKeyPath:"), function(self, _cmd, aKeyPath)
{ with(self)
{
    var layers = objj_msgSend(_auxiliaryLayersForObservedKeyPaths, "objectForKey:", aKeyPath),
        count = objj_msgSend(layers, "count");

    while (count--)
    {
        layer = layers[count];

        if (!objj_msgSend(layer, "isHidden"))
            objj_msgSend(layer, "updateFromElementLayer");
    }
}
});
instance_methods[6] = new objj_method(sel_registerName("copy:"), function(self, _cmd, sender)
{ with(self)
{
    objj_msgSend(_textLayer, "copy:", self);
}
});
instance_methods[7] = new objj_method(sel_registerName("paste:"), function(self, _cmd, sender)
{ with(self)
{
    objj_msgSend(_textLayer, "paste:", self);
}
});
instance_methods[8] = new objj_method(sel_registerName("cut:"), function(self, _cmd, sender)
{ with(self)
{
    objj_msgSend(_textLayer, "cut:", self);
}
});
class_addMethods(the_class, instance_methods);
}

p;9;SKSlide.jI;21;Foundation/CPObject.jI;23;Foundation/CPIndexSet.ji;12;SKEditable.ji;9;SKShape.ji;13;SKSlideBase.jc;5840;


SKSlidesPboardType = "SKSlidesPboardType";

SKSlideSlideLayoutDidChangeNotification = "SKSlideSlideLayoutDidChangeNotification";


{var the_class = objj_allocateClassPair(SKSlideBase, "SKSlide"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_presentation"), new objj_ivar("_slideLayout"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithSlideLayout:"), function(self, _cmd, aSlideLayout)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "init");

    if (self)
        objj_msgSend(self, "setSlideLayout:", aSlideLayout);

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("initWithPresentation:"), function(self, _cmd, aPresentation)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "init");

    if (self)
    {
        _presentation = aPresentation;

        objj_msgSend(self, "setUndoManager:", objj_msgSend(aPresentation, "undoManager"));


        objj_msgSend(self, "setSlideLayout:", objj_msgSend(aPresentation, "defaultSlideLayout"));
    }

    return self;
}
});
instance_methods[2] = new objj_method(sel_registerName("presentation"), function(self, _cmd)
{ with(self)
{
    return _presentation;
}
});
instance_methods[3] = new objj_method(sel_registerName("size"), function(self, _cmd)
{ with(self)
{
    return _presentation ? objj_msgSend(_presentation, "size") : CGSizeMake(800, 600);
}
});
instance_methods[4] = new objj_method(sel_registerName("backgroundFill"), function(self, _cmd)
{ with(self)
{
    return objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "backgroundFill") || objj_msgSend(_slideLayout, "backgroundFill");
}
});
instance_methods[5] = new objj_method(sel_registerName("didInsertShapes:atIndexes:"), function(self, _cmd, shapes, indexes)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "didInsertShapes:atIndexes:", shapes, indexes);

    var count = objj_msgSend(shapes, "count");

    while (count--)
        objj_msgSend(shapes[count], "setUndoManager:", _undoManager);
}
});
instance_methods[6] = new objj_method(sel_registerName("transition"), function(self, _cmd)
{ with(self)
{
    return _transition || objj_msgSend(_slideLayout, "transition");
}
});
instance_methods[7] = new objj_method(sel_registerName("setUndoManager:"), function(self, _cmd, anUndoManager)
{ with(self)
{
    if (_undoManager == anUndoManager)
        return;

    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "setUndoManager:", anUndoManager);

    var count = _shapes.length;

    while (count--)
        objj_msgSend(_shapes[count], "setUndoManager:", anUndoManager);
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKSlide")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSlide\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setSlideLayout:"), function(self, _cmd, aSlideLayout)
{ with(self)
{

    if (!aSlideLayout)
        objj_msgSend(CPException, "raise:reason:", CPInvalidArgumentException, "*** Attempt to set nil slide layout");

    if (_slideLayout == aSlideLayout)
        return;

    objj_msgSend(self, "registerEditingUndoWithSelector:object:", sel_registerName("setSlideLayout:"), _slideLayout);

    _slideLayout = aSlideLayout;


    objj_msgSend(_undoManager, "disableUndoRegistration");

    objj_msgSend(self, "updatePlaceholdersWithSlideBase:andAddMissingPlaceholders:", _slideLayout, YES);

    objj_msgSend(_undoManager, "enableUndoRegistration");

    objj_msgSend(objj_msgSend(CPNotificationCenter, "defaultCenter"), "postNotificationName:object:", SKSlideSlideLayoutDidChangeNotification, self);
}
});
instance_methods[1] = new objj_method(sel_registerName("slideLayout"), function(self, _cmd)
{ with(self)
{
    return _slideLayout;
}
});
instance_methods[2] = new objj_method(sel_registerName("slideMaster"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(_slideLayout, "slideMaster");
}
});
class_addMethods(the_class, instance_methods);
}

var SKSlideTitleKey = "SKSlideTitleKey";
var SKSlidePresentationKey = "SKSlidePresentationKey";
var SKSlideSlideLayoutKey = "SKSlideSlideLayoutKey";

{
var the_class = objj_getClass("SKSlide")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSlide\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "initWithCoder:", aCoder);

    if (self)
    {
        _presentation = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlidePresentationKey);
        _slideLayout = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlideSlideLayoutKey);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "encodeWithCoder:", aCoder);

    objj_msgSend(aCoder, "encodeConditionalObject:forKey:", _presentation, SKSlidePresentationKey);
    objj_msgSend(aCoder, "encodeObject:forKey:", _slideLayout, SKSlideSlideLayoutKey);
}
});
class_addMethods(the_class, instance_methods);
}

p;13;SKSlideBase.jI;20;Foundation/CPArray.jI;21;Foundation/CPObject.ji;12;SKEditable.ji;8;SKFill.ji;9;SKShape.ji;14;SKTransition.jc;11768;


SKSlideBaseDidInsertShapesNotification = "SKSlideBaseDidInsertShapesNotification";
SKSlideBaseInsertedShapes = "SKSlideBaseInsertedShapes";
SKSlideBaseInsertedIndexes = "SKSlideBaseInsertedIndexes";

SKSlideBaseDidRemoveShapesNotification = "SKSlideBaseDidRemoveShapesNotification";
SKSlideBaseRemovedShapes = "SKSlideBaseRemovedShapes";
SKSlideBaseRemovedIndexes = "SKSlideBaseRemovedIndexes";

{var the_class = objj_allocateClassPair(SKEditable, "SKSlideBase"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_shapes"), new objj_ivar("_placeholderIndexes"), new objj_ivar("_transition"), new objj_ivar("_backgroundFill"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKEditable") }, "init");

    if (self)
    {
        _shapes = [];
        _placeholderIndexes = objj_msgSend(CPIndexSet, "indexSet");
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("setBackgroundFill:"), function(self, _cmd, aFill)
{ with(self)
{
    if (_backgroundFill == aFill)
        return;

    _backgroundFill = aFill;
}
});
instance_methods[2] = new objj_method(sel_registerName("backgroundFill"), function(self, _cmd)
{ with(self)
{
    return _backgroundFill;
}
});
instance_methods[3] = new objj_method(sel_registerName("addShape:"), function(self, _cmd, aShape)
{ with(self)
{
    objj_msgSend(self, "insertShapes:atIndexes:", [aShape], objj_msgSend(CPIndexSet, "indexSetWithIndex:", _shapes.length));
}
});
instance_methods[4] = new objj_method(sel_registerName("addShapes:"), function(self, _cmd, shapes)
{ with(self)
{
    objj_msgSend(self, "insertShapes:atIndexes:", shapes, objj_msgSend(CPIndexSet, "indexSetWithIndexesInRange:", CPMakeRange(_shapes.length,shapes.length)));
}
});
instance_methods[5] = new objj_method(sel_registerName("removeShape:"), function(self, _cmd, aShape)
{ with(self)
{
    var index = objj_msgSend(_shapes, "indexOfObjectIdenticalTo:", aShape);

    if (index == CPNotFound)
        return;

    objj_msgSend(self, "removeShapesAtIndexes:", objj_msgSend(CPIndexSet, "indexSetWithIndex:", index));
}
});
instance_methods[6] = new objj_method(sel_registerName("removeShapes:"), function(self, _cmd, shapes)
{ with(self)
{
    var count = objj_msgSend(shapes, "count"),
        indexes = objj_msgSend(CPIndexSet, "indexSet");

    while (count--)
    {
        var index = objj_msgSend(_shapes, "indexOfObjectIdenticalTo:", shapes[count]);

        if (index != CPNotFound)
            objj_msgSend(indexes, "addIndex:", index);
    }

    objj_msgSend(self, "removeShapesAtIndexes:", indexes);
}
});
instance_methods[7] = new objj_method(sel_registerName("insertShapes:atIndexes:"), function(self, _cmd, shapes, indexes)
{ with(self)
{
    if (shapes.length == 0)
        return;

    var index = 0,
        position = CPNotFound;

    while ((position = objj_msgSend(indexes, "indexGreaterThanIndex:", position)) != CPNotFound)
    {
        var shape = shapes[index++];

        shape._slideBase = self;
        _shapes.splice(position, 0, shape);

        if (objj_msgSend(shape, "isPlaceholder"))
            objj_msgSend(_placeholderIndexes, "addIndex:", position);
    }

    objj_msgSend(self, "didInsertShapes:atIndexes:", shapes, indexes);
}
});
instance_methods[8] = new objj_method(sel_registerName("removeShapesAtIndexes:"), function(self, _cmd, indexes)
{ with(self)
{
    var position = objj_msgSend(indexes, "lastIndex"),
        removed = [];

    if (position == CPNotFound)
        return;

    while (position != CPNotFound)
    {
        var shape = _shapes[position];

        removed.splice(0, 0, shape);
        _shapes.splice(position, 1);

        if (objj_msgSend(shape, "isPlaceholder"))
            objj_msgSend(_placeholderIndexes, "removeIndex:", position);

        position = objj_msgSend(indexes, "indexLessThanIndex:", position);
    }

    objj_msgSend(self, "didRemoveShapes:fromIndexes:", removed, indexes);
}
});
instance_methods[9] = new objj_method(sel_registerName("moveShapesAtIndexes:toIndexes:"), function(self, _cmd, fromIndexes, toIndexes)
{ with(self)
{
    if (objj_msgSend(fromIndexes, "isEqualToIndexSet:", toIndexes))
        return;

    var shapes = objj_msgSend(_shapes, "objectsAtIndexes:", fromIndexes);

    objj_msgSend(self, "removeShapesAtIndexes:", fromIndexes);
    objj_msgSend(self, "insertShapes:atIndexes:", shapes, toIndexes);
}
});
instance_methods[10] = new objj_method(sel_registerName("shapes"), function(self, _cmd)
{ with(self)
{
    return _shapes;
}
});
instance_methods[11] = new objj_method(sel_registerName("didInsertShapes:atIndexes:"), function(self, _cmd, shapes, indexes)
{ with(self)
{
    var userInfo = objj_msgSend(CPDictionary, "dictionary");

    objj_msgSend(userInfo, "setObject:forKey:", shapes, SKSlideBaseInsertedShapes);
    objj_msgSend(userInfo, "setObject:forKey:", indexes, SKSlideBaseInsertedIndexes);

    objj_msgSend(self, "registerEditingUndoWithSelector:object:", sel_registerName("removeShapesAtIndexes:"), objj_msgSend(indexes, "copy"));
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:userInfo:", SKSlideBaseDidInsertShapesNotification, self, userInfo));
}
});
instance_methods[12] = new objj_method(sel_registerName("didRemoveShapes:fromIndexes:"), function(self, _cmd, shapes, indexes)
{ with(self)
{
    var userInfo = objj_msgSend(CPDictionary, "dictionary");

    objj_msgSend(userInfo, "setObject:forKey:", shapes, SKSlideBaseRemovedShapes);
    objj_msgSend(userInfo, "setObject:forKey:", indexes, SKSlideBaseRemovedIndexes);

    objj_msgSend(objj_msgSend(self, "prepareWithInvocationTarget:", self), "insertShapes:atIndexes:", shapes, objj_msgSend(indexes, "copy"));
    objj_msgSend(self, "registerEditingNotification:", objj_msgSend(CPNotification, "notificationWithName:object:userInfo:", SKSlideBaseDidRemoveShapesNotification, self, userInfo));
}
});
instance_methods[13] = new objj_method(sel_registerName("placeholderIndexes"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(_placeholderIndexes, "copy");
}
});
instance_methods[14] = new objj_method(sel_registerName("matchingPlaceholderIndexForPlaceholder:"), function(self, _cmd, aPlaceholder)
{ with(self)
{
    var idx = objj_msgSend(aPlaceholder, "placeholderIdx"),
        type = objj_msgSend(aPlaceholder, "placeholderType"),

        typeMatchIndex = CPNotFound,

        index = CPNotFound;

    while ((index = objj_msgSend(_placeholderIndexes, "indexGreaterThanIndex:", index)) != CPNotFound)
    {
        var shape = _shapes[index];

        if (objj_msgSend(shape, "placeholderIdx") == idx)
            return index;

        if (objj_msgSend(shape, "placeholderType") == type)
            typeMatchIndex = index;
    }

    return typeMatchIndex;
}
});
instance_methods[15] = new objj_method(sel_registerName("updatePlaceholdersWithSlideBase:andAddMissingPlaceholders:"), function(self, _cmd, aSlideBase, shouldAddMissingPlaceholders)
{ with(self)
{
    var index = CPNotFound,
        removedIndexes = objj_msgSend(CPIndexSet, "indexSet"),

        slideBaseShapes = objj_msgSend(aSlideBase, "shapes"),
        slideBasePlaceholderIndexes = objj_msgSend(aSlideBase, "placeholderIndexes");

    while ((index = objj_msgSend(_placeholderIndexes, "indexGreaterThanIndex:", index)) != CPNotFound)
    {
        var placeholder = _shapes[index],
            matchIndex = objj_msgSend(aSlideBase, "matchingPlaceholderIndexForPlaceholder:", placeholder);


        if ((matchIndex == CPNotFound) && !objj_msgSend(objj_msgSend(placeholder, "textBody"), "length"))
            objj_msgSend(removedIndexes, "addIndex:", index);


        if (matchIndex != CPNotFound)
        {


            if (shouldAddMissingPlaceholders)
                objj_msgSend(slideBasePlaceholderIndexes, "removeIndex:", matchIndex);

            if (objj_msgSend(self, "isEditing"))
                objj_msgSend(placeholder, "beginEditing");

            objj_msgSend(placeholder, "copyPropertiesFromPlaceholder:", slideBaseShapes[matchIndex]);

            if (objj_msgSend(self, "isEditing"))
                objj_msgSend(placeholder, "endEditing");
        }


    }

    objj_msgSend(self, "removeShapesAtIndexes:", removedIndexes);

    if (shouldAddMissingPlaceholders)
    {
        index = CPNotFound;

        var placeholders = [],
            insertionIndexes = nil;


        while ((index = objj_msgSend(slideBasePlaceholderIndexes, "indexGreaterThanIndex:", index)) != CPNotFound)
        {
            placeholders.push(objj_msgSend(slideBaseShapes[index], "copy"));

            if (!insertionIndexes)
                insertionIndexes = objj_msgSend(CPIndexSet, "indexSetWithIndex:", _shapes.length);
            else
                objj_msgSend(insertionIndexes, "addIndex:", objj_msgSend(insertionIndexes, "lastIndex")+1);
        }

        objj_msgSend(self, "insertShapes:atIndexes:", placeholders, insertionIndexes);
    }
}
});
instance_methods[16] = new objj_method(sel_registerName("setTransition:"), function(self, _cmd, aTransition)
{ with(self)
{
    _transition = aTransition;
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKSlideBase")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSlideBase\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("copy"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(CPKeyedUnarchiver, "unarchiveObjectWithData:", objj_msgSend(CPKeyedArchiver, "archivedDataWithRootObject:", self));
}
});
class_addMethods(the_class, instance_methods);
}

var SKSlideBaseShapesKey = "SKSlideBaseShapesKey",
    SKSlideBasePlaceholderIndexesKey = "SKSlideBasePlaceholderIndexesKey",
    SKSlideBaseBackgroundFillKey = "SKSlideBaseBackgroundFillKey",
    SKSlideBaseTransitionKey = "SKSlideBaseTransitionKey";

{
var the_class = objj_getClass("SKSlideBase")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSlideBase\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKEditable") }, "init");

    if (self)
    {
        _shapes = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlideBaseShapesKey);
        _placeholderIndexes = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlideBasePlaceholderIndexesKey);

        _backgroundFill = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlideBaseBackgroundFillKey);

        _transition = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlideBaseTransitionKey);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSend(aCoder, "encodeObject:forKey:", _shapes, SKSlideBaseShapesKey);
    objj_msgSend(aCoder, "encodeObject:forKey:", _placeholderIndexes, SKSlideBasePlaceholderIndexesKey);

    objj_msgSend(aCoder, "encodeObject:forKey:", _backgroundFill, SKSlideBaseBackgroundFillKey);

    objj_msgSend(aCoder, "encodeObject:forKey:", _transition, SKSlideBaseTransitionKey);
}
});
class_addMethods(the_class, instance_methods);
}

p;18;SKSlideBaseLayer.jI;25;Foundation/CPDictionary.jI;16;AppKit/CALayer.ji;9;SKShape.ji;13;SKSlideBase.ji;14;SKShapeLayer.jc;15228;


var ClippedRegionsVerticalPadding = 10.0,
    ClippedRegionsHorizontalPadding = 10.0;

var slideBaseLayerDidInsertShapeLayersSelectorMask = 2,
    slideBaseLayerDidRemoveShapeLayersSelectorMask = 4;


{var the_class = objj_allocateClassPair(CALayer, "SKSlideBaseLayer"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_slideBase"), new objj_ivar("_shapeLayerCache"), new objj_ivar("_backgroundSlideBaseLayer"), new objj_ivar("_naturalBounds"), new objj_ivar("_displaysClippedRegions"), new objj_ivar("_slideBoundsWithoutPadding"), new objj_ivar("_delegate"), new objj_ivar("_delegateSelectors"), new objj_ivar("_displaysMoviesAsThumbnails"), new objj_ivar("_displaysPlaceholders"), new objj_ivar("_displaysPlaceholderPrompts"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CALayer") }, "init");

    if (self)
    {
        _naturalBounds = CGRectMakeZero();
        _shapeLayerCache = objj_msgSend(CPDictionary, "dictionary");

        objj_msgSend(self, "setMasksToBounds:", YES);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("setDelegate:"), function(self, _cmd, aDelegate)
{ with(self)
{
    _delegate = aDelegate;

    _delegateSelectors = 0;

    if (objj_msgSend(_delegate, "respondsToSelector:", sel_registerName("slideBaseLayer:didInsertShapeLayers:")))
        _delegateSelectors |= slideBaseLayerDidInsertShapeLayersSelectorMask;

    if (objj_msgSend(_delegate, "respondsToSelector:", sel_registerName("slideBaseLayer:didRemoveShapeLayers:")))
        _delegateSelectors |= slideBaseLayerDidRemoveShapeLayersSelectorMask;
}
});
instance_methods[2] = new objj_method(sel_registerName("delegate"), function(self, _cmd)
{ with(self)
{
    return _delegate;
}
});
instance_methods[3] = new objj_method(sel_registerName("setBackgroundSlideBaseLayer:"), function(self, _cmd, aSlideBaseLayer)
{ with(self)
{
    _backgroundSlideBaseLayer = aSlideBaseLayer;

    objj_msgSend(_backgroundSlideBaseLayer, "setDelegate:", self);
    objj_msgSend(_backgroundSlideBaseLayer, "setZPosition:", -1);

    objj_msgSend(self, "addSublayer:", _backgroundSlideBaseLayer);

    objj_msgSend(self, "slideBaseLayerDidChangeBounds:", _backgroundSlideBaseLayer);
}
});
instance_methods[4] = new objj_method(sel_registerName("backgroundSlideBaseLayer"), function(self, _cmd)
{ with(self)
{
    return _backgroundSlideBaseLayer;
}
});
instance_methods[5] = new objj_method(sel_registerName("setSlideBase:"), function(self, _cmd, aSlideBase)
{ with(self)
{
    if (_slideBase == aSlideBase)
        return;

    var defaultCenter = objj_msgSend(CPNotificationCenter, "defaultCenter");

    if (_slideBase)
    {
        objj_msgSend(defaultCenter, "removeObserver:name:object:", self, SKSlideBaseDidInsertShapesNotification, _slideBase);

        objj_msgSend(defaultCenter, "removeObserver:name:object:", self, SKSlideBaseDidRemoveShapesNotification, _slideBase);

        var layer = nil,
            layers = objj_msgSend(_shapeLayerCache, "objectEnumerator");

        while (layer = objj_msgSend(layers, "nextObject"))
            objj_msgSend(layer, "removeFromSuperlayer");

        objj_msgSend(_shapeLayerCache, "removeAllObjects");
    }

    _slideBase = aSlideBase;
    _naturalBounds = CGRectMake(0.0, 0.0, 800.0, 600.0);
    _slideBoundsWithoutPadding = CGRectMakeCopy(_naturalBounds);

    var shapes = objj_msgSend(aSlideBase, "shapes"),
        index = 0,
        count = objj_msgSend(shapes, "count");

    for (; index < count; ++index)
    {
        var shape = shapes[index];

        if (_displaysPlaceholders || !objj_msgSend(shape, "isPlaceholder"))
            objj_msgSend(self, "addSublayer:", objj_msgSend(self, "layerForShape:", shape));
    }

    if (_slideBase)
    {
        objj_msgSend(defaultCenter, "addObserver:selector:name:object:", self, sel_registerName("slideBaseDidInsertShapes:"), SKSlideBaseDidInsertShapesNotification, _slideBase);

        objj_msgSend(defaultCenter, "addObserver:selector:name:object:", self, sel_registerName("slideBaseDidRemoveShapes:"), SKSlideBaseDidRemoveShapesNotification, _slideBase);
    }

    if (_displaysClippedRegions)
        objj_msgSend(self, "_accomodateClippedRegions");
    else
        objj_msgSend(self, "setBounds:", _naturalBounds);
}
});
instance_methods[6] = new objj_method(sel_registerName("slideBase"), function(self, _cmd)
{ with(self)
{
    return _slideBase;
}
});
instance_methods[7] = new objj_method(sel_registerName("layerForShape:"), function(self, _cmd, aShape)
{ with(self)
{
    var hash = objj_msgSend(aShape, "hash"),
        cachedLayer = objj_msgSend(_shapeLayerCache, "objectForKey:", hash);

    if (!cachedLayer)
    {
        cachedLayer = objj_msgSend(objj_msgSend(SKSlideView, "shapeLayerClassForShapeClass:", objj_msgSend(aShape, "class")), "layer");

        if (objj_msgSend(cachedLayer, "isKindOfClass:", objj_msgSend(SKMovieLayer, "class")))
            objj_msgSend(cachedLayer, "setDisplaysAsThumbnail:", _displaysMoviesAsThumbnails);

        objj_msgSend(cachedLayer, "setShape:", aShape);

        if (_displaysPlaceholderPrompts && objj_msgSend(aShape, "isPlaceholder"))
            objj_msgSend(cachedLayer, "setDisplaysPlaceholderPrompt:", YES);

        objj_msgSend(_shapeLayerCache, "setObject:forKey:", cachedLayer, hash);
    }

    return cachedLayer;
}
});
instance_methods[8] = new objj_method(sel_registerName("slideBaseDidInsertShapes:"), function(self, _cmd, aNotification)
{ with(self)
{
    var userInfo = objj_msgSend(aNotification, "userInfo"),
        shapes = objj_msgSend(userInfo, "objectForKey:", SKSlideBaseInsertedShapes),
        indexes = objj_msgSend(userInfo, "objectForKey:", SKSlideBaseInsertedIndexes),
        index = 0,
        insertionIndex = CPNotFound,
        slideBounds = CGRectMakeCopy(_naturalBounds),
        shapeLayers = [],
        insertionOffset = objj_msgSend(self, "sublayers").length && !objj_msgSend(objj_msgSend(self, "sublayers")[0], "isKindOfClass:", objj_msgSend(SKShapeLayer, "class")) ? 1 : 0;

    while ((insertionIndex = objj_msgSend(indexes, "indexGreaterThanIndex:", insertionIndex)) != CPNotFound)
    {
        var shape = shapes[index++];

        if (!_displaysPlaceholders && objj_msgSend(shape, "isPlaceholder"))
            continue;

        var layer = objj_msgSend(self, "layerForShape:", shape);

        shapeLayers.push(layer);


        objj_msgSend(self, "insertSublayer:atIndex:", layer, insertionIndex+insertionOffset);


        if (objj_msgSend(objj_msgSend(shape, "textBody"), "length") || objj_msgSend(shape, "isPlaceholder"))
            objj_msgSend(layer, "FIXME_updateTextScale");

        if (_displaysClippedRegions)
            _slideBoundsWithoutPadding = CGRectUnion(_slideBoundsWithoutPadding, objj_msgSend(layer, "frame"));
    }

    if (_displaysClippedRegions && !CGRectEqualToRect(_slideBoundsWithoutPadding, slideBounds))
    {
        var slideBoundsWithPadding = CGRectMakeCopy(_slideBoundsWithoutPadding);

        if (CGRectGetMinX(_slideBoundsWithoutPadding) < CGRectGetMinX(slideBounds))
        {
            slideBoundsWithPadding.origin.x -= ClippedRegionsHorizontalPadding;
            slideBoundsWithPadding.size.width += ClippedRegionsHorizontalPadding;
        }
        if (CGRectGetMaxX(_slideBoundsWithoutPadding) > CGRectGetMaxX(slideBounds))
            slideBoundsWithPadding.size.width += ClippedRegionsHorizontalPadding;

        if (CGRectGetMinY(_slideBoundsWithoutPadding) < CGRectGetMinY(slideBounds))
        {
            slideBoundsWithPadding.origin.y -= ClippedRegionsVerticalPadding;
            slideBoundsWithPadding.size.height += ClippedRegionsVerticalPadding;
        }
        if (CGRectGetMaxY(_slideBoundsWithoutPadding) > CGRectGetMaxY(slideBounds))
            slideBoundsWithPadding.size.height += ClippedRegionsVerticalPadding;

        objj_msgSend(self, "setBounds:", slideBoundsWithPadding);
    }

    if (_delegateSelectors & slideBaseLayerDidInsertShapeLayersSelectorMask)
        objj_msgSend(_delegate, "slideBaseLayer:didInsertShapeLayers:", self, shapeLayers);
}
});
instance_methods[9] = new objj_method(sel_registerName("slideBaseDidRemoveShapes:"), function(self, _cmd, aNotification)
{ with(self)
{
    var userInfo = objj_msgSend(aNotification, "userInfo"),
        shapes = objj_msgSend(userInfo, "objectForKey:", SKSlideBaseRemovedShapes),
        index = shapes.length,
        shouldCheckLayerFrames = _displaysClippedRegions && !CGRectEqualToRect(_slideBoundsWithoutPadding, _naturalBounds),
        shouldRecalculateBounds = NO,
        shapeLayers = [];

    while (index--)
    {
        var layer = objj_msgSend(self, "layerForShape:", shapes[index]);

        if (shouldCheckLayerFrames && !shouldRecalculateBounds)
        {
            var frame = objj_msgSend(layer, "frame");

            shouldRecalculateBounds =
                CGRectGetMinX(frame) == CGRectGetMinX(_slideBoundsWithoutPadding) ||
                CGRectGetMinY(frame) == CGRectGetMinY(_slideBoundsWithoutPadding) ||
                CGRectGetMaxX(frame) == CGRectGetMaxX(_slideBoundsWithoutPadding) ||
                CGRectGetMaxY(frame) == CGRectGetMaxY(_slideBoundsWithoutPadding);
        }

        shapeLayers.push(layer);

        objj_msgSend(layer, "removeFromSuperlayer");
    }

    if (shouldRecalculateBounds)
        objj_msgSend(self, "_accomodateClippedRegions");

    if (_delegateSelectors & slideBaseLayerDidRemoveShapeLayersSelectorMask)
        objj_msgSend(_delegate, "slideBaseLayer:didRemoveShapeLayers:", self, shapeLayers);
}
});
instance_methods[10] = new objj_method(sel_registerName("setDisplaysClippedRegions:"), function(self, _cmd, shouldDisplayClippedRegions)
{ with(self)
{
    if (_displaysClippedRegions == shouldDisplayClippedRegions)
        return;

    _displaysClippedRegions = shouldDisplayClippedRegions;

    if (_displaysClippedRegions)
        objj_msgSend(self, "_accomodateClippedRegions");
    else
        objj_msgSend(self, "setBounds:", _naturalBounds);

    objj_msgSend(self, "setMasksToBounds:", !_displaysClippedRegions);
}
});
instance_methods[11] = new objj_method(sel_registerName("displaysClippedRegions"), function(self, _cmd)
{ with(self)
{
    return _displaysClippedRegions;
}
});
instance_methods[12] = new objj_method(sel_registerName("_accomodateClippedRegions"), function(self, _cmd)
{ with(self)
{

    var layers = objj_msgSend(self, "sublayers"),
        count = objj_msgSend(layers, "count"),
        slideBounds = CGRectMakeCopy(_naturalBounds);

    _slideBoundsWithoutPadding = CGRectMakeCopy(_naturalBounds);

    while (count--)
    {

        var layer = layers[count];

        if (objj_msgSend(layer, "isKindOfClass:", objj_msgSend(SKShapeLayer, "class")))
            _slideBoundsWithoutPadding = CGRectUnion(_slideBoundsWithoutPadding, objj_msgSend(layer, "frame"));
    }

    var slideBoundsWithPadding = CGRectMakeCopy(_slideBoundsWithoutPadding);

    if (CGRectGetMinX(_slideBoundsWithoutPadding) < CGRectGetMinX(slideBounds))
    {
        slideBoundsWithPadding.origin.x -= ClippedRegionsHorizontalPadding;
        slideBoundsWithPadding.size.width += ClippedRegionsHorizontalPadding;
    }
    if (CGRectGetMaxX(_slideBoundsWithoutPadding) > CGRectGetMaxX(slideBounds))
        slideBoundsWithPadding.size.width += ClippedRegionsHorizontalPadding;

    if (CGRectGetMinY(_slideBoundsWithoutPadding) < CGRectGetMinY(slideBounds))
    {
        slideBoundsWithPadding.origin.y -= ClippedRegionsVerticalPadding;
        slideBoundsWithPadding.size.height += ClippedRegionsVerticalPadding;
    }
    if (CGRectGetMaxY(_slideBoundsWithoutPadding) > CGRectGetMaxY(slideBounds))
        slideBoundsWithPadding.size.height += ClippedRegionsVerticalPadding;

    objj_msgSend(self, "setBounds:", slideBoundsWithPadding);
}
});
instance_methods[13] = new objj_method(sel_registerName("setBounds:"), function(self, _cmd, bounds)
{ with(self)
{
    if (CGRectEqualToRect(objj_msgSend(self, "bounds"), bounds))
        return;

    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CALayer") }, "setBounds:", bounds);

    objj_msgSend(_delegate, "slideBaseLayerDidChangeBounds:", self);
}
});
instance_methods[14] = new objj_method(sel_registerName("naturalBounds"), function(self, _cmd)
{ with(self)
{
    return _naturalBounds;
}
});
instance_methods[15] = new objj_method(sel_registerName("slideBaseLayerDidChangeBounds:"), function(self, _cmd, aSlideBaseLayer)
{ with(self)
{
    if (aSlideBaseLayer != _backgroundSlideBaseLayer)
        return;

    var current = objj_msgSend(self, "bounds"),
        bounds = objj_msgSend(aSlideBaseLayer, "bounds"),
        minX = MIN(CGRectGetMinX(current), CGRectGetMinX(bounds)),
        minY = MIN(CGRectGetMinY(current), CGRectGetMinY(bounds)),
        maxX = MAX(CGRectGetMaxX(current), CGRectGetMaxX(bounds)),
        maxY = MAX(CGRectGetMaxY(current), CGRectGetMaxY(bounds));

    objj_msgSend(self, "setBounds:", CGRectMake(minX,minY,maxX-minX,maxY-minY));
}
});
instance_methods[16] = new objj_method(sel_registerName("setDisplaysMoviesAsThumbnails:"), function(self, _cmd, shouldDisplayMoviesAsThumbnails)
{ with(self)
{
    if (_displaysMoviesAsThumbnails == shouldDisplayMoviesAsThumbnails)
        return;

    _displaysMoviesAsThumbnails = shouldDisplayMoviesAsThumbnails;

    var shapeLayer = nil,
        shapeLayers = objj_msgSend(_shapeLayerCache, "objectEnumerator");

    while (shapeLayer = objj_msgSend(shapeLayers, "nextObject"))
        if (objj_msgSend(shapeLayer, "isKindOfClass:", objj_msgSend(SKMovieLayer, "class")))
            objj_msgSend(shapeLayer, "setDisplaysAsThumbnail:", _displaysMoviesAsThumbnails);
}
});
instance_methods[17] = new objj_method(sel_registerName("setDisplaysPlaceholders:"), function(self, _cmd, shouldDisplayPlaceholders)
{ with(self)
{
    _displaysPlaceholders = shouldDisplayPlaceholders;
}
});
instance_methods[18] = new objj_method(sel_registerName("displaysPlaceholders"), function(self, _cmd)
{ with(self)
{
    return _displaysPlaceholders;
}
});
instance_methods[19] = new objj_method(sel_registerName("setDisplaysPlaceholderPrompts:"), function(self, _cmd, shouldDisplayPlaceholderPrompts)
{ with(self)
{
    if (_displaysPlaceholderPrompts == shouldDisplayPlaceholderPrompts)
        return;

    _displaysPlaceholderPrompts = shouldDisplayPlaceholderPrompts;

    var layer = nil,
        layers = objj_msgSend(_shapeLayerCache, "objectEnumerator");

    while (layer = objj_msgSend(layers, "nextObject"))
        if (objj_msgSend(objj_msgSend(layer, "shape"), "isPlaceholder"))
            objj_msgSend(layer, "setDisplaysPlaceholderPrompt:", _displaysPlaceholderPrompts);
}
});
instance_methods[20] = new objj_method(sel_registerName("displaysPlaceholderPrompts"), function(self, _cmd)
{ with(self)
{
    return _displaysPlaceholderPrompts;
}
});
class_addMethods(the_class, instance_methods);
}

p;14;SKSlideLayer.jI;16;AppKit/CALayer.ji;9;SKSlide.ji;15;SKFillDrawing.ji;20;SKSlideLayoutLayer.jc;3833;


{var the_class = objj_allocateClassPair(SKSlideBaseLayer, "SKSlideLayer"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_slideLayoutLayer"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBaseLayer") }, "init");

    if (self)
    {





        objj_msgSend(self, "setAnchorPoint:", CGPointMake(0.0,0.0));


        _slideLayoutLayer = objj_msgSend(SKSlideLayoutLayer, "layer");

        objj_msgSend(_slideLayoutLayer, "setZPosition:", -1);


        objj_msgSend(self, "addSublayer:", _slideLayoutLayer);

        objj_msgSend(self, "setDisplaysPlaceholders:", YES);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("setSlide:"), function(self, _cmd, aSlide)
{ with(self)
{
    objj_msgSend(self, "setSlideBase:", aSlide);
}
});
instance_methods[2] = new objj_method(sel_registerName("slide"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(self, "slideBase");
}
});
instance_methods[3] = new objj_method(sel_registerName("slideMaster"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(objj_msgSend(self, "slide"), "slideMaster");
}
});
instance_methods[4] = new objj_method(sel_registerName("setSlideBase:"), function(self, _cmd, aSlide)
{ with(self)
{
    var defaultCenter = objj_msgSend(CPNotificationCenter, "defaultCenter"),
        slide = objj_msgSend(self, "slide");

    if (slide)
        objj_msgSend(defaultCenter, "removeObserver:object:", self, slide);

    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBaseLayer") }, "setSlideBase:", aSlide);

    if (aSlide)
        objj_msgSend(defaultCenter, "addObserver:selector:name:object:", self, sel_registerName("slideLayoutDidChange:"), SKSlideSlideLayoutDidChangeNotification, aSlide);

    objj_msgSend(_slideLayoutLayer, "setPosition:", CGPointMake(400,300));
    objj_msgSend(_slideLayoutLayer, "setSlideLayout:", objj_msgSend(aSlide, "slideLayout"));

    objj_msgSend(self, "setNeedsDisplay");
}
});
instance_methods[5] = new objj_method(sel_registerName("drawInContext:"), function(self, _cmd, aContext)
{ with(self)
{



    CGContextSetFillColor(aContext, objj_msgSend(CPColor, "blackColor"));
    CGContextFillRect(aContext, objj_msgSend(self, "naturalBounds"));
}
});
instance_methods[6] = new objj_method(sel_registerName("textScale"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(self, "affineTransform").a;
}
});
instance_methods[7] = new objj_method(sel_registerName("drawInContext:"), function(self, _cmd, aContext)
{ with(self)
{
    var backgroundFill = objj_msgSend(objj_msgSend(self, "slideBase"), "backgroundFill");

    if (!objj_msgSend(backgroundFill, "isLoaded"))
    {
        objj_msgSend(objj_msgSend(CPNotificationCenter, "defaultCenter"), "addObserver:selector:name:object:", self, sel_registerName("setNeedsDisplay"), SKFillDidLoadNotification, backgroundFill);

        objj_msgSend(backgroundFill, "load");

        return;
    }

    objj_msgSend(backgroundFill, "fillLayer:inContext:", self, aContext);
}
});
instance_methods[8] = new objj_method(sel_registerName("slideLayoutDidChange:"), function(self, _cmd, aNotification)
{ with(self)
{
    var slide = objj_msgSend(self, "slide"),
        shapes = objj_msgSend(slide, "shapes"),
        count = shapes.length;

    while (count--)
        objj_msgSend(objj_msgSend(self, "layerForShape:", shapes[count]), "applyDefaultTextAttributes");

    objj_msgSend(self, "setNeedsDisplay");
}
});
class_addMethods(the_class, instance_methods);
}

p;15;SKSlideLayout.jI;20;Foundation/CPCoder.jI;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;13;SKSlideBase.ji;15;SKSlideMaster.jc;4304;



SKSlideLayoutTitleType = "title";
SKSlideLayoutTitleAndContentType = "obj";
SKSlideLayoutSectionHeaderType = "secHead";
SKSlideLayoutTwoContentType = "twoObj";
SKSlideLayoutComparisonType = "twoTxTwoObj";
SKSlideLayoutTitleOnlyType = "titleOnly";
SKSlideLayoutBlankType = "blank";
SKSlideLayoutContentWithCaptionType = "objTx";
SKSlideLayoutPictureWithCaptionType = "picTx";
SKSlideLayoutTitleAndVerticalTextType = "vertTx";
SKSlideLayoutVerticalTitleAndTextType = "vertTitleAndTx";

{var the_class = objj_allocateClassPair(SKSlideBase, "SKSlideLayout"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_type"), new objj_ivar("_name"), new objj_ivar("_slideMaster"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithType:"), function(self, _cmd, aType)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "init");

    if (self)
        _type = aType;

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("type"), function(self, _cmd)
{ with(self)
{
    return _type;
}
});
instance_methods[2] = new objj_method(sel_registerName("setName:"), function(self, _cmd, aName)
{ with(self)
{
    _name = aName;
}
});
instance_methods[3] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return _name;
}
});
instance_methods[4] = new objj_method(sel_registerName("backgroundFill"), function(self, _cmd)
{ with(self)
{
    return objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "backgroundFill") || objj_msgSend(_slideMaster, "backgroundFill");
}
});
instance_methods[5] = new objj_method(sel_registerName("slideMaster"), function(self, _cmd)
{ with(self)
{
    return _slideMaster;
}
});
instance_methods[6] = new objj_method(sel_registerName("transition"), function(self, _cmd)
{ with(self)
{
    return _transition || objj_msgSend(_slideMaster, "transition");
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKSlideLayout")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSlideLayout\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("copy"), function(self, _cmd)
{ with(self)
{
    var copy = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "copy");

    copy._type = _type;
    copy._transition = _transition;

    return copy;
}
});
class_addMethods(the_class, instance_methods);
}

var SKSlideLayoutTypeKey = "SKSlideLayoutTypeKey",
    SKSlideLayoutNameKey = "SKSlideLayoutNameKey",
    SKSlideLayoutSlideMasterKey = "SKSlideLayoutSlideMasterKey";

{
var the_class = objj_getClass("SKSlideLayout")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSlideLayout\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "initWithCoder:", aCoder);

    if (self)
    {
        _type = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlideLayoutTypeKey);
        _name = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlideLayoutNameKey);

        _slideMaster = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlideLayoutSlideMasterKey);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "encodeWithCoder:", aCoder);

    objj_msgSend(aCoder, "encodeObject:forKey:", _type, SKSlideLayoutTypeKey);
    objj_msgSend(aCoder, "encodeObject:forKey:", _name, SKSlideLayoutNameKey);

    objj_msgSend(aCoder, "encodeObject:forKey:", _slideMaster, SKSlideLayoutSlideMasterKey);
}
});
class_addMethods(the_class, instance_methods);
}

p;20;SKSlideLayoutLayer.ji;15;SKSlideLayout.ji;15;SKSlideMaster.ji;18;SKSlideBaseLayer.ji;20;SKSlideMasterLayer.jc;1585;


{var the_class = objj_allocateClassPair(SKSlideBaseLayer, "SKSlideLayoutLayer"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_slideMasterLayer"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBaseLayer") }, "init");

    if (self)
    {

        _slideMasterLayer = objj_msgSend(SKSlideMasterLayer, "layer");

        objj_msgSend(self, "setBackgroundSlideBaseLayer:", _slideMasterLayer);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("setSlideLayout:"), function(self, _cmd, aSlideLayout)
{ with(self)
{
    objj_msgSend(self, "setSlideBase:", aSlideLayout);
}
});
instance_methods[2] = new objj_method(sel_registerName("slideLayout"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(self, "slideBase");
}
});
instance_methods[3] = new objj_method(sel_registerName("setSlideBase:"), function(self, _cmd, aSlideLayout)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBaseLayer") }, "setSlideBase:", aSlideLayout);

    objj_msgSend(_slideMasterLayer, "setPosition:", CGPointMake(400.0,300.0));
    objj_msgSend(_slideMasterLayer, "setSlideMaster:", objj_msgSend(aSlideLayout, "slideMaster"));
}
});
class_addMethods(the_class, instance_methods);
}

p;15;SKSlideMaster.jI;20;Foundation/CPArray.jI;21;Foundation/CPObject.ji;13;SKSlideBase.ji;15;SKSlideLayout.ji;9;SKTheme.jc;8118;


{var the_class = objj_allocateClassPair(SKSlideBase, "SKSlideMaster"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_theme"), new objj_ivar("_colorKeyMap"), new objj_ivar("_slideLayouts"), new objj_ivar("_titleTextAttributes"), new objj_ivar("_bodyTextAttributes"), new objj_ivar("_otherTextAttributes"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "init");

    if (self)
    {
        _slideLayouts = [];
        _colorKeyMap = objj_msgSend(CPDictionary, "dictionary");
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("slideMaster"), function(self, _cmd)
{ with(self)
{
    return self;
}
});
instance_methods[2] = new objj_method(sel_registerName("setTheme:"), function(self, _cmd, aTheme)
{ with(self)
{
    _theme = aTheme;
}
});
instance_methods[3] = new objj_method(sel_registerName("theme"), function(self, _cmd)
{ with(self)
{
    return _theme;
}
});
instance_methods[4] = new objj_method(sel_registerName("setTitleTextAttributes:"), function(self, _cmd, attributes)
{ with(self)
{
    _titleTextAttributes = TextAttributesMakeCopy(attributes);
}
});
instance_methods[5] = new objj_method(sel_registerName("titleTextAttributes"), function(self, _cmd)
{ with(self)
{
    return _titleTextAttributes;
}
});
instance_methods[6] = new objj_method(sel_registerName("setBodyTextAttributes:"), function(self, _cmd, attributes)
{ with(self)
{
    _bodyTextAttributes = attributes;
}
});
instance_methods[7] = new objj_method(sel_registerName("bodyTextAttributes"), function(self, _cmd)
{ with(self)
{
    return _bodyTextAttributes;
}
});
instance_methods[8] = new objj_method(sel_registerName("setOtherTextAttributes:"), function(self, _cmd, attributes)
{ with(self)
{
    _otherTextAttributes = attributes;
}
});
instance_methods[9] = new objj_method(sel_registerName("otherTextAttributes"), function(self, _cmd)
{ with(self)
{
    return _otherTextAttributes;
}
});
instance_methods[10] = new objj_method(sel_registerName("setColorKeyMap:"), function(self, _cmd, aColorKeyMap)
{ with(self)
{
    _colorKeyMap = aColorKeyMap;
}
});
instance_methods[11] = new objj_method(sel_registerName("mapColorKey:toColorKey:"), function(self, _cmd, aMappedColorKey, aColorKey)
{ with(self)
{
    objj_msgSend(_colorKeyMap, "setObject:forKey:", aMappedColorKey, aColorKey);
}
});
instance_methods[12] = new objj_method(sel_registerName("colorKeyMappedByColorKey:"), function(self, _cmd, aMappedColorKey)
{ with(self)
{
    return objj_msgSend(_colorKeyMap, "objectForKey:", aMappedColorKey) || aMappedColorKey;
}
});
instance_methods[13] = new objj_method(sel_registerName("addSlideLayout:"), function(self, _cmd, aSlideLayout)
{ with(self)
{
    if (objj_msgSend(aSlideLayout, "slideMaster") == self)
        return;

    aSlideLayout._slideMaster = self;
    objj_msgSend(_slideLayouts, "addObject:", aSlideLayout);
}
});
instance_methods[14] = new objj_method(sel_registerName("slideLayouts"), function(self, _cmd)
{ with(self)
{
    return _slideLayouts;
}
});
instance_methods[15] = new objj_method(sel_registerName("firstSlideLayoutWithType:"), function(self, _cmd, aType)
{ with(self)
{
    var index = 0,
        count = objj_msgSend(_slideLayouts, "count");

    for (; index < count; ++index)
    {
        var layout = _slideLayouts[index];

        if (objj_msgSend(layout, "type") == aType)
            return layout;
    }

    return nil;
}
});
instance_methods[16] = new objj_method(sel_registerName("transition"), function(self, _cmd)
{ with(self)
{
    return _transition;
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("CPCoder")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"CPCoder\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("encodeTextAttributes:forKey:"), function(self, _cmd, attributes, aKey)
{ with(self)
{
    objj_msgSend(self, "encodeObject:forKey:", attributes.fontFamily, aKey+"FontFamily");
    objj_msgSend(self, "encodeFloat:forKey:", attributes.fontSize, aKey+"FontSize");
    objj_msgSend(self, "encodeObject:forKey:", attributes.color, aKey+"Color");
    objj_msgSend(self, "encodeInt:forKey:", attributes.boldState, aKey+"BoldState");
    objj_msgSend(self, "encodeInt:forKey:", attributes.italicState, aKey+"ItalicState");
    objj_msgSend(self, "encodeInt:forKey:", attributes.underlineState, aKey+"UnderlineState");
    objj_msgSend(self, "encodeInt:forKey:", attributes.alignmentMask, aKey+"AlignmentMask");
    objj_msgSend(self, "encodeInt:forKey:", attributes.bulletStyleMask, aKey+"BulletStyleMask");
}
});
instance_methods[1] = new objj_method(sel_registerName("decodeTextAttributesForKey:"), function(self, _cmd, aKey)
{ with(self)
{
    return TextAttributesMake(
        objj_msgSend(self, "decodeObjectForKey:", aKey+"FontFamily"),
        objj_msgSend(self, "decodeFloatForKey:", aKey+"FontSize"),
        objj_msgSend(self, "decodeObjectForKey:", aKey+"Color"),
        objj_msgSend(self, "decodeIntForKey:", aKey+"BoldState"),
        objj_msgSend(self, "decodeIntForKey:", aKey+"ItalicState"),
        objj_msgSend(self, "decodeIntForKey:", aKey+"UnderlineState"),
        objj_msgSend(self, "decodeIntForKey:", aKey+"AlignmentMask"),
        objj_msgSend(self, "decodeIntForKey:", aKey+"BulletStyleMask"));
}
});
class_addMethods(the_class, instance_methods);
}

var SKSlideMasterSlideLayoutsKey = "SKSlideMasterSlideLayoutsKey",
    SKSlideMasterColorKeyMapKey = "SKSlideMasterColorKeyMapKey",
    SKSlideMasterTitleTextAttributesKey = "SKSlideMasterTitleTextAttributesKey",
    SKSlideMasterBodyTextAttributesKey = "SKSlideMasterTextAttributesKey",
    SKSlideMasterOtherTextAttributesKey = "SKSlideMasterOtherTextAttributesKey";

{
var the_class = objj_getClass("SKSlideMaster")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSlideMaster\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "initWithCoder:", aCoder);

    if (self)
    {
        _slideLayouts = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlideMasterSlideLayoutsKey);
        _colorKeyMap = objj_msgSend(aCoder, "decodeObjectForKey:", SKSlideMasterColorKeyMapKey);

        _titleTextAttributes = objj_msgSend(aCoder, "decodeTextAttributesForKey:", SKSlideMasterTitleTextAttributesKey);
        _bodyTextAttributes = objj_msgSend(aCoder, "decodeTextAttributesForKey:", SKSlideMasterBodyTextAttributesKey);
        _otherTextAttributes = objj_msgSend(aCoder, "decodeTextAttributesForKey:", SKSlideMasterOtherTextAttributesKey);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKSlideBase") }, "encodeWithCoder:", aCoder);

    objj_msgSend(aCoder, "encodeObject:forKey:", _slideLayouts, SKSlideMasterSlideLayoutsKey);
    objj_msgSend(aCoder, "encodeObject:forKey:", _colorKeyMap, SKSlideMasterColorKeyMapKey);

    objj_msgSend(aCoder, "encodeTextAttributes:forKey:", _titleTextAttributes, SKSlideMasterTitleTextAttributesKey);
    objj_msgSend(aCoder, "encodeTextAttributes:forKey:", _bodyTextAttributes, SKSlideMasterBodyTextAttributesKey);
    objj_msgSend(aCoder, "encodeTextAttributes:forKey:", _otherTextAttributes, SKSlideMasterOtherTextAttributesKey);
}
});
class_addMethods(the_class, instance_methods);
}

p;20;SKSlideMasterLayer.jI;16;AppKit/CALayer.ji;15;SKSlideMaster.ji;18;SKSlideBaseLayer.jc;663;


{var the_class = objj_allocateClassPair(SKSlideBaseLayer, "SKSlideMasterLayer"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setSlideMaster:"), function(self, _cmd, aSlideMaster)
{ with(self)
{
    objj_msgSend(self, "setSlideBase:", aSlideMaster);
}
});
instance_methods[1] = new objj_method(sel_registerName("slideMaster"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(self, "slideBase");
}
});
class_addMethods(the_class, instance_methods);
}

p;13;SKSlideView.jI;19;AppKit/CGGeometry.jI;19;AppKit/CPClipView.jI;21;AppKit/CPScrollView.jI;21;AppKit/CPShadowView.jI;15;AppKit/CPView.jI;16;AppKit/CALayer.ji;9;SKSlide.ji;14;SKShapeLayer.ji;14;SKSlideLayer.ji;16;SKPictureLayer.ji;14;SKMovieLayer.ji;16;SKPresentation.jc;19120;


var RegisteredShapeLayerClasses = nil;

{var the_class = objj_allocateClassPair(CPView, "SKSlideView"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_slide"), new objj_ivar("_slideSize"), new objj_ivar("_rootLayer"), new objj_ivar("_slideLayer"), new objj_ivar("_shadowView"), new objj_ivar("_shadowWeight"), new objj_ivar("_slideBoundsWithoutPadding"), new objj_ivar("_displaysClippedRegions"), new objj_ivar("_scalesContentToFit"), new objj_ivar("_displaysMoviesAsThumbnails"), new objj_ivar("_displaysPlaceholderPrompts"), new objj_ivar("_displaysShadow"), new objj_ivar("_scale"), new objj_ivar("_scrollView"), new objj_ivar("_contentView"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithFrame:"), function(self, _cmd, aFrame)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "initWithFrame:", aFrame);

    if (self)
    {
        _scale = 1.0;
        _rootLayer = objj_msgSend(CALayer, "layer");

        _shadowWeight = CPLightShadow;

        objj_msgSend(self, "setWantsLayer:", YES);
        objj_msgSend(self, "setLayer:", _rootLayer);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("slideBaseLayerDidChangeBounds:"), function(self, _cmd, aSlideLayer)
{ with(self)
{
    if (_slideLayer != aSlideLayer)
        return;

    if (_scalesContentToFit)
        objj_msgSend(self, "_scaleContentToFit");


    else if (_contentView)
    {
        var size = CGSizeMakeCopy(objj_msgSend(_contentView, "frame").size),
            slideFrameSize = objj_msgSend(_slideLayer, "frame").size;

        size.width = MAX(size.width, slideFrameSize.width);
        size.height = MAX(size.height, slideFrameSize.height);

        objj_msgSend(self, "setFrameSize:", size);
    }

    objj_msgSend(self, "_positionContent");
}
});
instance_methods[2] = new objj_method(sel_registerName("layerForSlide:"), function(self, _cmd, aSlide)
{ with(self)
{
    var slideLayer = objj_msgSend(SKSlideLayer, "layer");

    objj_msgSend(slideLayer, "setDelegate:", self);
    objj_msgSend(slideLayer, "setDisplaysClippedRegions:", _displaysClippedRegions);
    objj_msgSend(slideLayer, "setDisplaysMoviesAsThumbnails:", _displaysMoviesAsThumbnails);
    objj_msgSend(slideLayer, "setSlide:", aSlide);
    objj_msgSend(slideLayer, "setDisplaysPlaceholderPrompts:", _displaysPlaceholderPrompts);

    return slideLayer;
}
});
instance_methods[3] = new objj_method(sel_registerName("setSlide:"), function(self, _cmd, aSlide)
{ with(self)
{
    if (_slide == aSlide)
        return;

    objj_msgSend(_slideLayer, "removeFromSuperlayer");

    _slide = aSlide;

    _slideSize = objj_msgSend(_slide, "size");
    _slideLayer = objj_msgSend(self, "layerForSlide:", _slide);

    var currentScale = _scale


    _scale = objj_msgSend(_slideLayer, "affineTransform").a;


    if (!_scalesContentToFit)
        objj_msgSend(self, "_setScale:", currentScale);

    objj_msgSend(_rootLayer, "addSublayer:", _slideLayer);

    objj_msgSend(self, "slideBaseLayerDidChangeBounds:", _slideLayer);
}
});
instance_methods[4] = new objj_method(sel_registerName("slide"), function(self, _cmd)
{ with(self)
{
    return _slide;
}
});
instance_methods[5] = new objj_method(sel_registerName("slideLayer"), function(self, _cmd)
{ with(self)
{
    return _slideLayer;
}
});
instance_methods[6] = new objj_method(sel_registerName("setDisplaysClippedRegions:"), function(self, _cmd, shouldDisplayClippedRegions)
{ with(self)
{
    _displaysClippedRegions = shouldDisplayClippedRegions;

    objj_msgSend(_slideLayer, "setDisplaysClippedRegions:", shouldDisplayClippedRegions);
}
});
instance_methods[7] = new objj_method(sel_registerName("displaysClippedRegions"), function(self, _cmd)
{ with(self)
{
    return _displaysClippedRegions;
}
});
instance_methods[8] = new objj_method(sel_registerName("setScalesContentToFit:"), function(self, _cmd, shouldScaleContentToFit)
{ with(self)
{
    if (_scalesContentToFit == shouldScaleContentToFit)
        return;

    _scalesContentToFit = shouldScaleContentToFit;

    if (_scalesContentToFit)
    {
        objj_msgSend(self, "_scaleContentToFit");
        objj_msgSend(self, "_positionContent");
    }
}
});
instance_methods[9] = new objj_method(sel_registerName("scalesContentToFit"), function(self, _cmd)
{ with(self)
{
    return _scalesContentToFit;
}
});
instance_methods[10] = new objj_method(sel_registerName("setScale:"), function(self, _cmd, aScale)
{ with(self)
{
    _scalesContentToFit = NO;

    objj_msgSend(self, "_setScale:", aScale);
    objj_msgSend(self, "_positionContent");
}
});
instance_methods[11] = new objj_method(sel_registerName("scale"), function(self, _cmd)
{ with(self)
{
    return _scale;
}
});
instance_methods[12] = new objj_method(sel_registerName("_setScale:"), function(self, _cmd, aScale)
{ with(self)
{
    if (_scale == aScale)
        return;

    _scale = MAX(0.0, aScale);

    objj_msgSend(_slideLayer, "setAffineTransform:", CGAffineTransformMakeScale(_scale,_scale));


    if (!_scalesContentToFit)
    {
        var size = CGSizeMakeCopy(objj_msgSend(self, "bounds").size),
            slideFrameSize = objj_msgSend(_slideLayer, "frame").size;

        size.width = MAX(size.width, slideFrameSize.width);
        size.height = MAX(size.height, slideFrameSize.height);

        objj_msgSend(self, "setFrameSize:", size);
    }


    var shapes = objj_msgSend(_slide, "shapes"),
        index = 0,
        count = shapes.length;

    for (; index < count; ++index)
        objj_msgSend(objj_msgSend(self, "layerForShape:", shapes[index])._textLayer, "setTextScale:", objj_msgSend(_slideLayer, "textScale"));
}
});
instance_methods[13] = new objj_method(sel_registerName("_scaleContentToFit"), function(self, _cmd)
{ with(self)
{
    if (!_slide)
        return;

    var slideLayerSize = objj_msgSend(_slideLayer, "bounds").size,
        slideLayerRatio = slideLayerSize.width / slideLayerSize.height,

        boundsSize = objj_msgSend(self, "bounds").size,
        availableWidth = boundsSize.width - objj_msgSend(_shadowView, "horizontalInset"),
        availableHeight = boundsSize.height - objj_msgSend(_shadowView, "verticalInset"),
        availableRatio = availableWidth / availableHeight;

    if (availableRatio > slideLayerRatio)
        objj_msgSend(self, "_setScale:", availableHeight/slideLayerSize.height);
    else
        objj_msgSend(self, "_setScale:", availableWidth/slideLayerSize.width);
}
});
instance_methods[14] = new objj_method(sel_registerName("_positionContent"), function(self, _cmd)
{ with(self)
{
    if (!_slide)
        return;

    var slideBoundsOrigin = objj_msgSend(_slideLayer, "bounds").origin,
        slideFrameSize = objj_msgSend(_slideLayer, "frame").size,
        frameSize = objj_msgSend(self, "frame").size,
        width = slideFrameSize.width,
        height = slideFrameSize.height,
        origin = CGPointMakeZero(),
        scaledSlideSize = CGSizeMake(_slideSize.width * _scale, _slideSize.height * _scale);

    if (width < frameSize.width)
    {
        origin.x = MAX(0.0, slideBoundsOrigin.x * _scale + (frameSize.width - scaledSlideSize.width) / 2.0);

        if (origin.x + width > frameSize.width)
            origin.x = frameSize.width - width;
    }

    if (height < frameSize.height)
    {
        origin.y = MAX(0.0, slideBoundsOrigin.y * _scale + (frameSize.height - scaledSlideSize.height) / 2.0);

        if (origin.y + height > frameSize.height)
            origin.y = frameSize.height - height;
    }

    objj_msgSend(_slideLayer, "setPosition:", origin);

    if (_displaysShadow)
        objj_msgSend(_shadowView, "setFrameForContentFrame:", objj_msgSend(_slideLayer, "convertRect:toLayer:", CGRectMake(0.0,0.0,_slideSize.width,_slideSize.height), nil));
}
});
instance_methods[15] = new objj_method(sel_registerName("setDisplaysMoviesAsThumbnails:"), function(self, _cmd, shouldDisplayMoviesAsThumbnails)
{ with(self)
{
    if (_displaysMoviesAsThumbnails == shouldDisplayMoviesAsThumbnails)
        return;

    _displaysMoviesAsThumbnails = shouldDisplayMoviesAsThumbnails;

    objj_msgSend(_slideLayer, "setDisplaysMoviesAsThumbnails:", _displaysMoviesAsThumbnails);
}
});
instance_methods[16] = new objj_method(sel_registerName("setDisplaysPlaceholderPrompts:"), function(self, _cmd, shouldDisplayPlaceholderPrompts)
{ with(self)
{
    if (_displaysPlaceholderPrompts == shouldDisplayPlaceholderPrompts)
        return;

    _displaysPlaceholderPrompts = shouldDisplayPlaceholderPrompts;

    objj_msgSend(_slideLayer, "setDisplaysPlaceholderPrompts:", shouldDisplayPlaceholderPrompts);
}
});
instance_methods[17] = new objj_method(sel_registerName("displaysPlaceholderPrompts"), function(self, _cmd)
{ with(self)
{
    return _displaysPlaceholderPrompts;
}
});
instance_methods[18] = new objj_method(sel_registerName("setDisplaysShadow:"), function(self, _cmd, shouldDisplayShadow)
{ with(self)
{
    if (_displaysShadow == shouldDisplayShadow)
        return;

    _displaysShadow = shouldDisplayShadow;

    if (_displaysShadow)
    {
        _shadowView = objj_msgSend(objj_msgSend(CPShadowView, "alloc"), "initWithFrame:", CGRectMakeZero());
        objj_msgSend(_shadowView, "setWeight:", _shadowWeight);

        objj_msgSend(self, "addSubview:", _shadowView);
    }
    else
    {
        objj_msgSend(_shadowView, "removeFromSuperview");

        _shadowView = nil;
    }

    if (_scalesContentToFit)
    {
        objj_msgSend(self, "_scaleContentToFit");
        objj_msgSend(self, "_positionContent");
    }
}
});
instance_methods[19] = new objj_method(sel_registerName("displaysShadow"), function(self, _cmd)
{ with(self)
{
    return _displaysShadow;
}
});
instance_methods[20] = new objj_method(sel_registerName("setShadowWeight:"), function(self, _cmd, aShadowWeight)
{ with(self)
{
    if (_shadowWeight == aShadowWeight)
        return;

    _shadowWeight = aShadowWeight;

    if (!_displaysShadow)
        return;

    objj_msgSend(_shadowView, "setWeight:", _shadowWeight);

    if (_scalesContentToFit)
    {
        objj_msgSend(self, "_scaleContentToFit");
        objj_msgSend(self, "_positionContent");
    }
}
});
instance_methods[21] = new objj_method(sel_registerName("shadowWeight"), function(self, _cmd)
{ with(self)
{
    return _shadowWeight;
}
});
instance_methods[22] = new objj_method(sel_registerName("slideFrame"), function(self, _cmd)
{ with(self)
{

    var frame = objj_msgSend(_slideLayer, "convertRect:toLayer:", CGRectMake(0.0,0.0,_slideSize.width,_slideSize.height), nil);

    frame.origin = objj_msgSend(self, "convertPoint:toView:", frame.origin, objj_msgSend(self, "superview"));

    return frame;


}
});
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("registerShapeLayerClass:forShapeClass:"), function(self, _cmd, aShapeLayerClass, aShapeClass)
{ with(self)
{
    if (!RegisteredShapeLayerClasses)
        RegisteredShapeLayerClasses = objj_msgSend(CPDictionary, "dictionary");

    objj_msgSend(RegisteredShapeLayerClasses, "setObject:forKey:", aShapeLayerClass, aShapeClass.name);
}
});
class_methods[1] = new objj_method(sel_registerName("shapeLayerClassForShapeClass:"), function(self, _cmd, aShapeClass)
{ with(self)
{
    var layerClass = nil;

    while (aShapeClass && !(layerClass = objj_msgSend(RegisteredShapeLayerClasses, "objectForKey:", aShapeClass.name)))
        aShapeClass = objj_msgSend(aShapeClass, "superclass");

    return layerClass;
}
});
instance_methods[23] = new objj_method(sel_registerName("layerForShape:"), function(self, _cmd, aShape)
{ with(self)
{
    return objj_msgSend(_slideLayer, "layerForShape:", aShape);
}
});
instance_methods[24] = new objj_method(sel_registerName("viewDidMoveToSuperview"), function(self, _cmd)
{ with(self)
{
    _scrollView = objj_msgSend(self, "enclosingScrollView");
    _contentView = objj_msgSend(_scrollView, "contentView");

    if (_contentView != objj_msgSend(self, "superview"))
    {
        _scrollView = nil;
        _contentView = nil;
    }



}
});
instance_methods[25] = new objj_method(sel_registerName("setFrameSize:"), function(self, _cmd, aSize)
{ with(self)
{

    if (!_slide)
        objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "setFrameSize:", aSize);


    if (CGSizeEqualToSize(aSize, objj_msgSend(self, "frame").size))
        return;


    if (_scalesContentToFit)
    {
        objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "setFrameSize:", aSize);
        objj_msgSend(self, "_scaleContentToFit");
    }


    else
    {
        aSize = CGSizeMakeCopy(aSize);


        var slideFrameSize = objj_msgSend(_slideLayer, "frame").size;

        aSize.width = MAX(aSize.width, slideFrameSize.width);
        aSize.height = MAX(aSize.height, slideFrameSize.height);

        objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "setFrameSize:", aSize);
    }

    objj_msgSend(self, "_positionContent");


    objj_msgSend(_scrollView, "reflectScrolledClipView:", _contentView);
}
});
instance_methods[26] = new objj_method(sel_registerName("resizeWithOldSuperviewSize:"), function(self, _cmd, aSize)
{ with(self)
{
    if (!_scrollView || _scalesContentToFit)
        return objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "resizeWithOldSuperviewSize:", aSize);

    objj_msgSend(self, "setFrameSize:", objj_msgSend(_contentView, "frame").size);
}
});
instance_methods[27] = new objj_method(sel_registerName("mouseDown:"), function(self, _cmd, anEvent)
{ with(self)
{
    var location = objj_msgSend(self, "convertPoint:fromView:", objj_msgSend(anEvent, "locationInWindow"), nil),
        hitLayer = objj_msgSend(_layer, "hitTest:", location);

    if (objj_msgSend(hitLayer, "isKindOfClass:", objj_msgSend(SKMovieLayer, "class")) && !objj_msgSend(hitLayer, "displaysAsThumbnail"))
        objj_msgSend(objj_msgSend(CPDOMWindowBridge, "sharedDOMWindowBridge"), "_propagateCurrentDOMEvent:", YES);
    else
        objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "mouseDown:", anEvent);
}
});
instance_methods[28] = new objj_method(sel_registerName("mouseDragged:"), function(self, _cmd, anEvent)
{ with(self)
{
    var location = objj_msgSend(self, "convertPoint:fromView:", objj_msgSend(anEvent, "locationInWindow"), nil),
        hitLayer = objj_msgSend(_layer, "hitTest:", location);

    if (objj_msgSend(hitLayer, "isKindOfClass:", objj_msgSend(SKMovieLayer, "class")) && !objj_msgSend(hitLayer, "displaysAsThumbnail"))
        objj_msgSend(objj_msgSend(CPDOMWindowBridge, "sharedDOMWindowBridge"), "_propagateCurrentDOMEvent:", YES);
    else
        objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "mouseDragged:", anEvent);
}
});
instance_methods[29] = new objj_method(sel_registerName("mouseUp:"), function(self, _cmd, anEvent)
{ with(self)
{
    var location = objj_msgSend(self, "convertPoint:fromView:", objj_msgSend(anEvent, "locationInWindow"), nil),
        hitLayer = objj_msgSend(_layer, "hitTest:", location);

    if (objj_msgSend(hitLayer, "isKindOfClass:", objj_msgSend(SKMovieLayer, "class")) && !objj_msgSend(hitLayer, "displaysAsThumbnail"))
        objj_msgSend(objj_msgSend(CPDOMWindowBridge, "sharedDOMWindowBridge"), "_propagateCurrentDOMEvent:", YES);
    else
        objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "mouseUp:", anEvent);
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}

var SKSlideViewDisplaysClippedRegionsKey = "SKSlideViewDisplaysClippedRegionsKey",
    SKSlideViewScalesContentToFitKey = "SKSlideViewScalesContentToFitKey",
    SKSlideViewDisplaysMoviesAsThumbnailsKey = "SKSlideViewDisplaysMoviesAsThumbnailsKey",
    SKSlideViewDisplaysPlaceholderPromptsKey = "SKSlideViewDisplaysPlaceholderPromptsKey",
    SKSlideViewDisplaysShadowKey = "SKSlideViewDisplaysShadowKey";

{
var the_class = objj_getClass("SKSlideView")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSlideView\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "initWithCoder:", aCoder);

    if (self)
    {
        _rootLayer = objj_msgSend(CALayer, "layer");

        _shadowWeight = CPLightShadow;

        objj_msgSend(self, "setWantsLayer:", YES);
        objj_msgSend(self, "setLayer:", _rootLayer);

        objj_msgSend(self, "setDisplaysClippedRegions:", objj_msgSend(aCoder, "decodeBoolForKey:", SKSlideViewDisplaysClippedRegionsKey));
        objj_msgSend(self, "setScalesContentToFit:", objj_msgSend(aCoder, "decodeBoolForKey:", SKSlideViewScalesContentToFitKey));
        objj_msgSend(self, "setDisplaysMoviesAsThumbnails:", objj_msgSend(aCoder, "decodeBoolForKey:", SKSlideViewDisplaysMoviesAsThumbnailsKey));
        objj_msgSend(self, "setDisplaysPlaceholderPrompts:", objj_msgSend(aCoder, "decodeBoolForKey:", SKSlideViewDisplaysPlaceholderPromptsKey));
        objj_msgSend(self, "setDisplaysShadow:", objj_msgSend(aCoder, "decodeBoolForKey:", SKSlideViewDisplaysShadowKey));

        if (!_scalesContentToFit)
            objj_msgSend(self, "setScale:", objj_msgSend(aCoder, "decodeFloatForKey:", SKSlideViewScaleKey));
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPView") }, "encodeWithCoder:", aCoder);

    objj_msgSend(aCoder, "encodeBool:forKey:", _displaysClippedRegions, SKSlideViewDisplaysClippedRegionsKey);
    objj_msgSend(aCoder, "encodeBool:forKey:", _scalesContentToFit, SKSlideViewScalesContentToFitKey);
    objj_msgSend(aCoder, "encodeBool:forKey:", _displaysMoviesAsThumbnails, SKSlideViewDisplaysMoviesAsThumbnailsKey);
    objj_msgSend(aCoder, "encodeBool:forKey:", _displaysPlaceholderPrompts, SKSlideViewDisplaysPlaceholderPromptsKey);
    objj_msgSend(aCoder, "encodeBool:forKey:", _displaysShadow, SKSlideViewDisplaysShadowKey);

    if (!_scalesContentToFit)
        objj_msgSend(aCoder, "encodeFloat:forKey:", _scale, SKSlideViewScaleKey);
}
});
class_addMethods(the_class, instance_methods);
}

objj_msgSend(SKSlideView, "registerShapeLayerClass:forShapeClass:", objj_msgSend(SKShapeLayer, "class"), objj_msgSend(SKShape, "class"));
objj_msgSend(SKSlideView, "registerShapeLayerClass:forShapeClass:", objj_msgSend(SKPictureLayer, "class"), objj_msgSend(SKPicture, "class"));
objj_msgSend(SKSlideView, "registerShapeLayerClass:forShapeClass:", objj_msgSend(SKMovieLayer, "class"), objj_msgSend(SKMovie, "class"));

p;9;SKTheme.ji;9;SKColor.jc;5905;


SKColorSchemeAccent1Key = "accent1";
SKColorSchemeAccent2Key = "accent2";
SKColorSchemeAccent3Key = "accent3";
SKColorSchemeAccent4Key = "accent4";
SKColorSchemeAccent5Key = "accent5";
SKColorSchemeAccent6Key = "accent6";
SKColorSchemeLight1Key = "lt1";
SKColorSchemeLight2Key = "lt2";
SKColorSchemeDark1Key = "dk1";
SKColorSchemeDark2Key = "dk2";
SKColorSchemeHLinkKey = "hlink";
SKColorSchemeFolHLinkKey = "folHlink";

SKColorSchemeBackground1Key = "bg1";
SKColorSchemeBackground2Key = "bg2";
SKColorSchemeText1Key = "tx1";
SKColorSchemeText2Key = "tx2";

{var the_class = objj_allocateClassPair(CPObject, "SKColorScheme"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_name"), new objj_ivar("_colors"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("colorKeys"), function(self, _cmd)
{ with(self)
{
    return [SKColorSchemeAccent1Key,SKColorSchemeAccent2Key,SKColorSchemeAccent3Key,SKColorSchemeAccent4Key,SKColorSchemeAccent5Key,SKColorSchemeAccent6Key,SKColorSchemeLight1Key,SKColorSchemeLight2Key,SKColorSchemeDark1Key,SKColorSchemeDark2Key,SKColorSchemeHLinkKey,SKColorSchemeFolHLinkKey];
}
});
class_methods[1] = new objj_method(sel_registerName("colorSchemeWithName:colors:"), function(self, _cmd, aName, colors)
{ with(self)
{
    return objj_msgSend(objj_msgSend(self, "alloc"), "initWithName:colors:", aName, colors);
}
});
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithName:colors:"), function(self, _cmd, aName, colors)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPObject") }, "init");

    if (self)
    {
        _name = aName;
        _colors = colors;
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return _name;
}
});
instance_methods[2] = new objj_method(sel_registerName("colorForKey:"), function(self, _cmd, aKey)
{ with(self)
{
    return objj_msgSend(_colors, "objectForKey:", aKey);
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}

var SKColorSchemeNameKey = "SKColorSchemeNameKey",
    SKColorSchemeColorsKey = "SKColorSchemeColorsKey";

{
var the_class = objj_getClass("SKColorScheme")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKColorScheme\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPObject") }, "initWithCoder:", aCoder);

    if (self)
    {
        _name = objj_msgSend(aCoder, "decodeObjectForKey:", SKColorSchemeNameKey);

        _colors = objj_msgSend(aCoder, "decodeObjectForKey:", SKColorSchemeColorsKey);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPObject") }, "encodeWithCoder:", aCoder);

    objj_msgSend(aCoder, "encodeObject:forKey:", _name, SKColorSchemeNameKey);

    objj_msgSend(aCoder, "encodeObject:forKey:", _colors, SKColorSchemeColorsKey);
}
});
class_addMethods(the_class, instance_methods);
}

{var the_class = objj_allocateClassPair(CPObject, "SKTheme"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_name"), new objj_ivar("_colorScheme"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithName:colorScheme:"), function(self, _cmd, aName, aColorScheme)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPObject") }, "init");

    if (self)
    {
        _name = aName;

        _colorScheme = aColorScheme;
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return _name;
}
});
instance_methods[2] = new objj_method(sel_registerName("colorScheme"), function(self, _cmd)
{ with(self)
{
    return _colorScheme;
}
});
instance_methods[3] = new objj_method(sel_registerName("schemeColorForKey:"), function(self, _cmd, aColorKey)
{ with(self)
{
    return objj_msgSend(_colorScheme, "colorForKey:", aColorKey);
}
});
class_addMethods(the_class, instance_methods);
}

var SKThemeNameKey = "SKThemeNameKey",
    SKThemeColorSchemeKey = "SKThemeColorSchemeKey";

{
var the_class = objj_getClass("SKTheme")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKTheme\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPObject") }, "init");

    if (self)
    {
        _name = objj_msgSend(aCoder, "decodeObjectForKey:", SKThemeNameKey);

        _colorScheme = objj_msgSend(aCoder, "decodeObjectForKey:", SKThemeColorSchemeKey);
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSend(aCoder, "encodeObject:forKey:", _name, SKThemeNameKey);

    objj_msgSend(aCoder, "encodeObject:forKey:", _colorScheme, SKThemeColorSchemeKey);
}
});
class_addMethods(the_class, instance_methods);
}

p;14;SKTransition.jI;25;Foundation/CPDictionary.jI;20;Foundation/CPArray.jI;16;AppKit/CPColor.jc;13633;

SKDirectionDown = 0;
SKDirectionUp = 1;
SKDirectionLeft = 2;
SKDirectionRight = 3;
SKDirectionLeftDown = 4;
SKDirectionLeftUp = 5;
SKDirectionRightDown = 6;
SKDirectionRightUp = 7;


var SKTransitionDirectionKey = "SKTransitionDirectionKey";
var SKTransitionDurationKey = "SKTransitionDurationKey";
var SKTransitionColorKey = "SKTransitionColorKey";

var SKTransitionsForNames;

{var the_class = objj_allocateClassPair(CPObject, "SKTransition"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_duration"), new objj_ivar("_parameters"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("initialize"), function(self, _cmd)
{ with(self)
{
    if (self != objj_msgSend(SKTransition, "class"))
        return;

    SKTransitionsForNames = objj_msgSend(objj_msgSend(CPDictionary, "alloc"), "init");
}
});
class_methods[1] = new objj_method(sel_registerName("transitions"), function(self, _cmd)
{ with(self)
{
    return SKTransitionsForNames;
}
});
class_methods[2] = new objj_method(sel_registerName("transitionNames"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(SKTransitionsForNames, "allKeys");
}
});
class_methods[3] = new objj_method(sel_registerName("transitionForName:"), function(self, _cmd, aName)
{ with(self)
{
    return objj_msgSend(SKTransitionsForNames, "objectForKey:", aName);
}
});
class_methods[4] = new objj_method(sel_registerName("register"), function(self, _cmd)
{ with(self)
{
    objj_msgSend(SKTransitionsForNames, "setObject:forKey:", self, objj_msgSend(self, "identifier"));
}
});
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPObject") }, "init")

    if (self)
        _duration = 1.0;

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("duration"), function(self, _cmd)
{ with(self)
{
    return _duration
}
});
instance_methods[2] = new objj_method(sel_registerName("setDuration:"), function(self, _cmd, aDuration)
{ with(self)
{
    _duration = aDuration;
}
});
instance_methods[3] = new objj_method(sel_registerName("parameters"), function(self, _cmd)
{ with(self)
{
    return _parameters;
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}


{
var the_class = objj_getClass("SKTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPObject") }, "init")

    if (self)
        _duration = objj_msgSend(aCoder, "decodeIntForKey:", SKTransitionDurationKey);

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSend(aCoder, "encodeFloat:forKey:", _duration, SKTransitionDurationKey);
}
});
class_addMethods(the_class, instance_methods);
}



{var the_class = objj_allocateClassPair(SKTransition, "SKDirectedTransition"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_direction"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKTransition") }, "init")

    if (self)
        _direction = SKDirectionDown;

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("direction"), function(self, _cmd)
{ with(self)
{
    return _direction
}
});
instance_methods[2] = new objj_method(sel_registerName("setDirection:"), function(self, _cmd, aDirection)
{ with(self)
{
    _direction = aDirection;
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKDirectedTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKDirectedTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKTransition") }, "initWithCoder:", aCoder);

    if (self)
        _direction = objj_msgSend(aCoder, "decodeIntForKey:", SKTransitionDirectionKey);

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKTransition") }, "encodeWithCoder:", aCoder);

    objj_msgSend(aCoder, "encodeInt:forKey:", _direction, SKTransitionDirectionKey);
}
});
class_addMethods(the_class, instance_methods);
}



{var the_class = objj_allocateClassPair(SKTransition, "SKColoredTransition"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_color"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKTransition") }, "init")

    if (self)
        _fadeColor = objj_msgSend(CPColor, "blackColor");

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("color"), function(self, _cmd)
{ with(self)
{
    return _color;
}
});
instance_methods[2] = new objj_method(sel_registerName("setColor:"), function(self, _cmd, aColor)
{ with(self)
{
    _color = aColor;
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKColoredTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKColoredTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKTransition") }, "initWithCoder:", aCoder);

    if (self)
        _color = objj_msgSend(aCoder, "decodeObjectForKey:", SKTransitionColorKey);

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("encodeWithCoder:"), function(self, _cmd, aCoder)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("SKTransition") }, "encodeWithCoder:", aCoder);

    objj_msgSend(aCoder, "encodeObject:forKey:", _color, SKTransitionColorKey);
}
});
class_addMethods(the_class, instance_methods);
}




{var the_class = objj_allocateClassPair(SKTransition, "SKNoTransition"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("identifier"), function(self, _cmd)
{ with(self)
{
    return "SKNoTransitionName";
}
});
class_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return "No Transition";
}
});
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKTransition, "SKFadeTransition"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("identifier"), function(self, _cmd)
{ with(self)
{
    return "SKFadeTransitionName";
}
});
class_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return "Smooth Fade";
}
});
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKColoredTransition, "SKColorFadeTransition"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("identifier"), function(self, _cmd)
{ with(self)
{
    return "SKColorFadeTransitionName";
}
});
class_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return "Fade Through Black";
}
});
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKTransition, "SKBounceTransition"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("identifier"), function(self, _cmd)
{ with(self)
{
    return "SKBounceTransitionName";
}
});
class_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return "Bounce";
}
});
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKTransition, "SKZoomInTransition"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("identifier"), function(self, _cmd)
{ with(self)
{
    return "SKZoomInTransitionName";
}
});
class_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return "Zoom In";
}
});
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKTransition, "SKZoomOutTransition"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("identifier"), function(self, _cmd)
{ with(self)
{
    return "SKZoomOutTransitionName";
}
});
class_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return "Zoom Out";
}
});
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKTransition, "SKSlideZoomTransition"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("identifier"), function(self, _cmd)
{ with(self)
{
    return "SKSlideZoomTransitionName";
}
});
class_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return "Slide Zoom";
}
});
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKDirectedTransition, "SKCoverTransition"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("identifier"), function(self, _cmd)
{ with(self)
{
    return "SKCoverTransitionName";
}
});
class_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return "Cover";
}
});
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKDirectedTransition, "SKUncoverTransition"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("identifier"), function(self, _cmd)
{ with(self)
{
    return "SKUncoverTransitionName";
}
});
class_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return "Uncover";
}
});
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(SKDirectedTransition, "SKPushTransition"),
meta_class = _class_getMeta(the_class);objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("identifier"), function(self, _cmd)
{ with(self)
{
    return "SKPushTransitionName";
}
});
class_methods[1] = new objj_method(sel_registerName("name"), function(self, _cmd)
{ with(self)
{
    return "Push";
}
});
class_addMethods(meta_class, class_methods);
}

objj_msgSend(SKNoTransition, "register");
objj_msgSend(SKFadeTransition, "register");
objj_msgSend(SKColorFadeTransition, "register");
objj_msgSend(SKBounceTransition, "register");
objj_msgSend(SKZoomInTransition, "register");
objj_msgSend(SKZoomOutTransition, "register");
objj_msgSend(SKSlideZoomTransition, "register");
objj_msgSend(SKCoverTransition, "register");
objj_msgSend(SKUncoverTransition, "register");
objj_msgSend(SKPushTransition, "register");

p;23;SKTransitionAnimation.jI;20;AppKit/CPAnimation.ji;14;SKTransition.ji;13;SKSlideView.jc;13899;

{var the_class = objj_allocateClassPair(CPAnimation, "SKTransitionAnimation"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_transition"), new objj_ivar("_previousSlideView"), new objj_ivar("_nextSlideView"), new objj_ivar("_targetFrame"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithPreviousSlideView:nextSlideView:transition:"), function(self, _cmd, aPrevious, aNext, aTransition)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPAnimation") }, "initWithDuration:animationCurve:", objj_msgSend(aTransition, "duration"), CPAnimationLinear);

    if (self)
    {
        _previousSlideView = aPrevious;
        _nextSlideView = aNext;
        _transition = aTransition;
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("startAnimation"), function(self, _cmd)
{ with(self)
{
    _targetFrame = CGRectMakeCopy(objj_msgSend(_previousSlideView, "frame"));

    objj_msgSend(_transition, "preparePreviousSlideView:nextSlideView:withTargetFrame:", _previousSlideView, _nextSlideView, _targetFrame);

    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPAnimation") }, "startAnimation");
}
});
instance_methods[2] = new objj_method(sel_registerName("setCurrentProgress:"), function(self, _cmd, aProgress)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPAnimation") }, "setCurrentProgress:", aProgress);

    objj_msgSend(_transition, "updatePreviousSlideView:nextSlideView:withTargetFrame:currentValue:", _previousSlideView, _nextSlideView, _targetFrame, objj_msgSend(self, "currentValue"));
}
});
class_addMethods(the_class, instance_methods);
}


{
var the_class = objj_getClass("SKTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("preparePreviousSlideView:nextSlideView:withTargetFrame:"), function(self, _cmd, prev, next, target)
{ with(self)
{
    objj_msgSend(self, "updateParamters");


    if (_parameters.prevOnTop && objj_msgSend(next, "index") > objj_msgSend(prev, "index"))
        objj_msgSend(objj_msgSend(next, "superview"), "moveSubview:underSubview:", next, prev);


    objj_msgSend(next, "setFrameOrigin:", CGPointMake(target.origin.x+target.size.width*(_parameters.nextX?_parameters.nextX(0.0):0.0),target.origin.y+target.size.height*(_parameters.nextY?_parameters.nextY(0.0):0.0)));
    objj_msgSend(next, "setFrameSize:", CGSizeMake(target.size.width*(_parameters.nextW?_parameters.nextW(0.0):1.0),target.size.height*(_parameters.nextH?_parameters.nextH(0.0):1.0)));
    objj_msgSend(next, "setOpacity:", (_parameters.nextOpacity?_parameters.nextOpacity(0.0):1.0));


    if (!_parameters.prevOnTop && objj_msgSend(next, "index") < objj_msgSend(prev, "index"))
        objj_msgSend(objj_msgSend(next, "superview"), "moveSubview:underSubview:", prev, next);

    objj_msgSend(next, "setHidden:", NO);
    objj_msgSend(prev, "setHidden:", NO);
}
});
instance_methods[1] = new objj_method(sel_registerName("updatePreviousSlideView:nextSlideView:withTargetFrame:currentValue:"), function(self, _cmd, prev, next, target, value)
{ with(self)
{
    if (value == 1.0) {
        if (objj_msgSend(next, "index") < objj_msgSend(prev, "index"))
            objj_msgSend(objj_msgSend(next, "superview"), "moveSubview:underSubview:", prev, next);

        objj_msgSend(next, "setOpacity:", 1.0);
        objj_msgSend(next, "setFrame:", CGRectMakeCopy(target));
        objj_msgSend(prev, "setOpacity:", 1.0);
        objj_msgSend(prev, "setFrame:", CGRectMakeCopy(target));

        objj_msgSend(next, "setHidden:", NO);
        objj_msgSend(prev, "setHidden:", YES);

        return;
    }

    if (_parameters.nextX || _parameters.nextY)
        objj_msgSend(next, "setFrameOrigin:", CGPointMake(target.origin.x+target.size.width*(_parameters.nextX?_parameters.nextX(value):0.0),target.origin.y+target.size.height*(_parameters.nextY?_parameters.nextY(value):0.0)));

    if (_parameters.prevX || _parameters.prevY)
        objj_msgSend(prev, "setFrameOrigin:", CGPointMake(target.origin.x+target.size.width*(_parameters.prevX?_parameters.prevX(value):0.0),target.origin.y+target.size.height*(_parameters.prevY?_parameters.prevY(value):0.0)));

    if (_parameters.nextW || _parameters.nextH)
        objj_msgSend(next, "setFrameSize:", CGSizeMake(target.size.width*(_parameters.nextW?_parameters.nextW(value):1.0),target.size.height*(_parameters.nextH?_parameters.nextH(value):1.0)));

    if (_parameters.prevW || _parameters.prevH)
        objj_msgSend(prev, "setFrameSize:", CGSizeMake(target.size.width*(_parameters.prevW?_parameters.prevW(value):1.0),target.size.height*(_parameters.prevH?_parameters.prevH(value):1.0)));

    if (_parameters.nextOpacity)
        objj_msgSend(next, "setOpacity:", _parameters.nextOpacity(value));

    if (_parameters.prevOpacity)
        objj_msgSend(prev, "setOpacity:", _parameters.prevOpacity(value));
}
});
class_addMethods(the_class, instance_methods);
}




{
var the_class = objj_getClass("SKFadeTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKFadeTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("updateParamters"), function(self, _cmd)
{ with(self)
{
    _parameters = { nextOpacity: interpolator(0.0, 1.0) };
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKColorFadeTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKColorFadeTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("updateParamters"), function(self, _cmd)
{ with(self)
{
    _parameters = { prevOpacity: piecewise([{s:0.0,e:0.5,f:interpolator(1.0,0.0)}], constant(0.0)),
                    nextOpacity: piecewise([{s:0.5,e:1.0,f:interpolator(0.0,1.0)}], constant(0.0)) };
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKBounceTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKBounceTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("updateParamters"), function(self, _cmd)
{ with(self)
{
    _parameters = { nextY: function(value) { return -1 * ABS(SIN(8 * (value - 0.6)) * POW(E, (-2 * value))); } };
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKZoomInTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKZoomInTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("updateParamters"), function(self, _cmd)
{ with(self)
{
    _parameters = { nextX: interpolator(0.5, 0.0), nextY: interpolator(0.5, 0.0), nextW: interpolator(0.0, 1.0), nextH: interpolator(0.0, 1.0) };
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKZoomOutTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKZoomOutTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("updateParamters"), function(self, _cmd)
{ with(self)
{
    _parameters = { prevX: interpolator(0.0, 0.5), prevY: interpolator(0.0, 0.5), prevW: interpolator(1.0, 0.0), prevH: interpolator(1.0, 0.0), prevOnTop: true };
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKSlideZoomTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKSlideZoomTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("updateParamters"), function(self, _cmd)
{ with(self)
{
    _parameters = { prevX: keyframes([{t:0.0,v:0.0},{t:0.25,v:0.125},{t:0.75,v:-1.0}]),
                    prevY: keyframes([{t:0.0,v:0.0},{t:0.25,v:0.125}]),
                    prevW: keyframes([{t:0.0,v:1.0},{t:0.25,v:0.75}]),
                    prevH: keyframes([{t:0.0,v:1.0},{t:0.25,v:0.75}]),
                    nextX: keyframes([{t:0.25,v:1.0},{t:0.75,v:0.125},{t:1.0,v:0.0}]),
                    nextY: keyframes([{t:0.75,v:0.125},{t:1.0,v:0.0}]),
                    nextW: keyframes([{t:0.75,v:0.75},{t:1.0,v:1.0}]),
                    nextH: keyframes([{t:0.75,v:0.75},{t:1.0,v:1.0}]),
                    prevOnTop: true};
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKCoverTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKCoverTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("updateParamters"), function(self, _cmd)
{ with(self)
{
    switch (_direction) {
    case SKDirectionDown: _parameters = { nextY: interpolator(-1.0, 0.0) }; break;
    case SKDirectionUp: _parameters = { nextY: interpolator( 1.0, 0.0) }; break;
    case SKDirectionLeft: _parameters = { nextX: interpolator(-1.0, 0.0) }; break;
    case SKDirectionRight: _parameters = { nextX: interpolator( 1.0, 0.0) }; break;
    case SKDirectionLeftDown: _parameters = { nextX: interpolator(-1.0, 0.0), nextY: interpolator(-1.0, 0.0) }; break;
    case SKDirectionLeftUp: _parameters = { nextX: interpolator(-1.0, 0.0), nextY: interpolator( 1.0, 0.0) }; break;
    case SKDirectionRightDown: _parameters = { nextX: interpolator( 1.0, 0.0), nextY: interpolator(-1.0, 0.0) }; break;
    case SKDirectionRightUp: _parameters = { nextX: interpolator( 1.0, 0.0), nextY: interpolator( 1.0, 0.0) }; break;
    }
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKUncoverTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKUncoverTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("updateParamters"), function(self, _cmd)
{ with(self)
{
    switch (_direction) {
    case SKDirectionDown: _parameters = { prevY: interpolator(0.0, 1.0), prevOnTop: true }; break;
    case SKDirectionUp: _parameters = { prevY: interpolator(0.0, -1.0), prevOnTop: true }; break;
    case SKDirectionLeft: _parameters = { prevX: interpolator(0.0, 1.0), prevOnTop: true }; break;
    case SKDirectionRight: _parameters = { prevX: interpolator(0.0, -1.0), prevOnTop: true }; break;
    case SKDirectionLeftDown: _parameters = { prevX: interpolator(0.0, 1.0), prevY: interpolator(0.0, 1.0), prevOnTop: true }; break;
    case SKDirectionLeftUp: _parameters = { prevX: interpolator(0.0, 1.0), prevY: interpolator(0.0, -1.0), prevOnTop: true }; break;
    case SKDirectionRightDown: _parameters = { prevX: interpolator(0.0, -1.0), prevY: interpolator(0.0, 1.0), prevOnTop: true }; break;
    case SKDirectionRightUp: _parameters = { prevX: interpolator(0.0, -1.0), prevY: interpolator(0.0, -1.0), prevOnTop: true }; break;
    }
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("SKPushTransition")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"SKPushTransition\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("updateParamters"), function(self, _cmd)
{ with(self)
{
    switch (_direction) {
    case SKDirectionDown: _parameters = { nextY: interpolator(-1.0, 0.0), prevY: interpolator(0.0, 1.0) }; break;
    case SKDirectionUp: _parameters = { nextY: interpolator( 1.0, 0.0), prevY: interpolator(0.0, -1.0) }; break;
    case SKDirectionLeft: _parameters = { nextX: interpolator(-1.0, 0.0), prevX: interpolator(0.0, 1.0) }; break;
    case SKDirectionRight: _parameters = { nextX: interpolator( 1.0, 0.0), prevX: interpolator(0.0, -1.0) }; break;
    }
}
});
class_addMethods(the_class, instance_methods);
}



constant= function(to) {
    return (function(progress) { return to; });
}
interpolator= function(from, to) {
    return (function(progress) { return from + (to - from) * progress; });
}
piecewise= function(pieces, dflt) {
    return (function(progress) {
        for (var i = 0; i < pieces.length; i++) {
            var piece = pieces[i];
            if (progress >= piece.s && progress <= piece.e)
                return piece.f((progress - piece.s) / (piece.e - piece.s));
        }
        if (dflt)
            return dflt(progress);
    });
}
keyframes= function(kf) {
    return (function(progress) {

        for (var i = 0; i < kf.length && kf[i].t < progress; i++);

        if (i == 0)
            return kf[i].v;

        if (i == kf.length)
            return kf[i-1].v;

        return kf[i-1].v + (kf[i].v - kf[i-1].v) * ((progress - kf[i-1].t) / (kf[i].t - kf[i-1].t));
    });
}

p;11;TextLayer.jI;24;Foundation/CPException.jI;19;Foundation/CPNull.jI;22;Foundation/CPRunLoop.jI;16;AppKit/CALayer.jc;110632;


TextLayerRichTextPboardType = "TextLayerRichTextPboardType";

TextLayerLeftAlignmentMask = 1 << 0;
TextLayerRightAlignmentMask = 1 << 1;
TextLayerCenterAlignmentMask = 1 << 2;
TextLayerJustifiedAlignmentMask = 1 << 3;
TextLayerAllAlignmentMask = TextLayerLeftAlignmentMask | TextLayerRightAlignmentMask | TextLayerCenterAlignmentMask | TextLayerJustifiedAlignmentMask;

TextLayerAlignmentMaskValues = {}
TextLayerAlignmentMaskValues[TextLayerLeftAlignmentMask] = "left";
TextLayerAlignmentMaskValues[TextLayerRightAlignmentMask] = "right";
TextLayerAlignmentMaskValues[TextLayerCenterAlignmentMask] = "center";
TextLayerAlignmentMaskValues[TextLayerJustifiedAlignmentMask] = "justify";

TextLayerDiscBulletStyleMask = 1 << 0;
TextLayerNumberBulletStyleMask = 1 << 2;
TextLayerAllBulletStyleMask = TextLayerDiscBulletStyleMask | TextLayerNumberBulletStyleMask;

TextLayerBulletStyleMaskValues = {};
TextLayerBulletStyleMaskValues[TextLayerDiscBulletStyleMask] = "disc";
TextLayerBulletStyleMaskValues[TextLayerNumberBulletStyleMask] = "decimal";

TextAttributeOnState = 1 << 0;
TextAttributeOffState = 1 << 1;
TextAttributeMixedState = TextAttributeOnState | TextAttributeOffState;

TextAttributesMake= function(aFontFamily, aSize, aColor, aBoldState, anItalicState, anUnderlineState, anAlignmentMask, aBulletStyleMask)
{
    return { fontFamily:aFontFamily, fontSize:aSize, color:aColor, boldState:aBoldState, italicState:anItalicState, underlineState:anUnderlineState, alignmentMask:anAlignmentMask, bulletStyleMask:aBulletStyleMask };
}

TextAttributesMakeCopy= function(attributes)
{
    return TextAttributesMake(attributes.fontFamily, attributes.fontSize, attributes.color, attributes.boldState, attributes.italicState, attributes.underlineState, attributes.alignmentMask, attributes.bulletStyleMask);
}

TextAttributesCombine= function(lhsAttributes, rhsAttributes)
{
    return TextAttributesMake(
        lhsAttributes.fontFamily == rhsAttributes.fontFamily ? lhsAttributes.fontFamily : nil,
        lhsAttributes.fontSize == rhsAttributes.fontSize ? lhsAttributes.fontSize : 0.0,
        lhsAttributes.color,
        lhsAttributes.boldState | rhsAttributes.boldState,
        lhsAttributes.italicState | rhsAttributes.italicState,
        lhsAttributes.underlineState | rhsAttributes.underlineState,
        lhsAttributes.alignmentMask | rhsAttributes.alignmentMask,
        lhsAttributes.bulletStyleMask | rhsAttributes.bulletStyleMask);
}

var kRight = 39,
    kLeft = 37,
    kDown = 40,
    kUp = 38,
    kFirst = 1,
    kLast = 2,
    kEnd = 3,
    kHome = 4;

var kEmacsConversion = {65: kFirst, 69: kLast, 66: kLeft, 70: kRight, 78: kDown, 80: kUp};
var kArrowConversion = {39: kLast, 37: kFirst, 38: kHome, 40: kEnd};
var kValidCommandKeys = {'b':1, 'i':1, 'u':1, '-':1, '=':1, 'a':1};

var TextLayerSharedCaretBlinkingSuspended = NO,
    TextLayerLastCaretHighlight = 0,
    TextLayerSharedCaret = nil,
    TextLayerSharedCaretTimer = objj_msgSend(CPNull, "null");

var TextLayerWhiteSpaceRegex = /\s/,
    TextLayerWordBreakRegex = /\w/,

    TextLayerLineSpacerElement = nil,
    TextLayerLiElement = nil,
    TextLayerParagraphElement = nil,
    TextLayerUlElement = nil,
    TextLayerNewLineElement = nil,
 TextLayerSpanElement = nil,

    TextLayerSelectionLayers = nil,
    TextLayerSelectionLayerColor = nil;

var TextLayerIsMSIE = NO;

{var the_class = objj_allocateClassPair(CALayer, "TextLayer"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_selectionLayers"), new objj_ivar("_contentLayer"), new objj_ivar("_currentParagraph"), new objj_ivar("_previousCharacter"), new objj_ivar("_selectionStart"), new objj_ivar("_selectionEnd"), new objj_ivar("_lastCharacterOnPreviousLineCacheMap"), new objj_ivar("_firstCharacterOnNextLineCacheMap"), new objj_ivar("_tallestElementCacheMap"), new objj_ivar("_contentLocationCache"), new objj_ivar("_characterDeltaX"), new objj_ivar("_characterDeltaY"), new objj_ivar("_maximumWidth"), new objj_ivar("_maximumHeight"), new objj_ivar("_caretLeftOffset"), new objj_ivar("_isFirstResponder"), new objj_ivar("_needsSelectionRedraw"), new objj_ivar("_isInsertingFromStorageObject"), new objj_ivar("_delegate"), new objj_ivar("_selectionDelegate"), new objj_ivar("_scale"), new objj_ivar("_selectionRange"), new objj_ivar("_typingTextAttributes"), new objj_ivar("_typingTextProperties"), new objj_ivar("_defaultTextAttributes"), new objj_ivar("_slideMaster"), new objj_ivar("_textBody"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("takeSelectionLayerFromPool"), function(self, _cmd)
{ with(self)
{
    if (TextLayerSelectionLayers.length)
        return TextLayerSelectionLayers.pop();

    var layer = objj_msgSend(CALayer, "layer");

    objj_msgSend(layer, "setAnchorPoint:", CGPointMake(0.0,0.0));
    objj_msgSend(layer, "setBackgroundColor:", TextLayerSelectionLayerColor);

    return layer;
}
});
class_methods[1] = new objj_method(sel_registerName("returnSelectionLayerToPool:"), function(self, _cmd, aLayer)
{ with(self)
{
    TextLayerSelectionLayers.push(aLayer);
}
});
class_methods[2] = new objj_method(sel_registerName("initialize"), function(self, _cmd)
{ with(self)
{
    if (self != objj_msgSend(TextLayer, "class"))
        return;

    TextLayerSharedCaret = objj_msgSend(CALayer, "layer");

    objj_msgSend(TextLayerSharedCaret, "setMasksToBounds:", YES);
    objj_msgSend(TextLayerSharedCaret, "setBounds:", CGRectMake(0.0,0.0,1.0,16.0));
    objj_msgSend(TextLayerSharedCaret, "setAnchorPoint:", CGPointMake(0.0,0.0));
    objj_msgSend(TextLayerSharedCaret, "setBackgroundColor:", objj_msgSend(CPColor, "grayColor"));

    TextLayerIsMSIE = navigator && navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0;

    TextLayerLineSpacerElement = document.createElement("div");

    TextLayerLineSpacerElement.className = "lineSpacer";
    TextLayerLineSpacerElement.style.fontSize = "31.25%";

    TextLayerUlElement = document.createElement("ul");

    TextLayerUlElement.style.marginTop = "0";
    TextLayerUlElement.style.paddingTop = "0";
    TextLayerUlElement.style.marginBottom = "0";
    TextLayerUlElement.style.paddingBottom = "0";
    TextLayerUlElement.style.paddingLeft = "0.5em";
    TextLayerUlElement.style.marginLeft = "4.5em";

    TextLayerLiElement = document.createElement("li");

    TextLayerLiElement.style.marginTop = "0";
    TextLayerLiElement.style.paddingTop = "0";
    TextLayerLiElement.style.marginBottom = "0";
    TextLayerLiElement.style.paddingBottom = "0";
    TextLayerLiElement.style.paddingLeft = "0";
    TextLayerLiElement.style.marginleft = "0";
    TextLayerLiElement.style.fontSize = "320%";
 TextLayerLiElement.style.listStyleType = "disc";

    TextLayerParagraphElement = document.createElement("div");
    TextLayerParagraphElement.className = "paragraph";

    TextLayerSpanElement = document.createElement("span");

    TextLayerNewLineElement = document.createElement("span");
    TextLayerNewLineElement.appendChild(document.createTextNode(TextLayerIsMSIE ? '\r' : '\n'));
    TextLayerNewLineElement.style.fontSize = "320%";

    TextLayerSelectionLayers = [];
    TextLayerSelectionLayerColor = objj_msgSend(CPColor, "lightGrayColor");
}
});
class_methods[3] = new objj_method(sel_registerName("blinkCaret"), function(self, _cmd)
{ with(self)
{
    if (TextLayerSharedCaretTimer != objj_msgSend(CPNull, "null"))
        return;

    TextLayerSharedCaretTimer = window.setTimeout(function()
    {
        if (!TextLayerLastCaretHighlight || new Date() - TextLayerLastCaretHighlight > 600)
        {
            objj_msgSend(TextLayerSharedCaret, "setHidden:", !TextLayerSharedCaretBlinkingSuspended&&!objj_msgSend(TextLayerSharedCaret, "isHidden"));
            TextLayerLastCaretHighlight = nil;
        }

        objj_msgSend(objj_msgSend(CPRunLoop, "currentRunLoop"), "performSelectors");

        TextLayerSharedCaretTimer = objj_msgSend(CPNull, "null");

        objj_msgSend(self, "blinkCaret");
    }, 600);
}
});
class_methods[4] = new objj_method(sel_registerName("highlightCaret"), function(self, _cmd)
{ with(self)
{
    TextLayerLastCaretHighlight = new Date();

    objj_msgSend(TextLayerSharedCaret, "setHidden:", NO);
}
});
class_methods[5] = new objj_method(sel_registerName("setCaretBlinkingSuspended:"), function(self, _cmd, isSuspended)
{ with(self)
{
    TextLayerSharedCaretBlinkingSuspended = isSuspended;
}
});
class_methods[6] = new objj_method(sel_registerName("careBlinkingSuspended"), function(self, _cmd)
{ with(self)
{
    return TextLayerSharedCaretBlinkingSuspended;
}
});
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("init"), function(self, _cmd)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CALayer") }, "init");

    if (!self)
        return;

    _scale = 1.0;

    objj_msgSend(self, "setBounds:", CGRectMake(0.0,0.0,100.0,16.0));

    _contentLayer = objj_msgSend(CALayer, "layer");
    _contentLayer._DOMElement.className = "root";

    objj_msgSend(_contentLayer, "setAnchorPoint:", CGPointMake(0.0,0.0));
    objj_msgSend(_contentLayer, "setBounds:", CGRectMakeCopy(objj_msgSend(self, "bounds")));

    objj_msgSend(self, "addSublayer:", _contentLayer);

    _currentParagraph = TextLayerParagraphElement.cloneNode(false);

    _DOMElement.style.fontSize = "10pt";

    _currentParagraph.appendChild(TextLayerNewLineElement.cloneNode(true));
    _contentLayer._DOMElement.appendChild(_currentParagraph);

    if(TextLayerIsMSIE)
    {
        _contentLayer._DOMElement.style.wordWrap = "break-word";
        _contentLayer._DOMElement.style.whiteSpace = "pre";
    }
    else
    {
        _contentLayer._DOMElement.style.whiteSpace = "-moz-pre-wrap";
        _contentLayer._DOMElement.style.whiteSpace = "pre-wrap";
    }

    _caretLeftOffset = 0;

    objj_msgSend(self, "setMasksToBounds:", YES);

    _typingTextProperties = TextAttributesMake("", "", "", "", "", "", "", "");

    _typingTextAttributes = nil;

    objj_msgSend(self, "setDefaultTextAttributes:", TextAttributesMake("Arial",12.0,objj_msgSend(SKColor, "colorWithPresetName:adjustments:", SKBlackPresetColorName, nil),TextAttributeOffState,TextAttributeOffState,TextAttributeOffState,TextLayerLeftAlignmentMask,TextLayerDiscBulletStyleMask));

    _selectionRange = CPMakeRange(0, 0);

    _textBody = nil;

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("setDelegate:"), function(self, _cmd, aDelegate)
{ with(self)
{
    _delegate = aDelegate;
}
});
instance_methods[2] = new objj_method(sel_registerName("delegate"), function(self, _cmd)
{ with(self)
{
    return _delegate;
}
});
instance_methods[3] = new objj_method(sel_registerName("previousCharacter"), function(self, _cmd)
{ with(self)
{
    return _previousCharacter;
}
});
instance_methods[4] = new objj_method(sel_registerName("nextCharacter"), function(self, _cmd)
{ with(self)
{
    if(_previousCharacter)
        return _previousCharacter.nextSibling;
    else
        return _currentParagraph.firstChild;
}
});
instance_methods[5] = new objj_method(sel_registerName("firstCharacter"), function(self, _cmd)
{ with(self)
{
    return objj_msgSend(self, "firstCharacterInParagraph:", objj_msgSend(self, "firstParagraph"));
}
});
instance_methods[6] = new objj_method(sel_registerName("firstParagraph"), function(self, _cmd)
{ with(self)
{
    var paragraph = _contentLayer._DOMElement.firstChild;

    if(paragraph.nodeName == TextLayerUlElement.nodeName)
        while(paragraph.className != TextLayerLineSpacerElement.className)
            paragraph = paragraph.firstChild;

    return paragraph;
}
});
instance_methods[7] = new objj_method(sel_registerName("lastParagraph"), function(self, _cmd)
{ with(self)
{
    var paragraph = _contentLayer._DOMElement.lastChild;

    if(paragraph.nodeName == TextLayerUlElement.nodeName)
        while(paragraph.className != TextLayerLineSpacerElement.className)
            paragraph = paragraph.lastChild;

    return paragraph;
}
});
instance_methods[8] = new objj_method(sel_registerName("lastCharacterInParagraph:"), function(self, _cmd, paragraph)
{ with(self)
{
    if(paragraph)
        return paragraph.lastChild;
    return NULL;
}
});
instance_methods[9] = new objj_method(sel_registerName("firstCharacterInParagraph:"), function(self, _cmd, paragraph)
{ with(self)
{
    if(paragraph)
        return paragraph.firstChild;
    return NULL;
}
});
instance_methods[10] = new objj_method(sel_registerName("setBounds:"), function(self, _cmd, bounds)
{ with(self)
{
    objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CALayer") }, "setBounds:", bounds);
    objj_msgSend(_contentLayer, "setBounds:", CGRectMakeCopy(bounds));

    objj_msgSend(self, "setNeedsSelectionRedraw");
}
});
instance_methods[11] = new objj_method(sel_registerName("resize"), function(self, _cmd)
{ with(self)
{
    return;

    var lastChild = _contentLayer._DOMElement.lastChild;

    var deltaY = _contentLayer._DOMElement.offsetTop;
    var height = lastChild.offsetTop - deltaY + lastChild.offsetHeight;
    var currentWidth = CGRectGetWidth(objj_msgSend(self, "bounds"));

    objj_msgSend(self, "setBounds:", CPRectMake(0.0,0.0,currentWidth,height));
    objj_msgSend(_contentLayer, "setBounds:", CPRectMake(0.0,0.0,currentWidth,height));
}
});
instance_methods[12] = new objj_method(sel_registerName("adoptSharedCaret"), function(self, _cmd)
{ with(self)
{
    if (objj_msgSend(TextLayerSharedCaret, "superlayer") == self)
        return;

    objj_msgSend(self, "addSublayer:", TextLayerSharedCaret);
    objj_msgSend(self, "positionCaret");

    objj_msgSend(TextLayer, "blinkCaret");
}
});
instance_methods[13] = new objj_method(sel_registerName("orphanSharedCaret"), function(self, _cmd)
{ with(self)
{
    objj_msgSend(TextLayerSharedCaret, "removeFromSuperlayer");

    if(TextLayerSharedCaretTimer != objj_msgSend(CPNull, "null"))
        window.clearTimeout(TextLayerSharedCaretTimer);

    TextLayerSharedCaretTimer = objj_msgSend(CPNull, "null");
}
});
instance_methods[14] = new objj_method(sel_registerName("becomeFirstResponder"), function(self, _cmd)
{ with(self)
{
    if (_isFirstResponder)
        return;

    _isFirstResponder = YES;

    objj_msgSend(self, "adoptSharedCaret");

    objj_msgSend(self, "updateTypingTextAttributes");
}
});
instance_methods[15] = new objj_method(sel_registerName("resignFirstResponder"), function(self, _cmd)
{ with(self)
{
    _isFirstResponder = NO;

    objj_msgSend(self, "orphanSharedCaret");

    objj_msgSend(self, "clearSelection");

    objj_msgSend(self, "updateTypingTextAttributes");
}
});
instance_methods[16] = new objj_method(sel_registerName("keyDown:"), function(self, _cmd, anEvent)
{ with(self)
{
    var keyCode = objj_msgSend(anEvent, "keyCode");
    var character = objj_msgSend(anEvent, "characters");
    var flags = objj_msgSend(anEvent, "modifierFlags");

    if(flags & (CPCommandKeyMask | CPControlKeyMask))
        if((keyCode < 36 || keyCode > 41) && !kEmacsConversion[keyCode] && !kValidCommandKeys[character])
            return;

    if(kValidCommandKeys[character] && (flags & (CPCommandKeyMask | CPControlKeyMask)))
    {
        switch(character)
        {
            case 'b': if (_typingTextAttributes.boldState & TextAttributeOffState)
                            objj_msgSend(self, "bold:", self);
                        else
                            objj_msgSend(self, "unbold:", self);

                        break;

            case 'i': if (_typingTextAttributes.italicState & TextAttributeOffState)
                            objj_msgSend(self, "italicize:", self);
                        else
                            objj_msgSend(self, "unitalicize:", self);

                        break;

            case 'u': if (_typingTextAttributes.underlineState & TextAttributeOffState)
                            objj_msgSend(self, "underline:", self);
                        else
                            objj_msgSend(self, "ununderline:", self);

                        break;

            case '=': objj_msgSend(self, "resizeFontByFactor:", 1.25);
                        break;

            case '-': objj_msgSend(self, "resizeFontByFactor:", 0.85);
                        break;

            case 'a': objj_msgSend(self, "selectAll");
                        break;
        }

        return;
    }

    if(objj_msgSend(self, "hasSelection") && keyCode != 9)
    {
        switch(keyCode)
        {
            case 8:
            case 46: objj_msgSend(self, "deleteSelection");
                        objj_msgSend(self, "positionCaret");
                        objj_msgSend(self, "redrawSelection");
                        return;

            case 36: objj_msgSend(self, "moveCaret:extendSelection:", kHome, flags&CPShiftKeyMask);
                        objj_msgSend(self, "positionCaret");
                        objj_msgSend(self, "redrawSelection");
                        return;

            case 35: objj_msgSend(self, "moveCaret:extendSelection:", kEnd, flags&CPShiftKeyMask);
                        objj_msgSend(self, "positionCaret");
                        objj_msgSend(self, "redrawSelection");
                        return;

            case 37:
            case 38:
            case 39:
            case 40: if(flags & CPCommandKeyMask)
                            objj_msgSend(self, "moveCaret:extendSelection:", kArrowConversion[keyCode], flags&CPShiftKeyMask);
                        else
                            objj_msgSend(self, "moveCaret:extendSelection:", keyCode, flags&CPShiftKeyMask);

                        objj_msgSend(self, "positionCaret");
                        objj_msgSend(self, "redrawSelection");
                        return;

            case 65:
            case 69:
            case 66:
            case 70:
            case 78:
            case 80: if(flags & CPControlKeyMask)
                        {
                            objj_msgSend(self, "moveCaret:extendSelection:", kEmacsConversion[keyCode], flags&CPShiftKeyMask);
                            objj_msgSend(self, "positionCaret");
                            objj_msgSend(self, "redrawSelection");
                            return;
                        }

            default: objj_msgSend(self, "deleteSelection");
                        break;
        }

        _selectionStart = _selectionEnd = NULL;
        objj_msgSend(self, "redrawSelection");
    }

    switch(keyCode)
    {
        case 8:
        case 46: objj_msgSend(self, "removeCharacter:stillDeleting:", keyCode==8?kLeft:kRight, NO);
                    break;

        case 36: objj_msgSend(self, "moveCaret:extendSelection:", kHome, flags&CPShiftKeyMask);
                    break;

        case 35: objj_msgSend(self, "moveCaret:extendSelection:", kEnd, flags&CPShiftKeyMask);
                    break;

        case 37:
        case 38:
        case 39:
        case 40: if(flags & CPCommandKeyMask)
                        objj_msgSend(self, "moveCaret:extendSelection:", kArrowConversion[keyCode], flags&CPShiftKeyMask);
                    else
                        objj_msgSend(self, "moveCaret:extendSelection:", keyCode, flags&CPShiftKeyMask);

                    break;

        case 9: if(flags & CPShiftKeyMask)
                        objj_msgSend(self, "_decreaseBulletLevel");
                    else
                        objj_msgSend(self, "_increaseBulletLevel");
                    break;

        case 13: objj_msgSend(self, "insertReturn");
                    break;

        case 65:
        case 69:
        case 66:
        case 70:
        case 78:
        case 80: if(flags & CPControlKeyMask)
                    {
                        objj_msgSend(self, "moveCaret:extendSelection:", kEmacsConversion[keyCode], flags&CPShiftKeyMask);
                        break;
                    }

        default: objj_msgSend(self, "insertCharacter:stillInserting:", character, NO);
                    break;
    }

    objj_msgSend(self, "textDidChange")

    objj_msgSend(self, "resize");
    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "redrawSelection");
}
});
instance_methods[17] = new objj_method(sel_registerName("insertCharacter:stillInserting:"), function(self, _cmd, aCharacter, isStillInserting)
{ with(self)
{
    if (!isStillInserting)
        if (!objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
            return;






    var nextCharacter = objj_msgSend(self, "nextCharacter"),
        newSpan;

    if (newSpan)
        newSpan = newSpan.cloneNode(false);
    else
    {
        newSpan = document.createElement("span");

        setFontSize(newSpan, _typingTextProperties.fontSize);
        takeStyleFrom(newSpan, _typingTextProperties);
    }

    newSpan.appendChild(document.createTextNode(aCharacter));

    _currentParagraph.insertBefore(newSpan, nextCharacter);

    _previousCharacter = newSpan;

    ++_selectionRange.location;

    if (!isStillInserting)
    {
        objj_msgSend(self, "selectionDidChange");

        objj_msgSend(self, "resize");
        objj_msgSend(self, "positionCaret");

        objj_msgSend(self, "textDidChange");
    }
}
});
instance_methods[18] = new objj_method(sel_registerName("copy:"), function(self, _cmd, sender)
{ with(self)
{
    if(objj_msgSend(self, "hasSelection"))
    {
        if(objj_msgSend(self, "selectionIsInverted"))
            var start = _selectionEnd, end = _selectionStart;
        else
            var start = _selectionStart, end = _selectionEnd;

        var current = start, previous = null, result = "";
        while(current && current != end)
        {
            if(previous && current.parentNode != previous.parentNode)
            {
                if(current.parentNode.className == TextLayerLineSpacerElement.className)
                {
                    var depth = getBulletDepth(current.parentNode);
                    while(depth--)
                        result += "\t";
                }
            }

            result += current.firstChild.nodeValue;

            previous = current;
            current = nextCharacter(current);
        }

        var textObject = objj_msgSend(self, "rtfObjectFrom:to:forCopy:", start, end, YES);

        var pasteboard = objj_msgSend(CPPasteboard, "generalPasteboard");
        objj_msgSend(pasteboard, "declareTypes:owner:", [CPStringPboardType,TextLayerRichTextPboardType], nil);

        objj_msgSend(pasteboard, "setString:forType:", result, CPStringPboardType);
        objj_msgSend(pasteboard, "setString:forType:", CPJSObjectCreateJSON(textObject), TextLayerRichTextPboardType);
    }
}
});
instance_methods[19] = new objj_method(sel_registerName("cut:"), function(self, _cmd, sender)
{ with(self)
{
    if(objj_msgSend(self, "hasSelection"))
    {
        objj_msgSend(self, "copy:", sender);
        objj_msgSend(self, "deleteSelection");
    }
}
});
instance_methods[20] = new objj_method(sel_registerName("paste:"), function(self, _cmd, sender)
{ with(self)
{
    if (!objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
        return;

    var pasteboard = objj_msgSend(CPPasteboard, "generalPasteboard"),
        types = objj_msgSend(pasteboard, "types");

    if(objj_msgSend(types, "containsObject:", TextLayerRichTextPboardType))
    {
        if(objj_msgSend(self, "hasSelection"))
            objj_msgSend(self, "deleteSelection");

        var textObject = CPJSObjectCreateWithJSON(objj_msgSend(pasteboard, "stringForType:", TextLayerRichTextPboardType));

        objj_msgSend(self, "insertFromStorageObject:", textObject);
    }
    else if(objj_msgSend(types, "containsObject:", CPStringPboardType))
    {
        if(objj_msgSend(self, "hasSelection"))
            objj_msgSend(self, "deleteSelection");

        var textObject = objj_msgSend(pasteboard, "stringForType:", CPStringPboardType);

        for(var i=0; i<textObject.length; i++)
        {
            switch(textObject.charAt(i))
            {
                case "\t" : objj_msgSend(self, "changeBulletLevel:", kRight);
                                break;

                case "\r" :
                case "\n" : objj_msgSend(self, "insertReturn");
                                break;

                default : objj_msgSend(self, "insertCharacter:stillInserting:", textObject.charAt(i), YES);
                                break;
            }
        }
    }
    else
        return;

    objj_msgSend(self, "selectionDidChange");

    objj_msgSend(self, "resize");
    objj_msgSend(self, "positionCaret");

    objj_msgSend(self, "textDidChange");
}
});
instance_methods[21] = new objj_method(sel_registerName("textDidChange"), function(self, _cmd)
{ with(self)
{
    _textBody = nil;
    objj_msgSend(_delegate, "textDidChange:", self);
}
});
instance_methods[22] = new objj_method(sel_registerName("textBody"), function(self, _cmd)
{ with(self)
{
    if (!_textBody)
    {
        var contentElement = _contentLayer._DOMElement,
            contentChildren = contentElement.childNodes,
            isEmpty = contentChildren.length == 1 && contentChildren[0].className == TextLayerParagraphElement.className && contentChildren[0].childNodes.length == 1;

        _textBody = objj_msgSend(objj_msgSend(SKTextString, "alloc"), "initWithTextLayer:html:isEmpty:", self, contentElement.innerHTML, isEmpty);
    }

    return _textBody;
}
});
instance_methods[23] = new objj_method(sel_registerName("setTextBody:"), function(self, _cmd, textBody)
{ with(self)
{
    if(objj_msgSend(textBody, "respondsToSelector:", sel_registerName("html")))
        _contentLayer._DOMElement.innerHTML = objj_msgSend(textBody, "html");
    else if (textBody.indexOf("{\"format\":\"rosstf\",") != 0)
        objj_msgSend(self, "setStringValue:", textBody);
    else
        objj_msgSend(self, "setHTMLFromStorageObject:", CPJSObjectCreateWithJSON(textBody));
}
});
instance_methods[24] = new objj_method(sel_registerName("setTextBody_:"), function(self, _cmd, textBody)
{ with(self)
{
    if (!objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
        return;

    objj_msgSend(self, "setTextBody:", textBody);

    objj_msgSend(self, "textDidChange")
}
});
instance_methods[25] = new objj_method(sel_registerName("setStringValue:"), function(self, _cmd, aStringValue)
{ with(self)
{
    objj_msgSend(self, "selectAll");
    objj_msgSend(self, "deleteSelection");

    var index = 0,
        count = aStringValue.length;

    for(; index < count; ++index)
    {
        var character = aStringValue.charAt(index);

        if(character != "\r" && character != "\n")
            objj_msgSend(self, "insertCharacter:stillInserting:", character, YES);
        else
            objj_msgSend(self, "insertReturn");
    }


    if (objj_msgSend(aStringValue, "length"))
        objj_msgSend(self, "selectionDidChange");
}
});
instance_methods[26] = new objj_method(sel_registerName("moveCaret:extendSelection:"), function(self, _cmd, direction, extendSelection)
{ with(self)
{
    if(objj_msgSend(self, "hasSelection") && !extendSelection)
    {
        if(objj_msgSend(self, "selectionIsInverted"))
            var start = _selectionEnd, end = _selectionStart;
        else
            var start = _selectionStart, end = _selectionEnd;

        switch(direction)
        {
            case kUp:
            case kLeft: _previousCharacter = start.previousSibling;
                            _currentParagraph = start.parentNode;

                            _selectionRange.length = 0;
                            objj_msgSend(self, "selectionDidChange");

                            return _selectionStart = _selectionEnd = NULL;
            case kDown:
            case kRight: _previousCharacter = end.previousSibling;
                            _currentParagraph = end.parentNode;

                            _selectionRange.location = CPMaxRange(_selectionRange);
                            _selectionRange.length = 0;
                            objj_msgSend(self, "selectionDidChange");

                            return _selectionStart = _selectionEnd = NULL;
        }
    }

    if(extendSelection && !objj_msgSend(self, "hasSelection"))
    {
        if(_previousCharacter)
            _selectionEnd = _selectionStart = _previousCharacter.nextSibling;
        else
            _selectionEnd = _selectionStart = _currentParagraph.firstChild;

        var start = _selectionStart, end = _selectionEnd, inverted = false;
    }
    else if(extendSelection)
    {
        var inverted = objj_msgSend(self, "selectionIsInverted");
        if(inverted)
            var start = _selectionEnd, end = _selectionStart;
        else
            var start = _selectionStart, end = _selectionEnd;
    }

    switch(direction)
    {
        case kLeft: if(extendSelection)
                        {
                            var previous = previousCharacter(start);
                            if(previous)
                            {
                                start = previous;

                                --_selectionRange.location;
                                ++_selectionRange.length;
                            }

                            break;
                        }

                        if(_previousCharacter != NULL)
                        {
                            _previousCharacter = _previousCharacter.previousSibling;
                            _caretLeftOffset = _previousCharacter ? _previousCharacter.offsetLeft : 0;

                            --_selectionRange.location;

                            break;
                        }

                        var previousParagraph = traversePreviousNode(_currentParagraph);
                        if(previousParagraph && previousParagraph.nodeName != TextLayerUlElement.nodeName)
                        {
                            _currentParagraph = previousParagraph;
                            _previousCharacter = _currentParagraph.lastChild.previousSibling;
                            _caretLeftOffset = _previousCharacter.offsetLeft;

                            --_selectionRange.location;
                        }
                        break;

        case kRight: if(extendSelection)
                        {
                            var next = nextCharacter(end);
                            if(next)
                            {
                                end = next;

                                ++_selectionRange.length;
                            }

                            break;
                        }

                        var nextChar = objj_msgSend(self, "nextCharacter");
                        if(nextChar != NULL && nextChar.innerHTML != TextLayerNewLineElement.innerHTML)
                        {
                            _previousCharacter = nextChar;
                            _caretLeftOffset = nextChar.offsetLeft;

                            ++_selectionRange.location;

                            break;
                        }

                        var nextParagraph = traverseNextNode(_currentParagraph);
                        if(nextParagraph && nextParagraph.nodeName != TextLayerUlElement.nodeName)
                        {
                            _currentParagraph = nextParagraph;
                            _previousCharacter = NULL;
                            _caretLeftOffset = 0;

                            ++_selectionRange.location;
                        }

                        break;

        case kUp: var currentLeftOffset = 0, currentNode = _previousCharacter;
                        if(currentNode)
                            currentLeftOffset = currentNode.offsetLeft + 1;

                        while(currentNode && currentNode.offsetLeft < currentLeftOffset)
                            currentNode = currentNode.previousSibling;

                        if(!currentNode)
                        {
                            var previousParagraph = traversePreviousNode(_currentParagraph);
                            if(previousParagraph)
                            {
                                _currentParagraph = previousParagraph;
                                currentNode = previousParagraph.lastChild.previousSibling;
                            }
                        }

                        while(currentNode && currentNode.offsetLeft > _caretLeftOffset)
                            currentNode = currentNode.previousSibling;

                        _previousCharacter = currentNode;

                        if(extendSelection)
                            start = objj_msgSend(self, "nextCharacter");

                        objj_msgSend(self, "calculateSelectedRange");

                        break;

        case kDown: var currentLeftOffset = 0, currentNode = objj_msgSend(self, "nextCharacter");
                        if(currentNode)
                            currentLeftOffset = currentNode.offsetLeft;

                        while(currentNode && currentNode.offsetLeft >= currentLeftOffset)
                            currentNode = currentNode.nextSibling;

                        if(!currentNode)
                        {
                            var nextParagraph = traverseNextNode(_currentParagraph);
                            if(nextParagraph)
                            {
                                _currentParagraph = nextParagraph;
                                currentNode = nextParagraph.firstChild;
                            }
                        }

                        while(currentNode && currentNode.offsetLeft <= _caretLeftOffset)
                            currentNode = currentNode.nextSibling;

                        if(currentNode && currentNode.innerHTML != TextLayerNewLineElement.innerHTML)
                            _previousCharacter = currentNode;
                        else
                            _previousCharacter = _currentParagraph.lastChild.previousSibling;

                        if(extendSelection)
                            end = objj_msgSend(self, "nextCharacter");

                        objj_msgSend(self, "calculateSelectedRange");

                        break;

        case kHome: _currentParagraph = _contentLayer._DOMElement.firstChild;
                        while(_currentParagraph.nodeName == TextLayerUlElement.nodeName)
                            _currentParagraph = paragraph.firstChild;







                        _previousCharacter = NULL;
                        _selectionStart = _selectionEnd = NULL;

                        _selectionRange = CPMakeRange(0, 0);

                        break;

        case kEnd: _currentParagraph = _contentLayer._DOMElement.lastChild;
                        while(_currentParagraph.nodeName == TextLayerUlElement.nodeName)
                            _currentParagraph = paragraph.lastChild;







                        _previousCharacter = _currentParagraph.lastChild.previousSibling;
                        _selectionStart = _selectionEnd = NULL;

                        objj_msgSend(self, "calculateSelectedRange");

                        break;

        case kFirst:





                        _previousCharacter = NULL;
                        _selectionStart = _selectionEnd = NULL;

                        objj_msgSend(self, "calculateSelectedRange");

                        break;

        case kLast:





                        _previousCharacter = _currentParagraph.lastChild.previousSibling;
                        _selectionStart = _selectionEnd = NULL;

                        objj_msgSend(self, "calculateSelectedRange");

                        break;
    }

    if(extendSelection)
    {
        if(!inverted)
        {
            _selectionStart = start;
            _selectionEnd = end;
        }
        else
        {
            _selectionStart = end;
            _selectionEnd = start;
        }
    }

    objj_msgSend(self, "selectionDidChange");
}
});
instance_methods[27] = new objj_method(sel_registerName("removeCharacter:stillDeleting:"), function(self, _cmd, direction, isStillDeleting)
{ with(self)
{
    if (!isStillDeleting)
    {
        if (!objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
            return;

        objj_msgSend(self, "selectionDidChange");
    }

    if(direction == kRight)
    {
        return;
        var nextChar = objj_msgSend(self, "nextCharacter");
        if(nextChar.innerHTML != TextLayerNewLineElement.innerHTML)
        {
            _currentParagraph.removeChild(nextChar);
        }
        else
        {


        }
    }
    else
    {
        var currentCharacter = objj_msgSend(self, "previousCharacter");
        if(currentCharacter)
        {
            var previous = currentCharacter.previousSibling;
            _currentParagraph.removeChild(currentCharacter);
            _previousCharacter = previous;
            _caretLeftOffset = _previousCharacter ? _previousCharacter.offsetLeft : 0;

            if (!isStillDeleting)
                --_selectionRange.location;
        }
        else
        {
            if(_currentParagraph.parentNode.nodeName == TextLayerLiElement.nodeName)
                objj_msgSend(self, "changeBulletLevel:", kLeft);
            else
            {
                var previousParagraph = _currentParagraph.previousSibling;
                if(!previousParagraph)
                    return;

                if (!isStillDeleting)
                    --_selectionRange.location;

                while(previousParagraph.firstChild.firstChild.nodeType != 3)
                    previousParagraph = previousParagraph.lastChild;

                var lastCharOfLastParagraph = objj_msgSend(self, "lastCharacterInParagraph:", previousParagraph);
                var nextCursorPosition = lastCharOfLastParagraph.previousSibling;

                var start = objj_msgSend(self, "nextCharacter");
                var end = objj_msgSend(self, "lastCharacterInParagraph:", _currentParagraph);

                while(start && start != end)
                {
                    var next = start.nextSibling;
                    previousParagraph.insertBefore(start, lastCharOfLastParagraph);
                    start = next;
                }

                _contentLayer._DOMElement.removeChild(_currentParagraph);
                _previousCharacter = nextCursorPosition;
                _currentParagraph = previousParagraph;
                _caretLeftOffset = _previousCharacter ? _previousCharacter.offsetLeft : 0;
            }
        }
    }
}
});
instance_methods[28] = new objj_method(sel_registerName("insertReturn"), function(self, _cmd)
{ with(self)
{
    var start = objj_msgSend(self, "nextCharacter");
    var end = objj_msgSend(self, "lastCharacterInParagraph:", _currentParagraph);

    var newParagraph = _currentParagraph.cloneNode(false);
    while(start && start!=end)
    {
        var next = start.nextSibling;
        newParagraph.appendChild(start);
        start = next;
    }

    var newLine = TextLayerNewLineElement.cloneNode(true);
    newParagraph.appendChild(newLine);

    var aSize = _typingTextAttributes.fontSize;

    if(_currentParagraph.parentNode.nodeName == TextLayerLiElement.nodeName)
    {
        var newLI = _currentParagraph.parentNode.cloneNode(false);
        newLI.appendChild(newParagraph);

        objj_msgSend(self, "applyFontSize:toElement:", aSize, newLI);
        objj_msgSend(self, "applyFontSize:toElement:", ((1.0/aSize)*100.0), newParagraph);

        _currentParagraph.parentNode.parentNode.insertBefore(newLI, _currentParagraph.parentNode.nextSibling);
    }
    else
        _currentParagraph.parentNode.insertBefore(newParagraph, _currentParagraph.nextSibling);

    objj_msgSend(self, "applyFontSize:toElement:", aSize, newLine);

    takeStyleFrom(newLine, _typingTextProperties);

    _currentParagraph = newParagraph;
    _previousCharacter = NULL;
    _caretLeftOffset = 0;

    ++_selectionRange.location;

    objj_msgSend(self, "textDidChange")
}
});
instance_methods[29] = new objj_method(sel_registerName("changeBulletLevel:"), function(self, _cmd, direction)
{ with(self)
{
    var paragraph = objj_msgSend(self, "nextCharacter").parentNode;
    var liNode = paragraph.parentNode
    var liParent = liNode.parentNode;
    var parentsParent = liParent.parentNode;

    if(direction == kLeft)
    {
        if (paragraph.className != TextLayerLineSpacerElement.className)
            return;

        var newUL = liParent.cloneNode(false);
        while(liNode.nextSibling)
            newUL.appendChild(liNode.nextSibling);

        if(parentsParent.className == "root")
        {
            var newDiv = TextLayerParagraphElement.cloneNode(false);

            newDiv.style.textAlign = _typingTextProperties.alignmentMask;

            while(paragraph.firstChild)
                newDiv.appendChild(paragraph.firstChild);

            parentsParent.insertBefore(newUL, liParent.nextSibling);
            parentsParent.insertBefore(newDiv, newUL);
            liParent.removeChild(liNode);
            _currentParagraph = newDiv;
        }
        else
        {
            parentsParent.insertBefore(newUL, liParent.nextSibling);
            parentsParent.insertBefore(liNode, newUL);
        }

        if(!liParent.childNodes || liParent.childNodes.length == 0)
            parentsParent.removeChild(liParent);

        if(!newUL.childNodes || newUL.childNodes.length == 0)
            parentsParent.removeChild(newUL);
    }
    else
    {
        if(paragraph.className == TextLayerLineSpacerElement.className)
        {
            if(liNode.previousSibling && liNode.previousSibling.nodeName == TextLayerUlElement.nodeName)
            {
                if(liNode.nextSibling && liNode.nextSibling.nodeName == TextLayerUlElement.nodeName)
                {
                    var nextList = liNode.nextSibling;
                    var lastList = liNode.previousSibling;

                    lastList.appendChild(liNode);
                    while(nextList.firstChild)
                        lastList.appendChild(nextList.firstChild);

                    liParent.removeChild(nextList);
                }
                else
                    liNode.previousSibling.appendChild(liNode);
            }
            else if(liNode.nextSibling && liNode.nextSibling.nodeName == TextLayerUlElement.nodeName)
                liNode.nextSibling.insertBefore(liNode, liNode.nextSibling.firstChild);
            else
            {
                var newUL = TextLayerUlElement.cloneNode(false);
                liParent.insertBefore(newUL, liNode);
                newUL.appendChild(liNode);
            }

            if(!liParent.childNodes || liParent.childNodes.length == 0)
                parentsParent.removeChild(liParent);
        }
        else
        {
            var newList = TextLayerLiElement.cloneNode(false);
            var newScaler = TextLayerLineSpacerElement.cloneNode(false);

            newScaler.style.textAlign = _typingTextProperties.alignmentMask;

            newList.appendChild(newScaler);

            while(paragraph.firstChild)
                newScaler.appendChild(paragraph.firstChild);

            if(paragraph.previousSibling && paragraph.previousSibling.nodeName == TextLayerUlElement.nodeName)
            {
                var lastList = paragraph.previousSibling;
                if(paragraph.nextSibling && paragraph.nextSibling.nodeName == TextLayerUlElement.nodeName)
                {
                    lastList.appendChild(newList);

                    var nextList = paragraph.nextSibling;
                    while(nextList.firstChild)
                        lastList.appendChild(nextList.firstChild);

                    _contentLayer._DOMElement.removeChild(nextList);
                }
                else
                    lastList.appendChild(newList);
            }
            else if(paragraph.nextSibling && paragraph.nextSibling.nodeName == TextLayerUlElement.nodeName)
                paragraph.nextSibling.insertBefore(newList, paragraph.nextSibling.firstChild);
            else
            {
                var newUL = TextLayerUlElement.cloneNode(false);
                newUL.appendChild(newList);
                _contentLayer._DOMElement.insertBefore(newUL, paragraph);
            }

            _contentLayer._DOMElement.removeChild(paragraph);
            _currentParagraph = newScaler;
        }
    }

    _caretLeftOffset = _previousCharacter ? _previousCharacter.offsetLeft : 0;

    objj_msgSend(self, "textDidChange")
}
});
instance_methods[30] = new objj_method(sel_registerName("mouseDown:"), function(self, _cmd, anEvent)
{ with(self)
{
    _tallestElementCacheMap = new Array();
    _firstCharacterOnNextLineCacheMap = new Array();
    _lastCharacterOnPreviousLineCacheMap = new Array();

    _contentLocationCache = locationInWindow(_contentLayer._DOMElement);

    var target = objj_msgSend(self, "returnTarget:", anEvent);
    var count = objj_msgSend(anEvent, "clickCount");

    if(objj_msgSend(anEvent, "modifierFlags") & CPShiftKeyMask)
    {
        if(!objj_msgSend(self, "hasSelection"))
            _selectionStart = _selectionEnd = _previousCharacter;

        objj_msgSend(self, "extendSelection:", target);
    }
    else if(count >= 3 && target.character && target.character == _previousCharacter && target.character.firstChild &&
       target.character.firstChild.nodeType == 3 && target.character.innerHTML != TextLayerNewLineElement.innerHTML)
    {
        _selectionStart = _currentParagraph.firstChild;
        _selectionEnd = _currentParagraph.lastChild;
    }
    else if(count >= 2 && target.character && target.character == _previousCharacter && target.character.firstChild &&
       target.character.firstChild.nodeType == 3 && target.character.innerHTML != TextLayerNewLineElement.innerHTML)
    {
        var regex = TextLayerWordBreakRegex;
        if(target.character && !target.character.firstChild.nodeValue.match(regex))
            regex = TextLayerWhiteSpaceRegex;

        var start = target.character ? target.character : target.paragraph.firstChild;
        while(start && start.previousSibling && start.previousSibling.firstChild.nodeValue.match(regex))
            start = start.previousSibling;

        var end = target.character;
        while(end && end.firstChild.nodeValue.match(regex) && end.innerHTML != TextLayerNewLineElement.innerHTML)
            end = end.nextSibling;

        _selectionStart = start;
        _selectionEnd = end;
    }
    else
    {
        _previousCharacter = target.character;
        _currentParagraph = target.paragraph;
        _caretLeftOffset = _previousCharacter ? _previousCharacter.offsetLeft : 0;

        _selectionStart = _selectionEnd = objj_msgSend(self, "nextCharacter");
    }

    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "redrawSelection");
}
});
instance_methods[31] = new objj_method(sel_registerName("mouseDragged:"), function(self, _cmd, anEvent)
{ with(self)
{
    var target = objj_msgSend(self, "returnTarget:", anEvent);

    if(target.character)
        var charOfInterest = target.character.nextSibling;
    else
        var charOfInterest = target.paragraph.firstChild;

    if(objj_msgSend(anEvent, "modifierFlags") & CPShiftKeyMask)
    {
        objj_msgSend(self, "extendSelection:", target);
    }
    else
    {
        _selectionEnd = charOfInterest;
    }

    objj_msgSend(self, "redrawSelectionWhileStillSelecting:", YES);
}
});
instance_methods[32] = new objj_method(sel_registerName("extendSelection:"), function(self, _cmd, target)
{ with(self)
{
    var charOfInterest = target.character;

    if(!charOfInterest)
        charOfInterest = target.paragraph.firstChild;
    else
        charOfInterest = charOfInterest.nextSibling;

    if(objj_msgSend(self, "selectionIsInverted"))
        var start = _selectionEnd, end = _selectionStart;
    else
        var start = _selectionStart, end = _selectionEnd;

    var beforeStart = comparator(charOfInterest, CPPointMake(start.offsetLeft, start.offsetTop), self, YES) > 0;
    var afterEnd = comparator(charOfInterest, CPPointMake(end.offsetLeft, end.offsetTop), self, YES) < 0;

    if(beforeStart)
        start = charOfInterest;
    else if(afterEnd)
        end = charOfInterest;
    else
    {

        var distanceToStart = SQRT((charOfInterest.offsetLeft-start.offsetLeft)*(charOfInterest.offsetLeft-start.offsetLeft)+
                                   (charOfInterest.offsetTop-start.offsetTop)*(charOfInterest.offsetTop-start.offsetTop));

        var distanceToEnd = SQRT((charOfInterest.offsetLeft-end.offsetLeft)*(charOfInterest.offsetLeft-end.offsetLeft) +
                                   (charOfInterest.offsetTop-end.offsetTop)*(charOfInterest.offsetTop-end.offsetTop));

        if(distanceToStart < distanceToEnd)
            start = charOfInterest;
        else
            end = charOfInterest;
    }

    _selectionStart = start;
    _selectionEnd = end;
}
});
instance_methods[33] = new objj_method(sel_registerName("mouseUp:"), function(self, _cmd, anEvent)
{ with(self)
{
    _contentLocationCache = NULL;
    _tallestElementCacheMap = NULL;
    _firstCharacterOnNextLineCacheMap = NULL;
    _lastCharacterOnPreviousLineCacheMap = NULL;

    objj_msgSend(self, "redrawSelection");
    objj_msgSend(self, "positionCaret");

    objj_msgSend(self, "calculateSelectedRange");
    objj_msgSend(self, "selectionDidChange");
}
});
instance_methods[34] = new objj_method(sel_registerName("returnTarget:"), function(self, _cmd, event)
{ with(self)
{
    var domEvent = objj_msgSend(event, "_DOMEvent");
    var location = objj_msgSend(event, "locationInWindow");
    var target = domEvent.srcElement || domEvent.target;

    var content = _contentLayer._DOMElement;

    if(_contentLocationCache)
        var contentLocation = _contentLocationCache;
    else
        var contentLocation = locationInWindow(content);

    var relativeX = location.x - contentLocation.x + content.offsetLeft;
    var relativeY = location.y - contentLocation.y + content.offsetTop;

    if(relativeY >= content.lastChild.offsetTop + content.lastChild.offsetHeight)
    {
        var lastParagraph = content.lastChild;
        while(lastParagraph.nodeName == TextLayerUlElement.nodeName)
            lastParagraph = lastParagraph.lastChild;

        if(lastParagraph.nodeName == TextLayerLiElement.nodeName)
            lastParagraph = lastParagraph.firstChild;

        return { character: lastParagraph.lastChild.previousSibling, paragraph: lastParagraph };
    }

    if(relativeY < content.firstChild.offsetTop)
    {
        var firstParagraph = content.firstChild;
        while(firstParagraph.nodeName == TextLayerUlElement.nodeName)
            firstParagraph = firstParagraph.firstChild;

        if(firstParagraph.nodeName == TextLayerLiElement.nodeName)
            firstParagraph = firstParagraph.firstChild;

        return { character: NULL, paragraph: firstParagraph };
    }

    var element = content;
    while(element && element.firstChild.firstChild.nodeType != 3 && element.nodeName != TextLayerLiElement.nodeName)
        element = objj_msgSend(self, "binarySearch:compare:args:", element.childNodes, targetComparator, relativeY);


    if(element && element.nodeName == TextLayerLiElement.nodeName)
        element = element.firstChild;

    if(!element)
        return {character:NULL, paragraph:_contentLayer._DOMElement.firstChild};
    else if(element.firstChild.innerHTML == TextLayerNewLineElement.innerHTML)
        return { character: NULL, paragraph: element };

    var character = objj_msgSend(self, "binarySearch:compare:args:", element.childNodes, paragraphComparator, CGPointMake(relativeX,relativeY));

    if(character)
    {
        if(relativeX - character.offsetLeft < character.offsetWidth / 2.0)
            return { character: character.previousSibling, paragraph: character.parentNode };

        return { character:character, paragraph:character.parentNode };
    }

    character = objj_msgSend(self, "binarySearch:compare:args:", element.childNodes, targetComparator, relativeY);

    var leftOffset = character.offsetLeft;
    var leftCharacter = character.previousSibling;
    while(leftCharacter && leftCharacter.offsetLeft < leftOffset)
    {
        leftOffset = leftCharacter.offsetLeft;
        leftCharacter = leftCharacter.previousSibling;
    }

    if(relativeX < leftOffset)
    {
        if(leftCharacter && leftCharacter.innerHTML == TextLayerNewLineElement.innerHTML)
            leftCharacter = leftCharacter.previousSibling;

        character = leftCharacter;
    }
    else
    {
        leftOffset = character.offsetLeft;
        while(character && character.nextSibling && character.nextSibling.offsetLeft > leftOffset)
        {
            character = character.nextSibling;
            leftOffset = character.offsetLeft;
        }

        if(character && character.innerHTML == TextLayerNewLineElement.innerHTML)
            character = character.previousSibling;
    }

    return { character:character, paragraph:element };
}
});
instance_methods[35] = new objj_method(sel_registerName("binarySearch:compare:args:"), function(self, _cmd, array, comparisonFunction, args)
{ with(self)
{
    if(!array || !comparisonFunction) return NULL;

    var mid, c, first = 0, last = array.length - 1;
    while (first <= last)
    {
        mid = FLOOR((first + last) / 2);
          c = comparisonFunction(array[mid], args, self);



        if ( c > 0)
            first = mid + 1;
        else if ( c < 0)
            last = mid - 1;
        else
            return array[mid];
    }

    return NULL;
}
});
instance_methods[36] = new objj_method(sel_registerName("setNeedsSelectionRedraw"), function(self, _cmd)
{ with(self)
{
    if (_needsSelectionRedraw || !_isFirstResponder)
        return;

    _needsSelectionRedraw = YES;

    objj_msgSend(objj_msgSend(CPRunLoop, "currentRunLoop"), "performSelector:target:argument:order:modes:", sel_registerName("redrawSelectionAndCaret"), self, nil, 1000, [CPDefaultRunLoopMode]);
}
});
instance_methods[37] = new objj_method(sel_registerName("redrawSelectionAndCaret"), function(self, _cmd)
{ with(self)
{
    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "redrawSelection");

    _needsSelectionRedraw = NO;
}
});
instance_methods[38] = new objj_method(sel_registerName("positionCaret"), function(self, _cmd)
{ with(self)
{
    if (!_isFirstResponder)
        return;

    if (!objj_msgSend(self, "hasSelection"))
    {
        var previousCharacter = objj_msgSend(self, "previousCharacter");

        if(previousCharacter)
            var nextCharacter = previousCharacter,
                offset = previousCharacter.offsetWidth;
        else
            var offset = 0,
                nextCharacter = objj_msgSend(self, "nextCharacter");

        var location = locationInWindow(nextCharacter),
            frameLocation = locationInWindow(_contentLayer._DOMElement);

        objj_msgSend(TextLayerSharedCaret, "setPosition:", CGPointMake((location.x-frameLocation.x+offset)/_scale,(location.y-frameLocation.y)/_scale));
        objj_msgSend(TextLayerSharedCaret, "setBounds:", CGRectMake(0.0,0.0,1.0/_scale,nextCharacter.offsetHeight/_scale));

        if (_needsSelectionRedraw)
            objj_msgSend(TextLayerSharedCaret, "_update");

        objj_msgSend(self, "adoptSharedCaret");
    }

    objj_msgSend(TextLayer, "highlightCaret");
}
});
instance_methods[39] = new objj_method(sel_registerName("redrawSelection"), function(self, _cmd)
{ with(self)
{
    objj_msgSend(self, "redrawSelectionWhileStillSelecting:", NO);
}
});
instance_methods[40] = new objj_method(sel_registerName("redrawSelectionWhileStillSelecting:"), function(self, _cmd, isStillSelecting)
{ with(self)
{
    if (!_isFirstResponder && objj_msgSend(self, "hasSelection"))
        return;



    if(objj_msgSend(self, "hasSelection"))
    {
        if (!_selectionLayers)
        {
            var theClass = objj_msgSend(self, "class");

            _selectionLayers =
                [objj_msgSend(theClass, "takeSelectionLayerFromPool"),objj_msgSend(theClass, "takeSelectionLayerFromPool"),objj_msgSend(theClass, "takeSelectionLayerFromPool")];

            objj_msgSend(self, "insertSublayer:atIndex:", _selectionLayers[0], 0);
            objj_msgSend(self, "insertSublayer:atIndex:", _selectionLayers[1], 0);
            objj_msgSend(self, "insertSublayer:atIndex:", _selectionLayers[2], 0);
        }

        if(objj_msgSend(self, "selectionIsInverted"))
            var start = _selectionEnd, end = _selectionStart;
        else
            var start = _selectionStart, end = _selectionEnd;

        if(_contentLocationCache)
            var origin = _contentLocationCache;
        else
            var origin = locationInWindow(_contentLayer._DOMElement);

        if(!_characterDeltaX)
        {
            var characterLocal = locationInWindow(start);
            _characterDeltaX = characterLocal.x - origin.x - start.offsetLeft;
            _characterDeltaY = characterLocal.y - origin.y - start.offsetTop;
        }

        var highestStart = tallestCharacterOnSameLine(start, self);
        var highestEnd = tallestCharacterOnSameLine(end, self);

        var startLineHeight = highestStart.offsetHeight;
        var endLineHeight = highestEnd.offsetHeight;

        var startX = start.offsetLeft - _characterDeltaX;
        var startY = highestStart.offsetTop - _characterDeltaY;
        var endX = end.offsetLeft - _characterDeltaX;
        var endY = highestEnd.offsetTop - _characterDeltaY;

        if(start.innerHTML == TextLayerNewLineElement.innerHTML)
        {
            if(start.previousSibling)
                startX = start.previousSibling.offsetLeft + start.previousSibling.offsetWidth - _characterDeltaX;
            else
                startX = 0 - _characterDeltaX;
        }

        if(end.innerHTML == TextLayerNewLineElement.innerHTML)
        {
            if(end.previousSibling)
                endX = end.previousSibling.offsetLeft + end.previousSibling.offsetWidth - _characterDeltaX;
            else
                endX = 0 - _characterDeltaX;
        }

        var bounds = [CGRectMakeZero(),CGRectMakeZero(),CGRectMakeZero()],
            positions = [CGPointMakeZero(),CGPointMakeZero(),CGPointMakeZero()];


        if(startY == endY)
        {
            bounds[0].size = CGSizeMake((endX - startX) / _scale, startLineHeight / _scale);
            positions[0] = CGPointMake(startX / _scale, startY / _scale);
        }
        else
        {
            var contentFrame = objj_msgSend(_contentLayer, "frame");

            bounds[0].size = CGSizeMake(CGRectGetWidth(contentFrame) - startX / _scale, startLineHeight / _scale);
            bounds[1].size = CGSizeMake(CGRectGetWidth(contentFrame), MAX(endY - startY - startLineHeight, 0) / _scale);
            bounds[2].size = CGSizeMake(endX / _scale, endLineHeight / _scale);

            positions[0] = CGPointMake(startX / _scale, startY / _scale);
            positions[1] = CGPointMake(CGRectGetMinX(contentFrame), (startY + startLineHeight) / _scale);
            positions[2] = CGPointMake(CGRectGetMinX(contentFrame), endY / _scale);
        }

        var count = _selectionLayers.length;

        while (count--)
        {
            objj_msgSend(_selectionLayers[count], "setBounds:", bounds[count]);
            objj_msgSend(_selectionLayers[count], "setPosition:", positions[count]);

            if (_needsSelectionRedraw)
                objj_msgSend(_selectionLayers[count], "_update");

        }

        objj_msgSend(self, "orphanSharedCaret");
    }
    else if (_selectionLayers)
    {
        if (isStillSelecting)
        {
            objj_msgSend(_selectionLayers[0], "setBounds:", CGRectMakeZero());
            objj_msgSend(_selectionLayers[1], "setBounds:", CGRectMakeZero());
            objj_msgSend(_selectionLayers[2], "setBounds:", CGRectMakeZero());
        }
        else
        {
            objj_msgSend(_selectionLayers[0], "removeFromSuperlayer");
            objj_msgSend(_selectionLayers[1], "removeFromSuperlayer");
            objj_msgSend(_selectionLayers[2], "removeFromSuperlayer");

            var theClass = objj_msgSend(self, "class");

            objj_msgSend(theClass, "returnSelectionLayerToPool:", _selectionLayers[0]);
            objj_msgSend(theClass, "returnSelectionLayerToPool:", _selectionLayers[1]);
            objj_msgSend(theClass, "returnSelectionLayerToPool:", _selectionLayers[2]);

            _selectionLayers = nil;
        }
    }
}
});
instance_methods[41] = new objj_method(sel_registerName("selectAll"), function(self, _cmd)
{ with(self)
{
    _selectionStart = objj_msgSend(self, "firstCharacterInParagraph:", objj_msgSend(self, "firstParagraph"));
    _selectionEnd = objj_msgSend(self, "lastCharacterInParagraph:", objj_msgSend(self, "lastParagraph"));

    objj_msgSend(self, "redrawSelection");

    objj_msgSend(self, "calculateSelectedRange");
    objj_msgSend(self, "selectionDidChange");
}
});
instance_methods[42] = new objj_method(sel_registerName("clearSelection"), function(self, _cmd)
{ with(self)
{
    if (_selectionStart == _selectionEnd && _selectionStart == NULL)
        return;

    _selectionStart = NULL;
    _selectionEnd = NULL;

    objj_msgSend(self, "redrawSelection");

    objj_msgSend(self, "calculateSelectedRange");
    objj_msgSend(self, "selectionDidChange");
}
});
instance_methods[43] = new objj_method(sel_registerName("deleteSelection"), function(self, _cmd)
{ with(self)
{
    if (!objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
        return;

    if(objj_msgSend(self, "selectionIsInverted"))
        var start = _selectionEnd, end = _selectionStart;
    else
        var start = _selectionStart, end = _selectionEnd;

    _selectionStart = _selectionEnd = NULL;

    var finalParagraph = start.parentNode;
    _previousCharacter = end.previousSibling;
    _currentParagraph = end.parentNode;

    start = start.previousSibling;

    while(start != _previousCharacter || _currentParagraph != finalParagraph)
        objj_msgSend(self, "removeCharacter:stillDeleting:", kLeft, YES);

    _previousCharacter = start;

    _selectionRange.length = 0;

    objj_msgSend(self, "redrawSelection");
    objj_msgSend(self, "textDidChange")
}
});
instance_methods[44] = new objj_method(sel_registerName("selectionIsInverted"), function(self, _cmd)
{ with(self)
{
    if(!_selectionStart || !_selectionEnd)
        return NO;

    var tallestStart = tallestCharacterOnSameLine(_selectionStart, self);
    var tallestEnd = tallestCharacterOnSameLine(_selectionEnd, self);

    var startX = _selectionStart.offsetLeft;
    var startY = tallestStart.offsetTop;
    var endX = _selectionEnd.offsetLeft;
    var endY = tallestEnd.offsetTop;

    if(_selectionEnd.innerHTML == TextLayerNewLineElement.innerHTML)
    {
        if(_selectionEnd.previousSibling)
            endX = _selectionEnd.previousSibling.offsetLeft + _selectionEnd.previousSibling.offsetWidth
        else
            endX = 0;
    }

    if(_selectionStart.innerHTML == TextLayerNewLineElement.innerHTML)
    {
        if(_selectionStart.previousSibling)
            startX = _selectionStart.previousSibling.offsetLeft + _selectionStart.previousSibling.offsetWidth
        else
            startX = 0;
    }

    return ((startY == endY && startX > endX) || startY > endY);
}
});
instance_methods[45] = new objj_method(sel_registerName("hasSelection"), function(self, _cmd)
{ with(self)
{
    return _selectionStart != _selectionEnd;
}
});
instance_methods[46] = new objj_method(sel_registerName("characterForInspection"), function(self, _cmd)
{ with(self)
{
    if(objj_msgSend(self, "hasSelection"))
    {
        if(objj_msgSend(self, "selectionIsInverted"))
            var start = _selectionEnd;
        else
            var start = _selectionStart;
    }
    else
        var start = _previousCharacter;

    if(!start) start = objj_msgSend(self, "nextCharacter");

    return start;
}
});
instance_methods[47] = new objj_method(sel_registerName("resizeFontByFactor:"), function(self, _cmd, aFactor)
{ with(self)
{
    if(objj_msgSend(self, "hasSelection"))
    {
        if(objj_msgSend(self, "selectionIsInverted"))
            var start = _selectionEnd, end = _selectionStart;
        else
            var start = _selectionStart, end = _selectionEnd;

        while(start && start != end)
        {
            objj_msgSend(self, "applyFontSize:toElement:", ROUND((parseInt(start.style.fontSize,10)/10)*aFactor), start);
            start = nextCharacter(start);
        }



    }
    else
        _typingTextAttributes.fontSize = ROUND(_typingTextAttributes.fontSize * aFactor);

    objj_msgSend(self, "resize");
    objj_msgSend(self, "textDidChange")
}
});
instance_methods[48] = new objj_method(sel_registerName("increaseBulletLevel"), function(self, _cmd)
{ with(self)
{
    objj_msgSend(self, "_increaseBulletLevel");
    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "redrawSelection");
    objj_msgSend(_delegate, "textDidChange:", self);
}
});
instance_methods[49] = new objj_method(sel_registerName("_increaseBulletLevel"), function(self, _cmd)
{ with(self)
{
    if(!objj_msgSend(self, "hasSelection"))
        return objj_msgSend(self, "changeBulletLevel:", kRight);

    var character = _previousCharacter, paragraph = _currentParagraph;
    if(objj_msgSend(self, "selectionIsInverted"))
    {
        _previousCharacter = _selectionEnd;
        var end = _selectionStart;
    }
    else
    {
        _previousCharacter = _selectionStart;
        var end = _selectionEnd;
    }

    _currentParagraph = _previousCharacter.parentNode;
    while(_currentParagraph != end.parentNode)
    {
        objj_msgSend(self, "changeBulletLevel:", kRight);
        _currentParagraph = traverseNextNode(_currentParagraph);
        _previousCharacter = objj_msgSend(self, "firstCharacterInParagraph:", _currentParagraph);
    }

    objj_msgSend(self, "changeBulletLevel:", kRight);

    _previousCharacter = character;
    _currentParagraph = paragraph;
}
});
instance_methods[50] = new objj_method(sel_registerName("decreaseBulletLevel"), function(self, _cmd)
{ with(self)
{
    objj_msgSend(self, "_decreaseBulletLevel");
    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "redrawSelection");
    objj_msgSend(_delegate, "textDidChange:", self);
}
});
instance_methods[51] = new objj_method(sel_registerName("_decreaseBulletLevel"), function(self, _cmd)
{ with(self)
{
    if(!objj_msgSend(self, "hasSelection"))
        return objj_msgSend(self, "changeBulletLevel:", kLeft);

    var character = _previousCharacter, paragraph = _currentParagraph;
    if(objj_msgSend(self, "selectionIsInverted"))
    {
        _previousCharacter = _selectionEnd;
        var end = _selectionStart;
    }
    else
    {
        _previousCharacter = _selectionStart;
        var end = _selectionEnd;
    }

    _currentParagraph = _previousCharacter.parentNode;
    while(_currentParagraph != end.parentNode)
    {
        objj_msgSend(self, "changeBulletLevel:", kLeft);
        _currentParagraph = traverseNextNode(_currentParagraph);
        _previousCharacter = objj_msgSend(self, "firstCharacterInParagraph:", _currentParagraph);
    }

    objj_msgSend(self, "changeBulletLevel:", kLeft);

    _previousCharacter = character;
    _currentParagraph = paragraph;
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}

{
var the_class = objj_getClass("TextLayer")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"TextLayer\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("setTextScale:"), function(self, _cmd, aScale)
{ with(self)
{
    _scale = aScale;
    _contentLayer._DOMElement.style.fontSize = ROUND(aScale * 100) + "%";

    objj_msgSend(self, "setNeedsSelectionRedraw");
}
});
class_addMethods(the_class, instance_methods);
}

{
var the_class = objj_getClass("TextLayer")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"TextLayer\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("rtfObjectFrom:to:forCopy:"), function(self, _cmd, startNode, endNode, copy)
{ with(self)
{
    var textObject = {format:"rosstf", version:3.1, content:[]};
    var paragraph = startNode.parentNode;

    while(paragraph)
    {
        if(!copy || paragraph != startNode.parentNode)
            var depth = getBulletDepth(paragraph);
        else
            var depth = 0;

        var paragraphObject = {};
        textObject.content.push(paragraphObject);

        paragraphObject.list = depth > 0;
        paragraphObject.depth = depth;
        paragraphObject.ordered = false;
        paragraphObject.content = [];

        if(paragraph.style.textAlign && paragraph.style.textAlign != "")
            paragraphObject.align = paragraph.style.textAlign;

        var styleObject = NULL,
            previousStyle = NULL;

        if(paragraph == startNode.parentNode)
            var character = startNode;
        else
            var character = paragraph.firstChild;

        while(character && character != endNode)
        {
            var style = objj_msgSend(self, "styleObjectForCharacter:", character);

            if(!styleObject || (!compareStyles(style, previousStyle) && character.innerHTML != TextLayerNewLineElement.innerHTML))
            {
                styleObject = {};
                styleObject.content = "";
                styleObject.style = style;
                paragraphObject.content.push(styleObject);
            }

            if(character.firstChild.nodeValue != TextLayerNewLineElement.firstChild.nodeValue)
                styleObject.content += character.firstChild.nodeValue;

            previousStyle = style;

            character = character.nextSibling;
        }

        if(character != endNode)
            paragraph = traverseNextNode(paragraph);
        else
            break;
    }

    return textObject;
}
});
instance_methods[1] = new objj_method(sel_registerName("toStorageFormat"), function(self, _cmd)
{ with(self)
{
    var textObject = null;

    try
    {
        textObject = objj_msgSend(self, "rtfObjectFrom:to:forCopy:", objj_msgSend(self, "firstCharacterInParagraph:", objj_msgSend(self, "firstParagraph")), objj_msgSend(self, "lastCharacterInParagraph:", objj_msgSend(self, "lastParagraph")), NO);
    }
    catch (e)
    {
        alert("Whoops.  We've encountered a bug. \n\n"
             +"We're trying our best to recover from it, but if you encounter "
             +"any problems with your document, please let us know!");

        try
        {
            var text = _contentLayer._DOMElement.innerText;
            textObject = objj_msgSend(TextLayer, "simpleRossTFObjectForString:", text);

            objj_msgSend(BugReporter, "sendFeedback:title:delegate:", "Error saving text: "+e+" text: "+text, "Text Save Error", nil);
        }
        catch (f)
        {
            alert("We were unable to recover from the following errors: \n\n"+e+"\n\n"+f+
                  "\n\nPlease send this feedback to feedback@280north.com");
        }
    }

    return textObject;
}
});
var class_methods = [];
class_methods[0] = new objj_method(sel_registerName("simpleRossTFObjectForString:"), function(self, _cmd, aString)
{ with(self)
{
    return CPJSObjectCreateWithJSON("{\"format\":\"rosstf\",\"version\":3,\"content\":[{\"list\":false,\"content\":"+
                                    "[{\"content\":\"" + aString + "\",\"style\":{\"style\":0,\"size\":32}}]}]}");
}
});
instance_methods[2] = new objj_method(sel_registerName("insertFromStorageObject:"), function(self, _cmd, textObject)
{ with(self)
{
    _isInsertingFromStorageObject = YES;

    if(objj_msgSend(self, "hasSelection"))
        objj_msgSend(self, "deleteSelection");

    var paragraphs = textObject.content;
    var previousList, previousListLevel = 0;


    _typingTextAttributes = TextAttributesMake(0, 0, 0, 0, 0, 0, 0, 0);
    _typingTextProperties = TextAttributesMake("", "", "", "", "", "", "", "");

    for(var i=0; i<paragraphs.length; i++)
    {
        var currentParagraph = paragraphs[i];

        if(currentParagraph.content.length == 1 && currentParagraph.content[0].content == "")
            objj_msgSend(self, "setFontSize:", currentParagraph.content[0].style.size);

        if(i > 0)
            objj_msgSend(self, "insertReturn");

        if(currentParagraph.list)
        {
            var depth = currentParagraph.depth - getBulletDepth(_currentParagraph);

            if(depth > 0)
                while(depth-- > 0)
                    objj_msgSend(self, "changeBulletLevel:", kRight);
            else
                while(depth++ < 0)
                    objj_msgSend(self, "changeBulletLevel:", kLeft);
        }
        else
        {
            var depth = getBulletDepth(_currentParagraph);

            while(depth-- > 0)
                objj_msgSend(self, "changeBulletLevel:", kLeft);
        }

        objj_msgSend(self, "align:", parseTextAlignment(currentParagraph.align));

        var styleObjects = currentParagraph.content;

        for(var j=0; j<styleObjects.length; j++)
        {
            var style = styleObjects[j].style,
                characters = styleObjects[j].content;

            objj_msgSend(self, "setFontFamily:", style.name);
            objj_msgSend(self, "setFontSize:", style.size);

            objj_msgSend(self, "setTextColor:", style.color?objj_msgSend(SKColor, "colorWithColor:adjustments:", objj_msgSend(CPColor, "colorWithHexString:", style.color), nil):nil);

            objj_msgSend(self, "setState:forAttribute:andProperty:onStateValue:offStateValue:", style.bold, "boldState", "fontWeight", "bold", "normal");
            objj_msgSend(self, "setState:forAttribute:andProperty:onStateValue:offStateValue:", style.italic, "italicState", "fontStyle", "italic", "normal");
            objj_msgSend(self, "setState:forAttribute:andProperty:onStateValue:offStateValue:", style.underline, "underlineState", "textDecoration", "underline", "none");

            for(var k=0; k<characters.length; k++)
            {
                var character = characters.charAt(k);

                if(character != "\r" && character != "\n")
                    objj_msgSend(self, "insertCharacter:stillInserting:", character, YES);
            }
        }
    }

    if(objj_msgSend(TextLayerSharedCaret, "superlayer") == self)
    {
        objj_msgSend(self, "resize");
        objj_msgSend(self, "positionCaret");
        objj_msgSend(self, "redrawSelection");
    }

    _isInsertingFromStorageObject = NO;

    objj_msgSend(self, "calculateSelectedRange");

    objj_msgSend(self, "clearTypingTextAttributes");
}
});
instance_methods[3] = new objj_method(sel_registerName("setHTMLFromStorageObject:"), function(self, _cmd, text)
{ with(self)
{
    _selectionStart = _selectionEnd = _currentParagraph = _previousCharacter = NULL;

    var newDocument = _contentLayer._DOMElement;
    newDocument.innerHTML="";

    _currentParagraph = TextLayerParagraphElement.cloneNode(false);
    _currentParagraph.appendChild(TextLayerNewLineElement.cloneNode(true));

    newDocument.appendChild(_currentParagraph);

    objj_msgSend(self, "insertFromStorageObject:", text);
}
});
instance_methods[4] = new objj_method(sel_registerName("styleObjectForCharacter:"), function(self, _cmd, character)
{ with(self)
{
    var style = character.style,
        size = parseFontSize(character.style.fontSize),
        color = objj_msgSend(objj_msgSend(CPColor, "colorWithCSSString:", character.style.color), "hexString"),
        fontFamily = parseFontFamily(character.style.fontFamily);

    return makeStyleObject(parseFontWeight(style.fontWeight), parseFontStyle(style.fontStyle), parseTextDecoration(style.textDecoration), size, color, fontFamily);
}
});
class_addMethods(the_class, instance_methods);
class_addMethods(meta_class, class_methods);
}

{var the_class = objj_allocateClassPair(CPObject, "SKTextString"),
meta_class = _class_getMeta(the_class);the_class.ivars.splice(the_class.ivars.length, 0, new objj_ivar("_HTML"), new objj_ivar("_owner"), new objj_ivar("_isEmpty"));
objj_registerClassPair(the_class);
objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("initWithTextLayer:html:isEmpty:"), function(self, _cmd, owner, html, isEmpty)
{ with(self)
{
    self = objj_msgSendSuper({ receiver:self, super_class:objj_getClass("CPObject") }, "init");

    if (self)
    {
        _owner = owner;
        _HTML = html;
        _isEmpty = isEmpty;
    }

    return self;
}
});
instance_methods[1] = new objj_method(sel_registerName("string"), function(self, _cmd)
{ with(self)
{
    return CPJSObjectCreateJSON(objj_msgSend(_owner, "toStorageFormat"));
}
});
instance_methods[2] = new objj_method(sel_registerName("html"), function(self, _cmd)
{ with(self)
{
    return _HTML;
}
});
instance_methods[3] = new objj_method(sel_registerName("length"), function(self, _cmd)
{ with(self)
{
    return _isEmpty ? 0 : _HTML.length;
}
});
instance_methods[4] = new objj_method(sel_registerName("isEqual:"), function(self, _cmd, aString)
{ with(self)
{
    if (self == aString)
        return YES;

    if (objj_msgSend(aString, "isKindOfClass:", objj_msgSend(SKTextString, "class")))
        return (_isEmpty && _isEmpty == aString._isEmpty) || _HTML == aString._HTML;

    return NO;
}
});
class_addMethods(the_class, instance_methods);
}

var makeStyleObject = makeStyleObject= function(boldState, italicState, underlineState, fontSize, fontColor, fontFamily)
{
    var object = {};

    if (fontSize)
        object.size = fontSize;

    if(fontColor)
        object.color = fontColor;

    if(fontFamily)
        object.name = fontFamily;

    if (boldState)
        object.bold = boldState;

    if (italicState)
        object.italic = italicState;

    if (underlineState)
        object.underline = underlineState;

    return object;
}

var compareStyles = compareStyles= function(lhsStyle, rhsStyle)
{
    if( lhsStyle && rhsStyle &&
        lhsStyle.bold == rhsStyle.bold && lhsStyle.italic == rhsStyle.italic && lhsStyle.underline == rhsStyle.underline &&
        lhsStyle.size == rhsStyle.size && lhsStyle.name == rhsStyle.name && lhsStyle.color == rhsStyle.color)
        return YES;

    return NO;
}

var nextCharacter = nextCharacter= function(character)
{
    if(character)
    {
        if(character.nextSibling)
        {
            return character.nextSibling;
        }
        else
        {
            var nextParagraph = traverseNextNode(character.parentNode);
            if(nextParagraph)
            {
                return nextParagraph.firstChild;
            }
            else
            {
                return NULL;
            }
        }
    }

    return NULL;
}

var previousCharacter = previousCharacter= function(character)
{
    if(character)
    {
        if(character.previousSibling)
            return character.previousSibling;
        else
        {
            var previousParagraph = traversePreviousNode(character.parentNode);
            if(previousParagraph)
                return previousParagraph.lastChild;
            else
                return NULL;
        }
    }

    return NULL;
}

var traverseNextNode = traverseNextNode= function(aNode)
{
    while(aNode && !aNode.nextSibling && aNode.parentNode.className != "root")
        aNode = aNode.parentNode;

    if(aNode)
        aNode = aNode.nextSibling;

    while(aNode && aNode.firstChild && aNode.nodeName == TextLayerUlElement.nodeName)
        aNode = aNode.firstChild;

    if(aNode && aNode.nodeName == TextLayerLiElement.nodeName)
        return aNode.firstChild;

    return aNode;
}

var traversePreviousNode = traversePreviousNoded= function(aNode)
{
    while(aNode && !aNode.previousSibling && aNode.parentNode.className != "root")
        aNode = aNode.parentNode;

    if(aNode)
        aNode = aNode.previousSibling;

    while(aNode && aNode.lastChild && aNode.nodeName == TextLayerUlElement.nodeName)
        aNode = aNode.lastChild;

    if(aNode && aNode.nodeName == TextLayerLiElement.nodeName)
        return aNode.firstChild;

    return aNode;
}

var getBulletDepth = getBulletDepth= function(paragraph)
{
    if (paragraph.className != TextLayerLineSpacerElement.className)
        return 0;

    if(paragraph.parentNode.nodeName != TextLayerLiElement.nodeName)
        return 0;

    var count = 0;
    while(paragraph.parentNode.parentNode.nodeName == TextLayerUlElement.nodeName)
    {
        paragraph = paragraph.parentNode;
        count++;
    }

    return count;
}

var getComputedProperty = getComputedProperty= function(property, element)
{
    return document.defaultView.getComputedStyle(element, "").getPropertyValue(property);
}

var tallestCharacterOnSameLine = tallestCharacterOnSameLine= function(character, self)
{
    if(character.previousSibling && character.innerHTML == TextLayerNewLineElement.innerHTML)
        character = character.previousSibling;

    if(self._tallestElementCacheMap)
    {
        if(!character.__address)
            character.__address = _objj_generateObjectHash();
        else if(self._tallestElementCacheMap[character.__address])
            return self._tallestElementCacheMap[character.__address];
    }

    var height = character.offsetHeight, left = character.offsetLeft,
         right = character.offsetLeft, fontSize = character.style.fontSize;

    var current = character.previousSibling, result = character;

    while(current && current.offsetLeft < left)
    {
        if(current.offsetHeight > height && current.innerHTML != TextLayerNewLineElement.innerHTML)
        {
            result = current;
            height = current.offsetHeight;
        }

        left = current.offsetLeft;
        current = current.previousSibling;
    }

    if(current && current.innerHTML == TextLayerNewLineElement.innerHTML)
        current = null;

    if(current && current.nextSibling && current.offsetTop == current.nextSibling.offsetTop && current.nextSibling == result)
        result = current.nextSibling.nextSibling;

    if(self._lastCharacterOnPreviousLineCacheMap)
        self._lastCharacterOnPreviousLineCacheMap[character.__address] = current;

    current = character.nextSibling;
    while(current && current.offsetLeft > right)
    {
        if(current.offsetHeight > height && current.innerHTML != TextLayerNewLineElement.innerHTML)
        {
            result = current;
            height = current.offsetHeight;
        }

        right = current.offsetLeft;
        current = current.nextSibling;
    }

    if(current && current.innerHTML == TextLayerNewLineElement.innerHTML)
        current = null;

    if(current && current.previousSibling && current.offsetTop == current.previousSibling.offsetTop && current.previousSibling == result)
        result = current.previousSibling.previousSibling;

    if(self._firstCharacterOnNextLineCacheMap)
        self._firstCharacterOnNextLineCacheMap[character.__address] = current;

    if(self._tallestElementCacheMap)
        self._tallestElementCacheMap[character.__address] = result;

    return result;
}

var targetComparator = targetComparator= function(element, relativeY, self)
{
    return comparator(element, CPPointMake(0, relativeY), self, false);
}

var paragraphComparator = paragraphComparator= function(element, point, self)
{
    return comparator(element, point, self, true);
}

var comparator = comparator= function(element, point, self, checkHorizontal)
{
    if(checkHorizontal || element.firstChild.nodeType == 3)
    {
        var highestElement = tallestCharacterOnSameLine(element, self);

        var lastCharacterOnPreviousLine = self._lastCharacterOnPreviousLineCacheMap[element.__address];
        var firstCharacterOnNextLine = self._firstCharacterOnNextLineCacheMap[element.__address];

        if(!lastCharacterOnPreviousLine)
        {
            if(element.parentNode.nodeName == TextLayerParagraphElement.nodeName)
                var topBarrier = highestElement.offsetTop;
            else
                var topBarrier = element.parentNode.parentNode.offsetTop;
        }
        else
            var topBarrier = lastCharacterOnPreviousLine.offsetTop + lastCharacterOnPreviousLine.offsetHeight;

        if(!firstCharacterOnNextLine)
        {
            var parentNode = element.parentNode;


            if (parentNode.className == TextLayerParagraphElement.className)
                var bottomBarrier = highestElement.offsetTop + highestElement.offsetHeight;
            else
                var bottomBarrier = element.parentNode.parentNode.offsetTop + element.parentNode.parentNode.offsetHeight;
        }
        else
        {
            var first = firstCharacterOnNextLine;
            if(first.offsetTop == first.previousSibling.offsetTop)
                var bottomBarrier = first.offsetTop + first.offsetHeight - first.previousSibling.offsetHeight;
            else
                var bottomBarrier = first.offsetTop;
        }
    }
    else
    {
        var bottomBarrier = element.offsetTop + element.offsetHeight;
        var topBarrier = element.offsetTop;
    }


    if(point.y >= bottomBarrier)
        return 1;
    else if (point.y < topBarrier)
        return -1;
    else if (checkHorizontal && point.x < element.offsetLeft)
        return -1;
    else if (checkHorizontal && point.x >= element.offsetLeft + element.offsetWidth)
        return 1;
    else
        return 0;
}

var locationInWindow = locationInWindow= function(element)
{
    var x=0, y=0;
    while(element && element.offsetLeft >= 0 && element.offsetTop >= 0)
    {
        x += element.offsetLeft;
        y += element.offsetTop;
        element = element.offsetParent;
    }
    return CPPointMake(x, y);
}



{
var the_class = objj_getClass("TextLayer")
if(!the_class) objj_exception_throw(new objj_exception(OBJJClassNotFoundException, "*** Could not find definition for class \"TextLayer\""));
var meta_class = _class_getMeta(the_class);var instance_methods = [];
instance_methods[0] = new objj_method(sel_registerName("selectionDidChange"), function(self, _cmd)
{ with(self)
{
    objj_msgSend(self, "updateTypingTextAttributes");

    objj_msgSend(_selectionDelegate, "textLayerDidChangeSelection:", self);
}
});
instance_methods[1] = new objj_method(sel_registerName("clearTypingTextAttributes"), function(self, _cmd)
{ with(self)
{
    _typingTextAttributes = nil;
}
});
instance_methods[2] = new objj_method(sel_registerName("updateTypingTextAttributes"), function(self, _cmd)
{ with(self)
{try{
    var range = objj_msgSend(self, "typingCharacterRange"),

        character = range.start,
        endCharacter = range.end,

        paragraph = character.parentNode,
        endParagraph = endCharacter ? traverseNextNode(endCharacter.parentNode) : nil;
    }catch(e) {objj_debug_print_backtrace(); }
    if (character == endCharacter)
        endCharacter = nextCharacter(character);

    var defaultValue = objj_msgSend(CPNull, "null");

    _typingTextAttributes = TextAttributesMake(defaultValue, defaultValue, defaultValue, 0, 0, 0, 0, 0);
    _typingTextProperties = TextAttributesMake("", "", "", "", "", "", "", "");

    while (character && character != endCharacter && (
        _typingTextAttributes.fontFamily ||
        _typingTextAttributes.fontSize ||
        _typingTextAttributes.boldState != TextAttributeMixedState ||
        _typingTextAttributes.italicState != TextAttributeMixedState ||
        _typingTextAttributes.underlineState != TextAttributeMixedState ))
    {
        var style = character.style;


        if (_typingTextAttributes.color == defaultValue)
        {
            _typingTextAttributes.color = objj_msgSend(SKColor, "colorWithColor:adjustments:", objj_msgSend(CPColor, "colorWithCSSString:", character.style.color), nil);
            _typingTextProperties.color = character.style.color;
        }


        var characterFontSize = parseFontSize(character.style.fontSize);

        if (_typingTextAttributes.fontSize == defaultValue)
        {
            _typingTextAttributes.fontSize = characterFontSize;
            _typingTextProperties.fontSize = characterFontSize;
        }
        else if (_typingTextAttributes.fontSize != characterFontSize)
            _typingTextAttributes.fontSize = nil;
        var fontWeight = character.style.fontWeight;
        if (!_typingTextProperties.boldState)
            _typingTextProperties.boldState = fontWeight;
        _typingTextAttributes.boldState |= parseFontWeight(fontWeight);
        var fontStyle = character.style.fontStyle;
        if (!_typingTextProperties.italicState)
            _typingTextProperties.italicState = fontStyle;
        _typingTextAttributes.italicState |= parseFontStyle(fontStyle);
        var textDecoration = character.style.textDecoration;
        if (!_typingTextProperties.underlineState)
            _typingTextProperties.underlineState = textDecoration;
        _typingTextAttributes.underlineState |= parseTextDecoration(textDecoration);
        var characterFontFamily = parseFontFamily(character.style.fontFamily);
        if (_typingTextAttributes.fontFamily == defaultValue)
        {
            _typingTextAttributes.fontFamily = characterFontFamily;
            _typingTextProperties.fontFamily = character.style.fontFamily;
        }
        else if (_typingTextAttributes.fontFamily != characterFontFamily)
            _typingTextAttributes.fontFamily = nil;
        character = nextCharacter(character);
    }
    while (paragraph && paragraph != endParagraph && (_typingTextAttributes.alignmentMask != TextLayerAllAlignmentMask || _typingTextAttributes.bulletStyleMask != TextLayerAllBulletStyleMask))
    {
        _typingTextAttributes.alignmentMask |= parseTextAlignment(paragraph.style.textAlign);
        _typingTextProperties.alignmentMask = paragraph.style.textAlign;
        if (paragraph.parentNode.nodeName == TextLayerLiElement.nodeName)
            if (paragraph.parentNode.style.listStyle == "disc")
                _typingTextAttributes.bulletStyleMask |= TextLayerDiscBulletStyleMask;
            else if (paragraph.parentNode.style.listStyle == "decimal")
                _typingTextAttributes.bulletStyleMask |= TextLayerNumberBulletStyleMask;
        paragraph = traverseNextNode(paragraph);
    }
}
});
instance_methods[3] = new objj_method(sel_registerName("setFontFamily:"), function(self, _cmd, aFontFamily)
{ with(self)
{
    if (!aFontFamily)
        aFontFamily = _defaultTextAttributes.fontFamily;
    if (_typingTextAttributes.fontFamily == aFontFamily)
        return;
    _typingTextAttributes.fontFamily = aFontFamily;
    _typingTextProperties.fontFamily = aFontFamily;
    var range = objj_msgSend(self, "typingCharacterRange"),
        character = range.start,
        endCharacter = range.end;
    while (character && character != endCharacter)
    {
        character.style.fontFamily = aFontFamily;
        character = nextCharacter(character);
    }
    if(character && character.innerHTML == TextLayerNewLineElement.innerHTML)
        character.style.fontFamily = aFontFamily;
    objj_msgSend(self, "resize");
    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "redrawSelection");
    objj_msgSend(self, "textDidChange")
    objj_msgSend(_selectionDelegate, "textLayerDidChangeTextAttributes:", self);
}
});
instance_methods[4] = new objj_method(sel_registerName("setFontSize:"), function(self, _cmd, aSize)
{ with(self)
{
    if (_typingTextAttributes.fontSize == aSize)
        return;
    _typingTextAttributes.fontSize = aSize;
    _typingTextProperties.fontSize = aSize;
    var range = objj_msgSend(self, "typingCharacterRange"),
        character = range.start,
        endCharacter = range.end;
    while (character && character != endCharacter)
    {
        setFontSize(character, aSize);
        character = nextCharacter(character);
    }
    if(character && character.innerHTML == TextLayerNewLineElement.innerHTML)
        setFontSize(character, aSize);
    objj_msgSend(self, "resize");
    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "redrawSelection");
    objj_msgSend(self, "textDidChange")
    objj_msgSend(_selectionDelegate, "textLayerDidChangeTextAttributes:", self);
}
});
instance_methods[5] = new objj_method(sel_registerName("setTextColor:"), function(self, _cmd, aColor)
{ with(self)
{
    if (!aColor)
        aColor == _defaultTextAttributes.color;
    if (_typingTextAttributes.color == aColor)
        return;
    var range = objj_msgSend(self, "typingCharacterRange"),
        cssValue = objj_msgSend(objj_msgSend(aColor, "colorForSlideMaster:", _slideMaster), "cssString");
    _typingTextAttributes.color = aColor;
    _typingTextProperties.color = cssValue;
    var character = range.start,
        endCharacter = range.end;
    while (character && character != endCharacter)
    {
        character.style.color = cssValue;
        character = nextCharacter(character);
    }
    if(character && character.innerHTML == TextLayerNewLineElement.innerHTML)
        character.style.color = cssValue;
    objj_msgSend(self, "textDidChange")
    objj_msgSend(_selectionDelegate, "textLayerDidChangeTextAttributes:", self);
}
});
instance_methods[6] = new objj_method(sel_registerName("align:"), function(self, _cmd, anAlignmentMask)
{ with(self)
{
    if (!anAlignmentMask)
        anAlignmentMask = _defaultTextAttributes.alignmentMask;
    if (_typingTextAttributes.aligmentMask == anAlignmentMask)
        return;
    if (!objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
        return;
    _typingTextAttributes.alignmentMask = anAlignmentMask;
    var range = objj_msgSend(self, "typingCharacterRange"),
        cssValue = TextLayerAlignmentMaskValues[anAlignmentMask];
    _typingTextProperties.alignment = cssValue;
    var range = objj_msgSend(self, "typingCharacterRange"),
        paragraph = range.start.parentNode,
        endParagraph = range.end ? traverseNextNode(range.end.parentNode) : nil;
    while (paragraph && paragraph != endParagraph)
    {
        paragraph.style.textAlign = cssValue;
        _typingTextProperties.alignmentMask = cssValue;
        paragraph = traverseNextNode(paragraph);
    }
    objj_msgSend(self, "redrawSelection");
    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "textDidChange")
    objj_msgSend(_selectionDelegate, "textLayerDidChangeTextAttributes:", self);
}
});
instance_methods[7] = new objj_method(sel_registerName("bulletStyle:"), function(self, _cmd, aBulletStyleMask)
{ with(self)
{
    _typingTextAttributes.bulletStyleMask = aBulletStyleMask;
    var range = objj_msgSend(self, "typingCharacterRange"),
        cssValue = TextLayerBulletStyleMaskValues[aBulletStyleMask];
    _typingTextProperties.bulletStyle = cssValue;
    var range = objj_msgSend(self, "typingCharacterRange"),
        paragraph = range.start.parentNode,
        endParagraph = range.end ? traverseNextNode(range.end.parentNode) : nil;
    while (paragraph && paragraph != endParagraph)
    {
        var listNode = paragraph.parentNode;
        if (listNode.nodeName == TextLayerLiElement.nodeName)
            listNode.style.listStyleType = cssValue;
        paragraph = traverseNextNode(paragraph);
    }
    objj_msgSend(self, "redrawSelection");
    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "textDidChange")
    objj_msgSend(_selectionDelegate, "textLayerDidChangeTextAttributes:", self);
}
});
instance_methods[8] = new objj_method(sel_registerName("typingCharacterRange"), function(self, _cmd)
{ with(self)
{
    var range = { start:nil, end:nil };
    if (_isFirstResponder || _isInsertingFromStorageObject)
    {
        if (objj_msgSend(self, "hasSelection"))
        {
            if(objj_msgSend(self, "selectionIsInverted"))
            {
                range.start = _selectionEnd;
                range.end = _selectionStart;
            }
            else
            {
                range.start = _selectionStart;
                range.end = _selectionEnd;
            }
        }
        else
        {
            range.start = objj_msgSend(self, "characterForInspection");
            range.end = range.start;
        }
    }
    else
    {
        range.start = objj_msgSend(self, "firstCharacterInParagraph:", objj_msgSend(self, "firstParagraph"));
        range.end = nil;
    }
    return range;
}
});
instance_methods[9] = new objj_method(sel_registerName("typingTextAttributes"), function(self, _cmd)
{ with(self)
{
    if (!_typingTextAttributes)
        objj_msgSend(self, "updateTypingTextAttributes");
    return _typingTextAttributes;
}
});
instance_methods[10] = new objj_method(sel_registerName("setDefaultTextAttributes:"), function(self, _cmd, attributes)
{ with(self)
{
    if (_defaultTextAttributes == attributes)
        return;
    var initial = _defaultTextAttributes == nil,
        fontFamily = attributes.fontFamily,
        fontSize = attributes.fontSize,
        color = objj_msgSend(objj_msgSend(attributes.color, "colorForSlideMaster:", _slideMaster), "cssString"),
        fontWeight = attributes.boldState == TextAttributeOnState ? "bold" : "normal",
        fontStyle = attributes.italicState == TextAttributeOnState ? "italic" : "normal",
        textDecoration = attributes.underlineState == TextAttributeOnState ? "underline" : "none",
        textAlign = TextLayerAlignmentMaskValues[attributes.alignmentMask];
    if (!initial)
    {
        var oldDefaultFontFamily = _defaultTextAttributes.fontFamily,
            oldDefaultFontSize = _defaultTextAttributes.fontSize,
            oldDefaultColor = objj_msgSend(objj_msgSend(_defaultTextAttributes.color, "colorForSlideMaster:", _slideMaster), "cssString"),
            oldDefaultFontWeight = _defaultTextAttributes.boldState == TextAttributeOnState ? "bold" : "normal",
            oldDefaultFontStyle = _defaultTextAttributes.italicState == TextAttributeOnState ? "italic" : "normal",
            oldDefaultTextDecoration = _defaultTextAttributes.underlineState == TextAttributeOnState ? "underline" : "none",
            oldDefaultTextAlign = TextLayerAlignmentMaskValues[_defaultTextAttributes.alignmentMask];
    }
    var style = _contentLayer._DOMElement.style;
    style.fontFamily = fontFamily;
    style.fontWeight = fontWeight;
    style.fontStyle = fontStyle;
    style.color = color;
    var character = objj_msgSend(self, "firstCharacterInParagraph:", objj_msgSend(self, "firstParagraph"));
    while (character)
    {
        var style = character.style;
        if (initial || parseFontFamily(style.fontFamily) == oldDefaultFontFamily)
            style.fontFamily = fontFamily;
        if (initial || parseFontSize(style.fontSize) == oldDefaultFontSize)
            setFontSize(character, fontSize);
        if (initial || colorsAreEqual(style.color, oldDefaultColor))
            style.color = color;
        if (initial || style.fontWeight == oldDefaultFontWeight)
            style.fontWeight = fontWeight;
        if (initial || style.fontStyle == oldDefaultFontStyle)
            style.fontStyle = fontStyle;
        if (initial || style.textDecoration == oldDefaultTextDecoration)
            style.textDecoration = textDecoration;
        character = nextCharacter(character);
    }
    var paragraph = objj_msgSend(self, "firstParagraph");
    while (paragraph)
    {
        if (initial || paragraph.style.textAlign == oldDefaultTextAlign)
            paragraph.style.textAlign = textAlign;
        paragraph = traverseNextNode(paragraph);
    }
    _defaultTextAttributes = TextAttributesMakeCopy(attributes);
    objj_msgSend(self, "updateTypingTextAttributes");
}
});
instance_methods[11] = new objj_method(sel_registerName("defaultTextAttributes"), function(self, _cmd)
{ with(self)
{
    return _defaultTextAttributes;
}
});
instance_methods[12] = new objj_method(sel_registerName("setState:forAttribute:andProperty:onStateValue:offStateValue:"), function(self, _cmd, aState, anAttribute, aProperty, anOnStateValue, anOffStateValue)
{ with(self)
{
    if (!aState)
        aState = _defaultTextAttributes[anAttribute];
    if (aState == _typingTextAttributes[anAttribute])
        return;
    var cssValue = aState == TextAttributeOnState ? anOnStateValue : anOffStateValue;
    _typingTextAttributes[anAttribute] = aState;
    _typingTextProperties[anAttribute] = cssValue;
    var range = objj_msgSend(self, "typingCharacterRange"),
        character = range.start,
        endCharacter = range.end;
    while (character && character != endCharacter)
    {
        character.style[aProperty] = cssValue;
        character = nextCharacter(character);
    }
    if(character && character.innerHTML == TextLayerNewLineElement.innerHTML)
        character.style[aProperty] = cssValue;
    objj_msgSend(self, "resize");
    objj_msgSend(self, "redrawSelection");
    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "textDidChange")
    objj_msgSend(_selectionDelegate, "textLayerDidChangeTextAttributes:", self);
}
});
instance_methods[13] = new objj_method(sel_registerName("bold:"), function(self, _cmd, aSender)
{ with(self)
{
    if ((_typingTextAttributes.boldState == TextAttributeOnState) || !objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
        return;
    objj_msgSend(self, "setState:forAttribute:andProperty:onStateValue:offStateValue:", TextAttributeOnState, "boldState", "fontWeight", "bold", "normal");
}
});
instance_methods[14] = new objj_method(sel_registerName("unbold:"), function(self, _cmd, aSender)
{ with(self)
{
    if ((_typingTextAttributes.boldState == TextAttributeOffState) || !objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
        return;
    objj_msgSend(self, "setState:forAttribute:andProperty:onStateValue:offStateValue:", TextAttributeOffState, "boldState", "fontWeight", "bold", "normal");
}
});
instance_methods[15] = new objj_method(sel_registerName("italicize:"), function(self, _cmd, aSender)
{ with(self)
{
    if ((_typingTextAttributes.italicState == TextAttributeOnState) || !objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
        return;
    objj_msgSend(self, "setState:forAttribute:andProperty:onStateValue:offStateValue:", TextAttributeOnState, "italicState", "fontStyle", "italic", "normal");
}
});
instance_methods[16] = new objj_method(sel_registerName("unitalicize:"), function(self, _cmd, aSender)
{ with(self)
{
    if ((_typingTextAttributes.italicState == TextAttributeOffState) || !objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
        return;
    objj_msgSend(self, "setState:forAttribute:andProperty:onStateValue:offStateValue:", TextAttributeOffState, "italicState", "fontStyle", "italic", "normal");
}
});
instance_methods[17] = new objj_method(sel_registerName("underline:"), function(self, _cmd, aSender)
{ with(self)
{
    if ((_typingTextAttributes.underlineState == TextAttributeOnState) || !objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
        return;
    objj_msgSend(self, "setState:forAttribute:andProperty:onStateValue:offStateValue:", TextAttributeOnState, "underlineState", "textDecoration", "underline", "none");
}
});
instance_methods[18] = new objj_method(sel_registerName("ununderline:"), function(self, _cmd, aSender)
{ with(self)
{
    if ((_typingTextAttributes.underlineState == TextAttributeOffState) || !objj_msgSend(self, "shouldChangeTextInRange:replacementString:", objj_msgSend(self, "selectedRange"), nil))
        return;
    objj_msgSend(self, "setState:forAttribute:andProperty:onStateValue:offStateValue:", TextAttributeOffState, "underlineState", "textDecoration", "underline", "none");
}
});
instance_methods[19] = new objj_method(sel_registerName("applyFontSize:toElement:"), function(self, _cmd, aSize, anElement)
{ with(self)
{
    setFontSize(anElement, aSize);
}
});
instance_methods[20] = new objj_method(sel_registerName("selectedRange"), function(self, _cmd)
{ with(self)
{
    return _selectionRange;
}
});
instance_methods[21] = new objj_method(sel_registerName("calculateSelectedRange"), function(self, _cmd)
{ with(self)
{
    if (_isFirstResponder && !objj_msgSend(self, "hasSelection") && !_previousCharacter && _currentParagraph == objj_msgSend(self, "firstParagraph"))
        return CPMakeRange(0, 0);
    var range = objj_msgSend(self, "typingCharacterRange");
    _selectionRange = CPMakeRange(range.start == range.end ? 1 : 0, 0);
    var character = objj_msgSend(self, "firstCharacter");
    while (character != range.start)
    {
        ++_selectionRange.location;
        character = nextCharacter(character);
    }
    if (!range.end)
        range.end = objj_msgSend(self, "lastCharacterInParagraph:", objj_msgSend(self, "lastParagraph"));
    while (character != range.end)
    {
        ++_selectionRange.length;
        character = nextCharacter(character);
    }
}
});
instance_methods[22] = new objj_method(sel_registerName("setSelectedRange:"), function(self, _cmd, aRange)
{ with(self)
{
    aRange = CPMakeRangeCopy(aRange);
    _selectionRange = CPMakeRangeCopy(aRange);
    _selectionStart = NULL;
    _selectionEnd = NULL;
    var character = objj_msgSend(self, "firstCharacter");
    if (aRange.length == 0)
    {
        if (aRange.location-- == 0)
        {
            _previousCharacter = nil;
            _currentParagraph = objj_msgSend(self, "firstParagraph");
        }
        else
        {
            while (aRange.location--)
                character = nextCharacter(character);
            _previousCharacter = character;
            _currentParagraph = _previousCharacter.parentNode;
        }
    }
    else
    {
        while (character && !_selectionStart)
            if (!(aRange.location--))
                _selectionStart = character;
            else
                character = nextCharacter(character);
        while (character && !_selectionEnd)
            if (!aRange.length--)
                _selectionEnd = character;
            else
                character = nextCharacter(character);
    }
    objj_msgSend(self, "positionCaret");
    objj_msgSend(self, "redrawSelection");
    objj_msgSend(self, "selectionDidChange");
}
});
instance_methods[23] = new objj_method(sel_registerName("shouldChangeTextInRange:replacementString:"), function(self, _cmd, aRange, aString)
{ with(self)
{
    if (!_isInsertingFromStorageObject)
    {
        objj_msgSend(_undoManager, "registerUndoWithTarget:selector:object:", self, sel_registerName("setSelectedRange:"), CPMakeRangeCopy(aRange));
        objj_msgSend(_undoManager, "registerUndoWithTarget:selector:object:", self, sel_registerName("setTextBody_:"), objj_msgSend(self, "textBody"));
    }
    return YES;
}
});
class_addMethods(the_class, instance_methods);
}
takeStyleFrom= function(aDOMElement, properties)
{
    var style = aDOMElement.style;
    style.fontFamily = properties.fontFamily;
    style.color = properties.color;
    style.fontWeight = properties.boldState;
    style.fontStyle = properties.italicState;
    style.textDecoration = properties.underlineState;
}
var setFontSize = function(anElement, aSize)
{
    anElement.style.fontSize = ROUND(aSize * 10.0) + "%";
    if(!anElement.previousSibling && anElement.parentNode && anElement.parentNode.className == TextLayerLineSpacerElement.className)
    {
        setFontSize(anElement.parentNode.parentNode, aSize);
        setFontSize(anElement.parentNode, ((1.0 / aSize) * 100.0));
    }
    if(anElement.nextSibling && anElement.nextSibling.innerHTML == TextLayerNewLineElement.innerHTML)
        setFontSize(anElement.nextSibling, aSize);
}
var parseFontSize = function(aFontSizeString)
{
    return ROUND(parseInt(aFontSizeString, 10) / 10.0);
}
var parseFontFamily = function(aFontFamily)
{
    var firstCharacter = aFontFamily.charAt(0);
    if (firstCharacter == '\'' || firstCharacter == '"')
        return aFontFamily.substr(1, aFontFamily.length - 2);
    return aFontFamily;
}
var parseFontWeight = function(aFontWeight)
{
    if (!aFontWeight || !aFontWeight.length)
        return nil;
    if (aFontWeight == "bold")
        return TextAttributeOnState;
    return TextAttributeOffState;
}
var parseFontStyle = function(aFontStyle)
{
    if (!aFontStyle || !aFontStyle.length)
        return nil;
    if (aFontStyle == "italic")
        return TextAttributeOnState;
    return TextAttributeOffState;
}
var parseTextDecoration = function(aTextDecoration)
{
    if (!aTextDecoration || !aTextDecoration.length)
        return nil;
    if (aTextDecoration == "underline")
        return TextAttributeOnState;
    return TextAttributeOffState;
}
var parseTextAlignment = function(aTextAlignmentString)
{
    switch (aTextAlignmentString)
    {
        case "left": return TextLayerLeftAlignmentMask;
        case "center": return TextLayerCenterAlignmentMask;
        case "right": return TextLayerRightAlignmentMask;
        case "justify": return TextLayerJustifiedAlignmentMask;
    }
    return 0;
}
var colorsAreEqual = function(lhsColor, rhsColor)
{
    return lhsColor.replace(/\s/g, "") == rhsColor.replace(/\s/g, "");
}

