mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
iUpdated for NSGraphicsContext
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3804 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a2fed424c9
commit
295f1d2a08
17 changed files with 96 additions and 76 deletions
26
ChangeLog
26
ChangeLog
|
@ -1,3 +1,29 @@
|
|||
Thu Feb 25 15:00:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
Added support for the new (MacOS-X) NSGraphicsContext class by
|
||||
incorporating stuff from Adam Fedors xgps and replacing GSContext
|
||||
* Headers/AppKit/DPSOperators.h: New file
|
||||
* Headers/AppKit/PSOperators.h: New file
|
||||
* Headers/AppKit/GSMethodTable.h: New file
|
||||
* Headers/AppKit/NSGraphicsContext.h: New file
|
||||
* Source/NSGraphicsContext.m: New class implementation
|
||||
* Headers/AppKit/AppKit.h: Updated for NSGraphicsContext
|
||||
* Headers/AppKit/NSApplication.h: ditto
|
||||
* Headers/AppKit/NSEvent.h: ditto
|
||||
* Headers/AppKit/NSImage.h: ditto
|
||||
* Headers/AppKit/NSPrintOperation.h: ditto
|
||||
* Headers/AppKit/NSView.h: ditto
|
||||
* Headers/AppKit/NSWindow.h: ditto
|
||||
* Source/Functions.m: ditto
|
||||
* Source/GNUmakefile: ditto
|
||||
* Source/NSApplication.m: ditto
|
||||
* Source/NSButtonCell.m: ditto
|
||||
* Source/NSCell.m: ditto
|
||||
* Source/NSEvent.m: ditto
|
||||
* Source/NSPrintOperation.m: ditto
|
||||
* Source/NSScrollView.m: ditto
|
||||
* Source/externs.m: ditto
|
||||
|
||||
Wed Feb 24 Felipe A. Rodriguez <farz@mindspring.com>
|
||||
|
||||
* NSSliderCell.m: knobRectFlipped: fix draw bugs in slider.app example.
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
#include <AppKit/NSFontPanel.h>
|
||||
#include <AppKit/NSForm.h>
|
||||
#include <AppKit/NSFormCell.h>
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
#include <AppKit/NSHelpPanel.h>
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <AppKit/NSImageRep.h>
|
||||
|
@ -140,4 +141,6 @@
|
|||
#include <AppKit/NSWorkspace.h>
|
||||
#include <AppKit/NSNibDeclarations.h>
|
||||
|
||||
#include <AppKit/PSOperators.h>
|
||||
|
||||
#endif _GNUstep_H_AppKit
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
@class NSMenuItem;
|
||||
@class NSImage;
|
||||
@class NSWindow;
|
||||
@class GSContext;
|
||||
@class NSGraphicsContext;
|
||||
|
||||
typedef struct _NSModalSession *NSModalSession;
|
||||
|
||||
|
@ -216,7 +216,7 @@ extern NSString *NSEventTrackingRunLoopMode;
|
|||
//
|
||||
// Getting the display context
|
||||
//
|
||||
- (GSContext *)context;
|
||||
- (NSGraphicsContext *)context;
|
||||
|
||||
//
|
||||
// Reporting an exception
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
@class NSString;
|
||||
@class NSWindow;
|
||||
@class GSContext;
|
||||
@class NSGraphicsContext;
|
||||
|
||||
typedef enum _NSEventType {
|
||||
NSLeftMouseDown,
|
||||
|
@ -92,7 +92,7 @@ enum {
|
|||
unsigned int modifier_flags;
|
||||
NSTimeInterval event_time;
|
||||
int window_num;
|
||||
GSContext *event_context;
|
||||
NSGraphicsContext*event_context;
|
||||
union _MB_event_data
|
||||
{
|
||||
struct
|
||||
|
@ -132,7 +132,7 @@ enum {
|
|||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(GSContext *)context
|
||||
context:(NSGraphicsContext*)context
|
||||
eventNumber:(int)eventNum
|
||||
trackingNumber:(int)trackingNum
|
||||
userData:(void *)userData;
|
||||
|
@ -142,7 +142,7 @@ enum {
|
|||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(GSContext *)context
|
||||
context:(NSGraphicsContext*)context
|
||||
characters:(NSString *)keys
|
||||
charactersIgnoringModifiers:(NSString *)ukeys
|
||||
isARepeat:(BOOL)repeatKey
|
||||
|
@ -153,7 +153,7 @@ enum {
|
|||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(GSContext *)context
|
||||
context:(NSGraphicsContext*)context
|
||||
eventNumber:(int)eventNum
|
||||
clickCount:(int)clickNum
|
||||
pressure:(float)pressureValue;
|
||||
|
@ -163,7 +163,7 @@ enum {
|
|||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(GSContext *)context
|
||||
context:(NSGraphicsContext*)context
|
||||
subtype:(short)subType
|
||||
data1:(int)data1
|
||||
data2:(int)data2;
|
||||
|
@ -171,7 +171,7 @@ enum {
|
|||
//
|
||||
// Getting General Event Information
|
||||
//
|
||||
- (GSContext *)context;
|
||||
- (NSGraphicsContext*)context;
|
||||
- (NSPoint)locationInWindow;
|
||||
- (unsigned int)modifierFlags;
|
||||
- (NSTimeInterval)timestamp;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _GNUstep_H_NSImage
|
||||
#define _GNUstep_H_NSImage
|
||||
|
||||
#include <AppKit/GSContext.h>
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
#include <Foundation/NSBundle.h>
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include <AppKit/NSBitmapImageRep.h>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
@class NSView;
|
||||
@class NSPrintInfo;
|
||||
@class NSPrintPanel;
|
||||
@class GSContext;
|
||||
@class NSGraphicsContext;
|
||||
|
||||
typedef enum _NSPrintingPageOrder {
|
||||
NSDescendingPageOrder,
|
||||
|
@ -99,8 +99,8 @@ typedef enum _NSPrintingPageOrder {
|
|||
//
|
||||
// Managing the DPS Context
|
||||
//
|
||||
- (GSContext *)createContext;
|
||||
- (GSContext *)context;
|
||||
- (NSGraphicsContext *)createContext;
|
||||
- (NSGraphicsContext *)context;
|
||||
- (void)destroyContext;
|
||||
|
||||
//
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#ifndef _GNUstep_H_NSView
|
||||
#define _GNUstep_H_NSView
|
||||
|
||||
#include <AppKit/GSContext.h>
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
#include <AppKit/NSResponder.h>
|
||||
|
||||
@class NSString;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#ifndef _GNUstep_H_NSWindow
|
||||
#define _GNUstep_H_NSWindow
|
||||
|
||||
#include <AppKit/GSContext.h>
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
#include <AppKit/NSGraphics.h>
|
||||
#include <AppKit/NSResponder.h>
|
||||
#include <AppKit/NSEvent.h>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSEvent.h>
|
||||
#include <AppKit/GSContext.h>
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
|
||||
char **NSArgv = NULL;
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ LIBRARY_NAME=libgnustep-gui
|
|||
|
||||
# The Objective-C source files to be compiled
|
||||
libgnustep-gui_OBJC_FILES = Functions.m \
|
||||
GSContext.m \
|
||||
NSActionCell.m \
|
||||
NSApplication.m \
|
||||
NSBitmapImageRep.m \
|
||||
|
@ -70,6 +69,7 @@ NSFontManager.m \
|
|||
NSFontPanel.m \
|
||||
NSForm.m \
|
||||
NSFormCell.m \
|
||||
NSGraphicsContext.m \
|
||||
NSHelpPanel.m \
|
||||
NSImage.m \
|
||||
NSImageRep.m \
|
||||
|
@ -120,7 +120,6 @@ libgnustep-gui_HEADER_FILES_INSTALL_DIR = /gnustep/gui
|
|||
|
||||
libgnustep-gui_HEADER_FILES = \
|
||||
AppKit/AppKit.h \
|
||||
AppKit/GSContext.h \
|
||||
AppKit/NSActionCell.h \
|
||||
AppKit/NSApplication.h \
|
||||
AppKit/NSBitmapImageRep.h \
|
||||
|
@ -155,6 +154,7 @@ AppKit/NSFontPanel.h \
|
|||
AppKit/NSForm.h \
|
||||
AppKit/NSFormCell.h \
|
||||
AppKit/NSGraphics.h \
|
||||
AppKit/NSGraphicsContext.h \
|
||||
AppKit/NSHelpPanel.h \
|
||||
AppKit/NSImage.h \
|
||||
AppKit/NSImageRep.h \
|
||||
|
@ -204,7 +204,10 @@ AppKit/NSWorkspace.h \
|
|||
AppKit/GSTrackingRect.h \
|
||||
AppKit/PSMatrix.h \
|
||||
AppKit/nsimage-tiff.h \
|
||||
AppKit/GSServicesManager.h \
|
||||
AppKit/GSMethodTable.h \
|
||||
AppKit/DPSOperators.h \
|
||||
AppKit/PSOperators.h \
|
||||
AppKit/GSServicesManager.h
|
||||
|
||||
-include GNUmakefile.preamble
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
# include <Foundation/NSConnection.h>
|
||||
#endif
|
||||
|
||||
#include <AppKit/GSContext.h>
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSPopUpButton.h>
|
||||
#include <AppKit/NSPasteboard.h>
|
||||
|
@ -1617,9 +1617,9 @@ BOOL done = NO;
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (GSContext *)context // return the current draw
|
||||
- (NSGraphicsContext *)context // return the current draw
|
||||
{ // context (drawing dest)
|
||||
return [GSContext currentContext];
|
||||
return [NSGraphicsContext currentContext];
|
||||
}
|
||||
|
||||
- (void) reportException: (NSException *)anException
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include <AppKit/NSImage.h>
|
||||
#include <AppKit/NSColor.h>
|
||||
#include <AppKit/NSGraphics.h>
|
||||
#include <AppKit/PSOperators.h>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include <AppKit/NSGraphics.h>
|
||||
#include <AppKit/NSColor.h>
|
||||
#include <AppKit/PSMatrix.h>
|
||||
#include <AppKit/PSOperators.h>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <AppKit/NSEvent.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <AppKit/GSContext.h>
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
|
||||
@implementation NSEvent
|
||||
|
||||
|
@ -63,15 +63,15 @@ static NSString *timerKey = @"NSEventTimersKey";
|
|||
//
|
||||
// Creating NSEvent objects
|
||||
//
|
||||
+ (NSEvent *)enterExitEventWithType:(NSEventType)type
|
||||
location:(NSPoint)location
|
||||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(GSContext *)context
|
||||
eventNumber:(int)eventNum
|
||||
trackingNumber:(int)trackingNum
|
||||
userData:(void *)userData
|
||||
+ (NSEvent*) enterExitEventWithType: (NSEventType)type
|
||||
location: (NSPoint)location
|
||||
modifierFlags: (unsigned int)flags
|
||||
timestamp: (NSTimeInterval)time
|
||||
windowNumber: (int)windowNum
|
||||
context: (NSGraphicsContext*)context
|
||||
eventNumber: (int)eventNum
|
||||
trackingNumber: (int)trackingNum
|
||||
userData: (void *)userData
|
||||
{
|
||||
NSEvent *e = [[[NSEvent alloc] init] autorelease];
|
||||
// do nothing if
|
||||
|
@ -93,15 +93,15 @@ NSEvent *e = [[[NSEvent alloc] init] autorelease];
|
|||
}
|
||||
|
||||
+ (NSEvent *)keyEventWithType:(NSEventType)type
|
||||
location:(NSPoint)location
|
||||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(GSContext *)context
|
||||
characters:(NSString *)keys
|
||||
charactersIgnoringModifiers:(NSString *)ukeys
|
||||
isARepeat:(BOOL)repeatKey
|
||||
keyCode:(unsigned short)code
|
||||
location:(NSPoint)location
|
||||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(NSGraphicsContext *)context
|
||||
characters:(NSString *)keys
|
||||
charactersIgnoringModifiers:(NSString *)ukeys
|
||||
isARepeat:(BOOL)repeatKey
|
||||
keyCode:(unsigned short)code
|
||||
{
|
||||
NSEvent *e = [[[NSEvent alloc] init] autorelease];
|
||||
// do nothing if
|
||||
|
@ -125,14 +125,14 @@ NSEvent *e = [[[NSEvent alloc] init] autorelease];
|
|||
}
|
||||
|
||||
+ (NSEvent *)mouseEventWithType:(NSEventType)type
|
||||
location:(NSPoint)location
|
||||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(GSContext *)context
|
||||
eventNumber:(int)eventNum
|
||||
clickCount:(int)clickNum
|
||||
pressure:(float)pressureValue
|
||||
location:(NSPoint)location
|
||||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(NSGraphicsContext*)context
|
||||
eventNumber:(int)eventNum
|
||||
clickCount:(int)clickNum
|
||||
pressure:(float)pressureValue
|
||||
{
|
||||
NSEvent *e = [[[NSEvent alloc] init] autorelease]; // do nothing if
|
||||
// event is not of
|
||||
|
@ -156,14 +156,14 @@ NSEvent *e = [[[NSEvent alloc] init] autorelease]; // do nothing if
|
|||
}
|
||||
|
||||
+ (NSEvent *)otherEventWithType:(NSEventType)type
|
||||
location:(NSPoint)location
|
||||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(GSContext *)context
|
||||
subtype:(short)subType
|
||||
data1:(int)data1
|
||||
data2:(int)data2
|
||||
location:(NSPoint)location
|
||||
modifierFlags:(unsigned int)flags
|
||||
timestamp:(NSTimeInterval)time
|
||||
windowNumber:(int)windowNum
|
||||
context:(NSGraphicsContext*)context
|
||||
subtype:(short)subType
|
||||
data1:(int)data1
|
||||
data2:(int)data2
|
||||
{
|
||||
NSEvent *e = [[[NSEvent alloc] init] autorelease];
|
||||
// do nothing if
|
||||
|
@ -284,9 +284,9 @@ NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
|
|||
//
|
||||
// Getting General Event Information
|
||||
//
|
||||
- (GSContext *)context
|
||||
- (NSGraphicsContext*) context
|
||||
{
|
||||
return event_context;
|
||||
return event_context;
|
||||
}
|
||||
|
||||
- (NSPoint)locationInWindow
|
||||
|
|
|
@ -141,12 +141,12 @@ toData:(NSMutableData *)data
|
|||
//
|
||||
// Managing the drawing Context
|
||||
//
|
||||
- (GSContext *)createContext
|
||||
- (NSGraphicsContext*)createContext
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (GSContext *)context
|
||||
- (NSGraphicsContext *)context
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
|
|
@ -33,20 +33,7 @@
|
|||
#include <AppKit/NSScrollView.h>
|
||||
#include <AppKit/NSRulerView.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
|
||||
//
|
||||
// Postscript functions to be defined and implemented by the backend
|
||||
//
|
||||
extern void PSsetlinewidth(float width);
|
||||
extern void PSsetgray(float num);
|
||||
extern void PSmoveto(float x, float y);
|
||||
extern void PSrlineto(float x, float y);
|
||||
extern void PSstroke(void);
|
||||
extern void PSgrestore(void);
|
||||
extern void PSgsave(void);
|
||||
|
||||
|
||||
|
||||
#include <AppKit/PSOperators.h>
|
||||
|
||||
@implementation NSScrollView
|
||||
|
||||
|
|
|
@ -334,4 +334,3 @@ NSString *NSKernAttributeName = @"NSKernAttributeName";
|
|||
/* Drawing engine externs */
|
||||
NSString *NSBackendContext = @"NSBackendContext";
|
||||
|
||||
GSContext *_currentGSContext;
|
||||
|
|
Loading…
Reference in a new issue