Remove old grpahics funcs, Update window's defs

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13417 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2002-04-10 22:04:39 +00:00
parent c26e8587c1
commit 6f0771768b
12 changed files with 42 additions and 72 deletions

View file

@ -1,3 +1,19 @@
2002-04-10 Adam Fedor <fedor@gnu.org>
* Headers/gnustep/gui/AppKitExceptions.h: Add GNUstep exception.
* Source/externs.m: Idem.
* Headers/gnustep/gui/DPSOperators.h: Remove currentgstate, gstate
* Headers/gnustep/gui/PSOperators.h: Idem.
* Headers/gnustep/gui/GSMethodTable.h: Idem.
* Headers/gnustep/gui/NSGraphicsContext.h: Idem.
* Source/NSGraphicsContext.m: Idem. Redefine subclassResponsibility
to through our own exception.
* Headers/gnustep/gui/GSDisplayServer.h: Prefix functions with
APPKIT_DECLARE. Fix windowbacking def.
* Source/libgnustep-gui.def: Add GSDisplayServer.
Tue Apr 9 23:04:43 2002 Nicola Pero <n.pero@mi.flashnet.it> Tue Apr 9 23:04:43 2002 Nicola Pero <n.pero@mi.flashnet.it>
* Source/GSTable.m ([-setFrame:], [-setFrameSize:]): New methods. * Source/GSTable.m ([-setFrame:], [-setFrameSize:]): New methods.

View file

@ -66,4 +66,8 @@ APPKIT_EXPORT NSString *NSWindowServerCommunicationException;
APPKIT_EXPORT NSString *NSWordTablesReadException; APPKIT_EXPORT NSString *NSWordTablesReadException;
APPKIT_EXPORT NSString *NSWordTablesWriteException; APPKIT_EXPORT NSString *NSWordTablesWriteException;
#ifndef NO_GNUSTEP
APPKIT_EXPORT NSString *GSWindowServerInternalException;
#endif
#endif /* __AppKit_AppKitExceptions_h__ */ #endif /* __AppKit_AppKitExceptions_h__ */

View file

@ -169,10 +169,6 @@ __attribute__((unused));
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* Gstate Handling */ /* Gstate Handling */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static inline void
DPScurrentgstate(GSCTXT *ctxt, int gst)
__attribute__((unused));
static inline void static inline void
DPSgrestore(GSCTXT *ctxt) DPSgrestore(GSCTXT *ctxt)
__attribute__((unused)); __attribute__((unused));
@ -181,10 +177,6 @@ static inline void
DPSgsave(GSCTXT *ctxt) DPSgsave(GSCTXT *ctxt)
__attribute__((unused)); __attribute__((unused));
static inline void
DPSgstate(GSCTXT *ctxt)
__attribute__((unused));
static inline void static inline void
DPSinitgraphics(GSCTXT *ctxt) DPSinitgraphics(GSCTXT *ctxt)
__attribute__((unused)); __attribute__((unused));
@ -704,13 +696,6 @@ GSShowGlyphs(GSCTXT *ctxt, const NSGlyph * glyphs, size_t length)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* Gstate Handling */ /* Gstate Handling */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static inline void
DPScurrentgstate(GSCTXT *ctxt, int gst)
{
(ctxt->methods->DPScurrentgstate_)
(ctxt, @selector(DPScurrentgstate:), gst);
}
static inline void static inline void
DPSgrestore(GSCTXT *ctxt) DPSgrestore(GSCTXT *ctxt)
{ {
@ -725,13 +710,6 @@ DPSgsave(GSCTXT *ctxt)
(ctxt, @selector(DPSgsave)); (ctxt, @selector(DPSgsave));
} }
static inline void
DPSgstate(GSCTXT *ctxt)
{
(ctxt->methods->DPSgstate)
(ctxt, @selector(DPSgstate));
}
static inline void static inline void
DPSinitgraphics(GSCTXT *ctxt) DPSinitgraphics(GSCTXT *ctxt)
{ {

View file

@ -45,8 +45,8 @@
@class GSDisplayServer; @class GSDisplayServer;
#ifndef NO_GNUSTEP #ifndef NO_GNUSTEP
GSDisplayServer * GSServerForWindow(NSWindow *window); APPKIT_DECLARE GSDisplayServer * GSServerForWindow(NSWindow *window);
GSDisplayServer * GSCurrentServer(void); APPKIT_DECLARE GSDisplayServer * GSCurrentServer(void);
@interface GSDisplayServer : NSObject @interface GSDisplayServer : NSObject
{ {
@ -92,7 +92,7 @@ GSDisplayServer * GSCurrentServer(void);
- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style; - (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style;
- (void) termwindow: (int) win; - (void) termwindow: (int) win;
- (void) stylewindow: (int) style : (int) win; - (void) stylewindow: (int) style : (int) win;
- (void) windowbacking: (NSBackingStoreType)type; - (void) windowbacking: (NSBackingStoreType)type : (int) win;
- (void) titlewindow: (NSString *) window_title : (int) win; - (void) titlewindow: (NSString *) window_title : (int) win;
- (void) miniwindow: (int) win; - (void) miniwindow: (int) win;
- (BOOL) appOwnsMiniwindow; - (BOOL) appOwnsMiniwindow;

View file

@ -115,14 +115,10 @@ typedef struct {
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* Gstate Handling */ /* Gstate Handling */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
void (*DPScurrentgstate_)
(NSGraphicsContext*, SEL, int);
void (*DPSgrestore) void (*DPSgrestore)
(NSGraphicsContext*, SEL); (NSGraphicsContext*, SEL);
void (*DPSgsave) void (*DPSgsave)
(NSGraphicsContext*, SEL); (NSGraphicsContext*, SEL);
void (*DPSgstate)
(NSGraphicsContext*, SEL);
void (*DPSinitgraphics) void (*DPSinitgraphics)
(NSGraphicsContext*, SEL); (NSGraphicsContext*, SEL);
void (*DPSsetgstate_) void (*DPSsetgstate_)

View file

@ -259,10 +259,8 @@ APPKIT_DECLARE NSGraphicsContext *GSCurrentContext();
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* Gstate Handling */ /* Gstate Handling */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
- (void) DPScurrentgstate: (int)gst;
- (void) DPSgrestore; - (void) DPSgrestore;
- (void) DPSgsave; - (void) DPSgsave;
- (void) DPSgstate;
- (void) DPSinitgraphics; - (void) DPSinitgraphics;
- (void) DPSsetgstate: (int)gst; - (void) DPSsetgstate: (int)gst;

View file

@ -117,10 +117,6 @@ __attribute__((unused));
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* Gstate Handling */ /* Gstate Handling */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static inline void
PScurrentgstate(int gst)
__attribute__((unused));
static inline void static inline void
PSgrestore() PSgrestore()
__attribute__((unused)); __attribute__((unused));
@ -129,10 +125,6 @@ static inline void
PSgsave() PSgsave()
__attribute__((unused)); __attribute__((unused));
static inline void
PSgstate()
__attribute__((unused));
static inline void static inline void
PSinitgraphics() PSinitgraphics()
__attribute__((unused)); __attribute__((unused));
@ -499,18 +491,6 @@ PSyshow(const char* s, const float* numarray, int size)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* Gstate Handling */ /* Gstate Handling */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static inline void
PScurrentgstate(int gst)
{
DPScurrentgstate(DEFCTXT, gst);
}
static inline void
PSgrestore()
{
DPSgrestore(DEFCTXT);
}
static inline void static inline void
PSgsave() PSgsave()
{ {
@ -518,9 +498,9 @@ PSgsave()
} }
static inline void static inline void
PSgstate() PSgrestore()
{ {
DPSgstate(DEFCTXT); DPSgrestore(DEFCTXT);
} }
static inline void static inline void

View file

@ -444,7 +444,7 @@ GSCurrentServer(void)
} }
/** Changes window's the backing store to type */ /** Changes window's the backing store to type */
- (void) windowbacking: (NSBackingStoreType)type - (void) windowbacking: (NSBackingStoreType)type : (int) win
{ {
[self subclassResponsibility: _cmd]; [self subclassResponsibility: _cmd];
} }

View file

@ -104,7 +104,8 @@ _NSAppKitUncaughtExceptionHandler (NSException *exception)
* its a sever error, use a non-graphical exception handler * its a sever error, use a non-graphical exception handler
*/ */
if (GSCurrentContext() == nil if (GSCurrentContext() == nil
|| [[exception name] isEqual: NSWindowServerCommunicationException]) || [[exception name] isEqual: NSWindowServerCommunicationException]
|| [[exception name] isEqual: GSWindowServerInternalException])
{ {
/* The following will raise again the exception using the base /* The following will raise again the exception using the base
library exception handler */ library exception handler */

View file

@ -39,6 +39,7 @@
#include <Foundation/NSSet.h> #include <Foundation/NSSet.h>
#include <Foundation/NSThread.h> #include <Foundation/NSThread.h>
#include <Foundation/NSZone.h> #include <Foundation/NSZone.h>
#include "AppKit/AppKitExceptions.h"
#include "AppKit/NSGraphicsContext.h" #include "AppKit/NSGraphicsContext.h"
#include "AppKit/NSAffineTransform.h" #include "AppKit/NSAffineTransform.h"
#include "AppKit/NSWindow.h" #include "AppKit/NSWindow.h"
@ -463,14 +464,10 @@ NSGraphicsContext *GSCurrentContext()
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* Gstate Handling */ /* Gstate Handling */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
methodTable.DPScurrentgstate_ =
GET_IMP(@selector(DPScurrentgstate:));
methodTable.DPSgrestore = methodTable.DPSgrestore =
GET_IMP(@selector(DPSgrestore)); GET_IMP(@selector(DPSgrestore));
methodTable.DPSgsave = methodTable.DPSgsave =
GET_IMP(@selector(DPSgsave)); GET_IMP(@selector(DPSgsave));
methodTable.DPSgstate =
GET_IMP(@selector(DPSgstate));
methodTable.DPSinitgraphics = methodTable.DPSinitgraphics =
GET_IMP(@selector(DPSinitgraphics)); GET_IMP(@selector(DPSinitgraphics));
methodTable.DPSsetgstate_ = methodTable.DPSsetgstate_ =
@ -654,6 +651,16 @@ NSGraphicsContext *GSCurrentContext()
return mptr; return mptr;
} }
- (id) subclassResponsibility: (SEL)aSel
{
[NSException raise: GSWindowServerInternalException
format: @"subclass %s(%s) should override %s",
object_get_class_name(self),
GSObjCIsInstance(self) ? "instance" : "class",
sel_get_name(aSel)];
return nil;
}
@end @end
@ -876,12 +883,6 @@ NSGraphicsContext *GSCurrentContext()
/* Gstate Handling */ /* Gstate Handling */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/** Depcreciated. Same as -GSReplaceGState: */
- (void) DPScurrentgstate: (int)gst
{
[self subclassResponsibility: _cmd];
}
/** Pops a previously saved gstate from the gstate stack and makes it /** Pops a previously saved gstate from the gstate stack and makes it
current. Drawing information in the previously saved gstate current. Drawing information in the previously saved gstate
becomes the current information */ becomes the current information */
@ -898,13 +899,6 @@ NSGraphicsContext *GSCurrentContext()
[self subclassResponsibility: _cmd]; [self subclassResponsibility: _cmd];
} }
/** Depreciated. Use -DPSDefineGState to create a gstate it and tag it
with a id tag. */
- (void) DPSgstate
{
[self subclassResponsibility: _cmd];
}
- (void) DPSinitgraphics - (void) DPSinitgraphics
{ {
[self subclassResponsibility: _cmd]; [self subclassResponsibility: _cmd];

View file

@ -73,6 +73,8 @@ NSString *NSWindowServerCommunicationException = @"WindowServerCommunication";
NSString *NSWordTablesReadException = @"WordTablesRead"; NSString *NSWordTablesReadException = @"WordTablesRead";
NSString *NSWordTablesWriteException = @"WordTablesWrite"; NSString *NSWordTablesWriteException = @"WordTablesWrite";
NSString *GSWindowServerInternalException = @"WindowServerInternal";
// Application notifications // Application notifications
NSString *NSApplicationDidBecomeActiveNotification NSString *NSApplicationDidBecomeActiveNotification
= @"ApplicationDidBecomeActive"; = @"ApplicationDidBecomeActive";

View file

@ -31,6 +31,7 @@
LIBRARY libgnustep-gui LIBRARY libgnustep-gui
EXPORTS EXPORTS
__objc_class_name_GSComboWindow __objc_class_name_GSComboWindow
__objc_class_name_GSDisplayServer
__objc_class_name_GSFontEnumerator __objc_class_name_GSFontEnumerator
__objc_class_name_GSFontInfo __objc_class_name_GSFontInfo
__objc_class_name_GSHbox __objc_class_name_GSHbox