// // ShadowView.m // // Created by Andrew Zamler-Carhart on Tue Jul 02 2002. // mailto:andrew@zamler-carhart.com // Copyright (c) 2002 Andrew Zamler-Carhart. // // Thanks to John C. Randolph and Tom Waters. // // To experiment with the values to showShadowHeight:radius:azimuth:ka, // you may wish to try Tom Waters' program TestShadow, available at // http://www.whidbeysoft.com/downloads/TestShadow.tar.gz // #import @interface ShadowView : NSView { void *shadowValues; } // This method will enlarge the view's frame by offset in all directions, // thus preventing the shadow from being clipped by the view's bounding rect. // The offset variable should be roughly the sum of height and radius passed to the next method. // Drawing should be offset by this amount. (Perhaps a coordinate transform would be in order?) - (void) enlargeFrame: (int) offset; // Causes all drawing to be done using a drop shadow. // Each call to this method must be followed by a call to hideShadow. - (void) showShadowHeight: (int) height // the offset of the drop shadow from what is drawn radius: (int) radius // how much the shadow is blurred azimuth: (int) azimuth // the angle that the light appears to come from ka: (float) ka; // 0.0 is a black shadow, 1.0 is no shadow // Turns off the drop shadow. // Must be called after calling the above method. - (void) hideShadow; @end