mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 18:40:38 +00:00
Titlebar state change code added
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6194 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6a2530c043
commit
5950d6f837
6 changed files with 113 additions and 11 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
Mon Mar 06 20:09:00 2000 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
|
* Headers/gnustep/gui/GSMethodTable.h: Added method to set titlebar.
|
||||||
|
* Headers/gnustep/gui/DPSOperators.h: ditto
|
||||||
|
* Headers/gnustep/gui/NSGraphicsContext.h: ditto
|
||||||
|
* Headers/gnustep/gui/PSOperators.h: ditto
|
||||||
|
* Source/NSWindow.m: Make calls to DPSsetinputstate() to set the
|
||||||
|
titlebar for the window on change of key/main/normal state.
|
||||||
|
|
||||||
Mon Mar 06 10:36:00 2000 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
Mon Mar 06 10:36:00 2000 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Source/NSWindow.m: Various tidyups by Fred kiefer and myself.
|
* Source/NSWindow.m: Various tidyups by Fred kiefer and myself.
|
||||||
|
|
|
@ -928,6 +928,33 @@ static inline void
|
||||||
DPSdocedited(GSCTXT *ctxt, int edited, int window)
|
DPSdocedited(GSCTXT *ctxt, int edited, int window)
|
||||||
__attribute__((unused));
|
__attribute__((unused));
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
/* GNUstep Event and other I/O extensions */
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
static inline NSEvent*
|
||||||
|
DPSGetEvent(GSCTXT *ctxt, unsigned mask, NSDate* limit, NSString *mode)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
|
static inline NSEvent*
|
||||||
|
DPSPeekEvent(GSCTXT *ctxt, unsigned mask, NSDate* limit, NSString *mode)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
DPSDiscardEvents(GSCTXT *ctxt, unsigned mask, NSEvent* limit)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
DPSPostEvent(GSCTXT *ctxt, NSEvent* anEvent, BOOL atStart)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
DPSmouselocation(GSCTXT *ctxt, float *x, float *y)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
DPSsetinputstate(GSCTXT *ctxt, int window, int state)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Color operations */
|
/* Color operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
@ -2516,4 +2543,11 @@ DPSmouselocation(GSCTXT *ctxt, float *x, float *y)
|
||||||
(ctxt, @selector(DPSmouselocation::), x, y);
|
(ctxt, @selector(DPSmouselocation::), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
DPSsetinputstate(GSCTXT *ctxt, int window, int state)
|
||||||
|
{
|
||||||
|
(ctxt->methods->DPSsetinputstate__)
|
||||||
|
(ctxt, @selector(DPSsetinputstate::), window, state);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -514,6 +514,8 @@ typedef struct {
|
||||||
(NSGraphicsContext*, SEL, NSEvent*, BOOL);
|
(NSGraphicsContext*, SEL, NSEvent*, BOOL);
|
||||||
void (*DPSmouselocation__)
|
void (*DPSmouselocation__)
|
||||||
(NSGraphicsContext*, SEL, float*, float*);
|
(NSGraphicsContext*, SEL, float*, float*);
|
||||||
|
void (*DPSsetinputstate__)
|
||||||
|
(NSGraphicsContext*, SEL, int, int);
|
||||||
|
|
||||||
} gsMethodTable;
|
} gsMethodTable;
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,16 @@ typedef enum _NSWindowOrderingMode
|
||||||
|
|
||||||
} NSWindowOrderingMode;
|
} NSWindowOrderingMode;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Window input state
|
||||||
|
*/
|
||||||
|
typedef enum _GSWindowInputState
|
||||||
|
{
|
||||||
|
GSTitleBarKey = 0,
|
||||||
|
GSTitleBarNormal = 1,
|
||||||
|
GSTitleBarMain = 2
|
||||||
|
|
||||||
|
} GSWindowInputState;
|
||||||
|
|
||||||
@interface NSGraphicsContext : NSObject
|
@interface NSGraphicsContext : NSObject
|
||||||
{
|
{
|
||||||
|
@ -423,6 +433,7 @@ NSGraphicsContext *GSCurrentContext();
|
||||||
beforeEvent: (NSEvent*)limit;
|
beforeEvent: (NSEvent*)limit;
|
||||||
- (void) DPSPostEvent: (NSEvent*)anEvent atStart: (BOOL)flag;
|
- (void) DPSPostEvent: (NSEvent*)anEvent atStart: (BOOL)flag;
|
||||||
- (void) DPSmouselocation: (float*)x : (float*)y;
|
- (void) DPSmouselocation: (float*)x : (float*)y;
|
||||||
|
- (void) DPSsetinputstate: (int)window : (int)state;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif /* _NSGraphicsContext_h_INCLUDE */
|
#endif /* _NSGraphicsContext_h_INCLUDE */
|
||||||
|
|
|
@ -742,6 +742,33 @@ static inline void
|
||||||
PScurrentalpha(float *a)
|
PScurrentalpha(float *a)
|
||||||
__attribute__((unused));
|
__attribute__((unused));
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
/* GNUstep Event and other I/O extensions */
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
static inline NSEvent*
|
||||||
|
PSGetEvent(unsigned mask, NSDate* limit, NSString *mode)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
|
static inline NSEvent*
|
||||||
|
PSPeekEvent(unsigned mask, NSDate* limit, NSString *mode)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
PSDiscardEvents(unsigned mask, NSEvent* limit)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
PSPostEvent(NSEvent* anEvent, BOOL atStart)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
PSmouselocation(float *x, float *y)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
PSsetinputstate(int window, int state)
|
||||||
|
__attribute__((unused));
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Color operations */
|
/* Color operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
@ -1823,4 +1850,10 @@ PSmouselocation(float *x, float *y)
|
||||||
DPSmouselocation(DEFCTXT, x, y);
|
DPSmouselocation(DEFCTXT, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
PSsetinputstate(int window, int state)
|
||||||
|
{
|
||||||
|
DPSsetinputstate(DEFCTXT, window, state);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -481,7 +481,8 @@ static NSMapTable* windowmaps = NULL;
|
||||||
NSNonRetainedObjectMapValueCallBacks, 20);
|
NSNonRetainedObjectMapValueCallBacks, 20);
|
||||||
|
|
||||||
/* Initialize attributes and flags */
|
/* Initialize attributes and flags */
|
||||||
[self cleanInit];
|
[super init];
|
||||||
|
[self _initDefaults];
|
||||||
|
|
||||||
backing_type = bufferingType;
|
backing_type = bufferingType;
|
||||||
style_mask = aStyle;
|
style_mask = aStyle;
|
||||||
|
@ -791,7 +792,7 @@ static NSMapTable* windowmaps = NULL;
|
||||||
[first_responder becomeKeyWindow];
|
[first_responder becomeKeyWindow];
|
||||||
|
|
||||||
_f.is_key = YES;
|
_f.is_key = YES;
|
||||||
DPSsetinputfocus(GSCurrentContext(), window_num);
|
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarKey);
|
||||||
[self resetCursorRects];
|
[self resetCursorRects];
|
||||||
[nc postNotificationName: NSWindowDidBecomeKeyNotification object: self];
|
[nc postNotificationName: NSWindowDidBecomeKeyNotification object: self];
|
||||||
}
|
}
|
||||||
|
@ -804,6 +805,10 @@ static NSMapTable* windowmaps = NULL;
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
|
|
||||||
_f.is_main = YES;
|
_f.is_main = YES;
|
||||||
|
if (_f.is_key == NO)
|
||||||
|
{
|
||||||
|
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarMain);
|
||||||
|
}
|
||||||
[nc postNotificationName: NSWindowDidBecomeMainNotification object: self];
|
[nc postNotificationName: NSWindowDidBecomeMainNotification object: self];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1058,6 +1063,15 @@ static NSMapTable* windowmaps = NULL;
|
||||||
//[first_responder resignKeyWindow];
|
//[first_responder resignKeyWindow];
|
||||||
|
|
||||||
_f.is_key = NO;
|
_f.is_key = NO;
|
||||||
|
|
||||||
|
if (_f.is_main == YES)
|
||||||
|
{
|
||||||
|
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarMain);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarNormal);
|
||||||
|
}
|
||||||
[self discardCursorRects];
|
[self discardCursorRects];
|
||||||
|
|
||||||
[nc postNotificationName: NSWindowDidResignKeyNotification object: self];
|
[nc postNotificationName: NSWindowDidResignKeyNotification object: self];
|
||||||
|
@ -1071,7 +1085,14 @@ static NSMapTable* windowmaps = NULL;
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
|
|
||||||
_f.is_main = NO;
|
_f.is_main = NO;
|
||||||
|
if (_f.is_key == YES)
|
||||||
|
{
|
||||||
|
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarKey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarNormal);
|
||||||
|
}
|
||||||
[nc postNotificationName: NSWindowDidResignMainNotification object: self];
|
[nc postNotificationName: NSWindowDidResignMainNotification object: self];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3211,14 +3232,6 @@ resetCursorRectsForView(NSView *theView)
|
||||||
_f.has_closed = NO;
|
_f.has_closed = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) cleanInit
|
|
||||||
{
|
|
||||||
[super init];
|
|
||||||
|
|
||||||
[self _initDefaults];
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo)
|
BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue