Add new event subtype for exposure of region of window.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23598 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-09-23 19:08:18 +00:00
parent a34cac104e
commit 183c8411a5
6 changed files with 49 additions and 1 deletions

View file

@ -1,3 +1,12 @@
2006-09-23 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSWindowDecorationView.m: coimment out dubious change.
* Source/GSDisplayServer.m: Add method for expose events
* Source/NSWindow.m: Handle expose events.
* Headers/AppKit/NSEvent.h: Add expose event type.
* Headers/Additions/GNUstepGUI/GSDisplayServer.h: Add method for
expose events.
2006-09-22 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/AppKit/NSColorList.h: Add documentation.

View file

@ -143,6 +143,7 @@ APPKIT_EXPORT NSString * GSScreenNumber;
- (void) styleoffsets: (float*) l : (float*) r : (float*) t : (float*) b
: (unsigned int) style;
- (void) docedited: (int) edited : (int) win;
- (void) exposewindow: (NSRect)frame : (int) win;
- (void) setinputstate: (int)state : (int)win;
- (void) setinputfocus: (int) win;
- (void) setalpha: (float)alpha: (int) win;

View file

@ -362,7 +362,8 @@ typedef enum {
GSAppKitDraggingStatus,
GSAppKitDraggingExit,
GSAppKitDraggingDrop,
GSAppKitDraggingFinished
GSAppKitDraggingFinished,
GSAppKitRegionExposed
} GSAppKitSubtype;
#endif

View file

@ -724,6 +724,12 @@ GSCurrentServer(void)
[self subclassResponsibility: _cmd];
}
/** Repaint an exposed region of a buffered window */
- (void) exposewindow: (NSRect)frame : (int) win
{
[self subclassResponsibility: _cmd];
}
/** Sets the input state for the window given by the
GSWindowInputState constant. Instructs the window manager that the
specified window is 'key', 'main', or just a normal window. */

View file

@ -124,6 +124,7 @@ struct NSWindow_struct
return self;
}
#if 0
- (void) removeSubview: (NSView*)aView
{
RETAIN(aView);
@ -137,6 +138,7 @@ struct NSWindow_struct
}
RELEASE(aView);
}
#endif
- (void) setBackgroundColor: (NSColor *)color
{

View file

@ -3360,6 +3360,35 @@ resetCursorRectsForView(NSView *theView)
break;
}
case GSAppKitRegionExposed:
{
NSRect region;
region.size.width = [theEvent data1];
region.size.height = [theEvent data2];
region.origin = [theEvent locationInWindow];
switch (_backingType)
{
case NSBackingStoreBuffered:
case NSBackingStoreRetained:
/* The window is buffered/retained, so we expect the
* backend to have a copy of the region contents and
* be able to draw it.
*/
[GSServerForWindow(self) exposewindow: region
: _windowNum];
break;
default:
/* non-retained ... so we need to redraw the exposed
* region here.
*/
[_wv setNeedsDisplayInRect: region];
break;
}
}
break;
case GSAppKitWindowClose:
[self performClose: NSApp];
break;