mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 20:11:20 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@16111 72102866-910b-0410-8b05-ffd578937521
89 lines
2 KiB
Objective-C
89 lines
2 KiB
Objective-C
#include "GormPosingView.h"
|
|
|
|
|
|
@implementation GormPosingView
|
|
|
|
struct _rFlagsType2 {
|
|
/*
|
|
* '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 isCustom:1;
|
|
} ;
|
|
|
|
|
|
- (id) initWithFrame: (NSRect)frameRect
|
|
{
|
|
struct _rFlagsType2 *rft2;
|
|
|
|
rft2 = (struct _rFlagsType2 *) &_rFlags;
|
|
|
|
rft2->isCustom = 0;
|
|
|
|
[super initWithFrame: frameRect];
|
|
}
|
|
|
|
- (void) viewWillMoveToWindow: (NSWindow*)newWindow
|
|
{
|
|
if ([newWindow isKindOfClass: NSClassFromString(@"GormNSWindow")])
|
|
{
|
|
[self setCustom: YES];
|
|
}
|
|
[super viewWillMoveToWindow: newWindow];
|
|
|
|
}
|
|
|
|
- (BOOL) isCustom
|
|
{
|
|
struct _rFlagsType2 *rft2;
|
|
|
|
rft2 = (struct _rFlagsType2 *) &_rFlags;
|
|
|
|
if (rft2->isCustom == 0)
|
|
return NO;
|
|
else
|
|
return YES;
|
|
}
|
|
|
|
- (void) display
|
|
{
|
|
if ([self isCustom])
|
|
{
|
|
NSLog(@"%@ display", self);
|
|
}
|
|
[super display];
|
|
}
|
|
|
|
- (void) displayIfNeeded
|
|
{
|
|
if ([self isCustom])
|
|
{
|
|
NSLog(@"%@ displayIfNeeded", self);
|
|
}
|
|
[super displayIfNeeded];
|
|
}
|
|
|
|
- (void) setCustom: (BOOL) value
|
|
{
|
|
struct _rFlagsType2 *rft2;
|
|
|
|
rft2 = (struct _rFlagsType2 *) &_rFlags;
|
|
if (value)
|
|
rft2->isCustom = 1;
|
|
else
|
|
rft2->isCustom = 0;
|
|
}
|
|
|
|
@end
|