diff --git a/ChangeLog b/ChangeLog index 1b9d4820f..9aea404bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * Source/NSView.m (_invalidateCoordinates): release the gstate. (-releaseGState): Don't reset _allocate_gstate flag. (modified patch from Georg Fleischmann ). + * Documentation/gsdoc/NSView.gsdoc: Document gstate methods. 2001-04-14 Adam Fedor diff --git a/Documentation/gsdoc/NSView.gsdoc b/Documentation/gsdoc/NSView.gsdoc index 55596b21b..659ac10cf 100644 --- a/Documentation/gsdoc/NSView.gsdoc +++ b/Documentation/gsdoc/NSView.gsdoc @@ -23,16 +23,22 @@ Gui/NSView.h NSCoding -

NSView is an abstract class which provides facilities for drawing in a window and - receiving events. It is the superclass of many of the visual elements of the GUI.

-

In order to display itself, a view must be placed in a window (represented by an - NSWindow object). Within the window is a hierarchy of NSViews, headed by the window's - content view. Every other view in a window is a descendant of this view.

+

NSView is an abstract class which provides facilities for + drawing in a window and receiving events. It is the + superclass of many of the visual elements of the GUI.

+ +

In order to display itself, a view must be placed in a + window (represented by an NSWindow object). Within the + window is a hierarchy of NSViews, headed by the window's + content view. Every other view in a window is a descendant + of this view.

+ +

Subclasses can override drawRect: in order + to implement their appearance. Other methods of NSView and + NSResponder can also be overridden to handle user generated + events.

-

Subclasses can override drawRect: in order to implement their - appearance. Other methods of NSView and NSResponder can also be overridden to handle - user generated events.

defaultMenu @@ -127,6 +133,16 @@ allocateGState + Tell the view to maintain a private gstate object which + encapsulates all the information about drawing, such as coordinate + transforms, line widths, etc. If you do not invoke this method, + a gstate object is constructed each time the view is lockFocused. + Allocating a private gstate may improve the performance of views + that are focused a lot and have a lot of customized drawing + parameters. +

+ View subclasses should override the setUpGstate method to set these + custom parameters. @@ -436,6 +452,12 @@ gState + Returns an identifier that represents the view's gstate object, + which is used to encapsulate drawing information about the view. + Most of the time a gstate object is created from scratch when + the view is focused, so if the view is not currently focused or + allocateGState has not been called, then this method will + return 0. @@ -614,6 +636,8 @@ releaseGState + Frees the gstate object, if there is one. Note that the next time + the view is lockFocused, the gstate will be allocated again. @@ -673,6 +697,8 @@ renewGState + Invalidates the view's gstate object so it will be set up + again using setUpGState the next time the view is focused.