mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 13:20: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
fdafc3afd7
commit
0613cf4ce0
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>
|
||||
|
||||
* Source/NSWindow.m: Various tidyups by Fred kiefer and myself.
|
||||
|
|
|
@ -928,6 +928,33 @@ static inline void
|
|||
DPSdocedited(GSCTXT *ctxt, int edited, int window)
|
||||
__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 */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
@ -2516,4 +2543,11 @@ DPSmouselocation(GSCTXT *ctxt, float *x, float *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
|
||||
|
|
|
@ -514,6 +514,8 @@ typedef struct {
|
|||
(NSGraphicsContext*, SEL, NSEvent*, BOOL);
|
||||
void (*DPSmouselocation__)
|
||||
(NSGraphicsContext*, SEL, float*, float*);
|
||||
void (*DPSsetinputstate__)
|
||||
(NSGraphicsContext*, SEL, int, int);
|
||||
|
||||
} gsMethodTable;
|
||||
|
||||
|
|
|
@ -90,6 +90,16 @@ typedef enum _NSWindowOrderingMode
|
|||
|
||||
} NSWindowOrderingMode;
|
||||
|
||||
/*
|
||||
* Window input state
|
||||
*/
|
||||
typedef enum _GSWindowInputState
|
||||
{
|
||||
GSTitleBarKey = 0,
|
||||
GSTitleBarNormal = 1,
|
||||
GSTitleBarMain = 2
|
||||
|
||||
} GSWindowInputState;
|
||||
|
||||
@interface NSGraphicsContext : NSObject
|
||||
{
|
||||
|
@ -423,6 +433,7 @@ NSGraphicsContext *GSCurrentContext();
|
|||
beforeEvent: (NSEvent*)limit;
|
||||
- (void) DPSPostEvent: (NSEvent*)anEvent atStart: (BOOL)flag;
|
||||
- (void) DPSmouselocation: (float*)x : (float*)y;
|
||||
- (void) DPSsetinputstate: (int)window : (int)state;
|
||||
@end
|
||||
|
||||
#endif /* _NSGraphicsContext_h_INCLUDE */
|
||||
|
|
|
@ -742,6 +742,33 @@ static inline void
|
|||
PScurrentalpha(float *a)
|
||||
__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 */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
@ -1823,4 +1850,10 @@ PSmouselocation(float *x, float *y)
|
|||
DPSmouselocation(DEFCTXT, x, y);
|
||||
}
|
||||
|
||||
static inline void
|
||||
PSsetinputstate(int window, int state)
|
||||
{
|
||||
DPSsetinputstate(DEFCTXT, window, state);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -481,7 +481,8 @@ static NSMapTable* windowmaps = NULL;
|
|||
NSNonRetainedObjectMapValueCallBacks, 20);
|
||||
|
||||
/* Initialize attributes and flags */
|
||||
[self cleanInit];
|
||||
[super init];
|
||||
[self _initDefaults];
|
||||
|
||||
backing_type = bufferingType;
|
||||
style_mask = aStyle;
|
||||
|
@ -791,7 +792,7 @@ static NSMapTable* windowmaps = NULL;
|
|||
[first_responder becomeKeyWindow];
|
||||
|
||||
_f.is_key = YES;
|
||||
DPSsetinputfocus(GSCurrentContext(), window_num);
|
||||
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarKey);
|
||||
[self resetCursorRects];
|
||||
[nc postNotificationName: NSWindowDidBecomeKeyNotification object: self];
|
||||
}
|
||||
|
@ -804,6 +805,10 @@ static NSMapTable* windowmaps = NULL;
|
|||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
|
||||
_f.is_main = YES;
|
||||
if (_f.is_key == NO)
|
||||
{
|
||||
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarMain);
|
||||
}
|
||||
[nc postNotificationName: NSWindowDidBecomeMainNotification object: self];
|
||||
}
|
||||
}
|
||||
|
@ -1058,6 +1063,15 @@ static NSMapTable* windowmaps = NULL;
|
|||
//[first_responder resignKeyWindow];
|
||||
|
||||
_f.is_key = NO;
|
||||
|
||||
if (_f.is_main == YES)
|
||||
{
|
||||
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarMain);
|
||||
}
|
||||
else
|
||||
{
|
||||
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarNormal);
|
||||
}
|
||||
[self discardCursorRects];
|
||||
|
||||
[nc postNotificationName: NSWindowDidResignKeyNotification object: self];
|
||||
|
@ -1071,7 +1085,14 @@ static NSMapTable* windowmaps = NULL;
|
|||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
|
||||
_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];
|
||||
}
|
||||
}
|
||||
|
@ -3211,14 +3232,6 @@ resetCursorRectsForView(NSView *theView)
|
|||
_f.has_closed = NO;
|
||||
}
|
||||
|
||||
- (id) cleanInit
|
||||
{
|
||||
[super init];
|
||||
|
||||
[self _initDefaults];
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue