mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 13:00:37 +00:00
Move view specifc flags to NSView.h and ad new flag for NSWindow. This
change requires a complete re-compile of GNUstep and all applications!!! git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24821 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8303f207ed
commit
b723a7e84c
4 changed files with 54 additions and 54 deletions
|
@ -61,29 +61,6 @@
|
|||
*/
|
||||
@private
|
||||
NSMenu *_menu;
|
||||
/*
|
||||
* Flags for internal use by NSResponder and it's subclasses.
|
||||
*/
|
||||
@public
|
||||
struct _rFlagsType {
|
||||
/*
|
||||
* 'flipped_view' is set in NSViews designated initialiser (and other
|
||||
* methods that create views) to be the value returned by [-isFlipped]
|
||||
* This caching assumes that the value returned by [-isFlipped] will
|
||||
* not change during the views lifetime - if it does, the view must
|
||||
* be sure to change the flag accordingly.
|
||||
*/
|
||||
unsigned flipped_view:1;
|
||||
unsigned has_subviews:1; /* The view has subviews. */
|
||||
unsigned has_currects:1; /* The view has cursor rects. */
|
||||
unsigned has_trkrects:1; /* The view has tracking rects. */
|
||||
unsigned has_draginfo:1; /* View/window has drag types. */
|
||||
unsigned opaque_view:1; /* For views whose opacity may */
|
||||
/* change to keep track of it. */
|
||||
unsigned valid_rects:1; /* Some cursor rects may be ok. */
|
||||
unsigned needs_display:1; /* Window/view needs display. */
|
||||
unsigned has_tooltips:1; /* The view has tooltips set. */
|
||||
} _rFlags;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -109,8 +109,33 @@ typedef enum _NSFocusRingType {
|
|||
NSMutableArray *_cursor_rects;
|
||||
NSRect _invalidRect;
|
||||
NSRect _visibleRect;
|
||||
unsigned int _autoresizingMask;
|
||||
int _gstate;
|
||||
void *_nextKeyView;
|
||||
void *_previousKeyView;
|
||||
|
||||
@public
|
||||
/*
|
||||
* Flags for internal use by NSView and it's subclasses.
|
||||
*/
|
||||
struct _rFlagsType {
|
||||
/*
|
||||
* 'flipped_view' is set in NSViews designated initialiser (and other
|
||||
* methods that create views) to be the value returned by [-isFlipped]
|
||||
* This caching assumes that the value returned by [-isFlipped] will
|
||||
* not change during the views lifetime - if it does, the view must
|
||||
* be sure to change the flag accordingly.
|
||||
*/
|
||||
unsigned flipped_view:1;
|
||||
unsigned has_subviews:1; /* The view has subviews. */
|
||||
unsigned has_currects:1; /* The view has cursor rects. */
|
||||
unsigned has_trkrects:1; /* The view has tracking rects. */
|
||||
unsigned has_draginfo:1; /* View has drag types. */
|
||||
unsigned opaque_view:1; /* For views whose opacity may */
|
||||
/* change to keep track of it. */
|
||||
unsigned valid_rects:1; /* Some cursor rects may be ok. */
|
||||
unsigned needs_display:1; /* view needs display. */
|
||||
unsigned has_tooltips:1; /* The view has tooltips set. */
|
||||
} _rFlags;
|
||||
|
||||
BOOL _is_rotated_from_base;
|
||||
BOOL _is_rotated_or_scaled_from_base;
|
||||
|
@ -123,10 +148,8 @@ typedef enum _NSFocusRingType {
|
|||
BOOL _is_hidden;
|
||||
BOOL _in_live_resize;
|
||||
|
||||
unsigned int _autoresizingMask;
|
||||
NSFocusRingType _focusRingType;
|
||||
|
||||
void *_nextKeyView;
|
||||
void *_previousKeyView;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -207,6 +207,7 @@ APPKIT_EXPORT NSSize NSTokenSize;
|
|||
unsigned can_hide:1;
|
||||
unsigned has_shadow:1;
|
||||
unsigned is_opaque:1;
|
||||
unsigned views_need_display:1;
|
||||
// 3 bits reserved for subclass use
|
||||
unsigned subclass_bool_one: 1;
|
||||
unsigned subclass_bool_two: 1;
|
||||
|
|
|
@ -128,7 +128,7 @@ BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
|
|||
/* Window autodisplay machinery. */
|
||||
- (void) _handleAutodisplay
|
||||
{
|
||||
if (_f.is_autodisplay && _rFlags.needs_display)
|
||||
if (_f.is_autodisplay && _f.views_need_display)
|
||||
{
|
||||
[self disableFlushWindow];
|
||||
[self displayIfNeeded];
|
||||
|
@ -2062,18 +2062,21 @@ many times.
|
|||
if (_gstate == 0 || _f.visible == NO)
|
||||
return;
|
||||
|
||||
_rFlags.needs_display = NO;
|
||||
|
||||
[_wv display];
|
||||
[self discardCachedImage];
|
||||
_f.views_need_display = NO;
|
||||
}
|
||||
|
||||
- (void) displayIfNeeded
|
||||
{
|
||||
if (_rFlags.needs_display)
|
||||
if (_gstate == 0 || _f.visible == NO)
|
||||
return;
|
||||
|
||||
if (_f.views_need_display)
|
||||
{
|
||||
[_wv displayIfNeeded];
|
||||
_rFlags.needs_display = NO;
|
||||
[self discardCachedImage];
|
||||
_f.views_need_display = NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2176,9 +2179,9 @@ many times.
|
|||
|
||||
- (void) setViewsNeedDisplay: (BOOL)flag
|
||||
{
|
||||
if (_rFlags.needs_display != flag)
|
||||
if (_f.views_need_display != flag)
|
||||
{
|
||||
_rFlags.needs_display = flag;
|
||||
_f.views_need_display = flag;
|
||||
if (flag)
|
||||
{
|
||||
/* TODO: this call most likely shouldn't be here */
|
||||
|
@ -2189,7 +2192,7 @@ many times.
|
|||
|
||||
- (BOOL) viewsNeedDisplay
|
||||
{
|
||||
return _rFlags.needs_display;
|
||||
return _f.views_need_display;
|
||||
}
|
||||
|
||||
- (void) cacheImageInRect: (NSRect)aRect
|
||||
|
@ -3470,23 +3473,20 @@ resetCursorRectsForView(NSView *theView)
|
|||
_rectNeedingFlush
|
||||
= NSUnionRect(_rectNeedingFlush, region);
|
||||
_f.needs_flush = YES;
|
||||
if (_rFlags.needs_display)
|
||||
{
|
||||
/* Some or all of the window has not been drawn,
|
||||
* so we must at least make sure that the exposed
|
||||
* region gets drawn before its backing store is
|
||||
* flushed ... otherwise we might actually flush
|
||||
* bogus data from an out of date buffer.
|
||||
* Maybe we should call
|
||||
* [_wv displayIfNeededInRect: region]
|
||||
* but why not do all drawing at this point so
|
||||
* that if we get another expose event immediately
|
||||
* (eg. something is dragged over the window and
|
||||
* we get a series of expose events) we can just
|
||||
* flush without having to draw again.
|
||||
*/
|
||||
[_wv displayIfNeeded];
|
||||
}
|
||||
/* Some or all of the window has not been drawn,
|
||||
* so we must at least make sure that the exposed
|
||||
* region gets drawn before its backing store is
|
||||
* flushed ... otherwise we might actually flush
|
||||
* bogus data from an out of date buffer.
|
||||
* Maybe we should call
|
||||
* [_wv displayIfNeededInRect: region]
|
||||
* but why not do all drawing at this point so
|
||||
* that if we get another expose event immediately
|
||||
* (eg. something is dragged over the window and
|
||||
* we get a series of expose events) we can just
|
||||
* flush without having to draw again.
|
||||
*/
|
||||
[self displayIfNeeded];
|
||||
[self flushWindowIfNeeded];
|
||||
break;
|
||||
|
||||
|
@ -4654,8 +4654,7 @@ current key view.<br />
|
|||
_f.can_hide = YES;
|
||||
_f.has_shadow = NO;
|
||||
_f.is_opaque = YES;
|
||||
|
||||
_rFlags.needs_display = YES;
|
||||
_f.views_need_display = YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue