mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 12:11:54 +00:00
Correct issue I introduced last night. Continue moving print panel/layout panel implementation to theme instead of print bundle.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38321 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
73d58eadf5
commit
badcd084e1
4 changed files with 45 additions and 21 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2015-02-02 11:59-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
|
* Source/GSThemePrintPanels.m: Add default subclass implementation
|
||||||
|
so that the panels can be instantiated.
|
||||||
|
* Source/NSPageLayout.m: Change the allocWithZone: method to
|
||||||
|
return the class indicated by the theme.
|
||||||
|
* Source/NSPrintPanel.m: Change the allocWithZone: method to
|
||||||
|
return the class indicated by the theme.
|
||||||
|
|
||||||
2015-02-01 Gregory Casamento <greg.casamento@gmail.com>
|
2015-02-01 Gregory Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
* Source/GSPrinting.m: Add call to GSTheme code to get the
|
* Source/GSPrinting.m: Add call to GSTheme code to get the
|
||||||
|
|
|
@ -30,6 +30,31 @@
|
||||||
#import "AppKit/NSPageLayout.h"
|
#import "AppKit/NSPageLayout.h"
|
||||||
#import "GNUstepGUI/GSTheme.h"
|
#import "GNUstepGUI/GSTheme.h"
|
||||||
|
|
||||||
|
@interface GSPrintPanel : NSPrintPanel
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface GSPageLayout : NSPageLayout
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation GSPrintPanel
|
||||||
|
|
||||||
|
+ (id) allocWithZone: (NSZone*)zone
|
||||||
|
{
|
||||||
|
return NSAllocateObject(self, 0, zone);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation GSPageLayout
|
||||||
|
|
||||||
|
+ (id) allocWithZone: (NSZone*)zone
|
||||||
|
{
|
||||||
|
return NSAllocateObject(self, 0, zone);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
@implementation GSTheme (PrintPanels)
|
@implementation GSTheme (PrintPanels)
|
||||||
/**
|
/**
|
||||||
* This method returns the print panel class needed by the
|
* This method returns the print panel class needed by the
|
||||||
|
@ -37,7 +62,7 @@
|
||||||
*/
|
*/
|
||||||
- (Class) printPanelClass
|
- (Class) printPanelClass
|
||||||
{
|
{
|
||||||
return [NSPrintPanel class];
|
return [GSPrintPanel class];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,7 +71,7 @@
|
||||||
*/
|
*/
|
||||||
- (Class) pageLayoutClass
|
- (Class) pageLayoutClass
|
||||||
{
|
{
|
||||||
return [NSPageLayout class];
|
return [GSPageLayout class];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
#import "AppKit/NSPrinter.h"
|
#import "AppKit/NSPrinter.h"
|
||||||
#import "GSGuiPrivate.h"
|
#import "GSGuiPrivate.h"
|
||||||
#import "GNUstepGUI/GSPrinting.h"
|
#import "GNUstepGUI/GSPrinting.h"
|
||||||
|
#import "GNUstepGUI/GSTheme.h"
|
||||||
|
|
||||||
static NSPageLayout *shared_instance;
|
static NSPageLayout *shared_instance;
|
||||||
|
|
||||||
|
@ -139,6 +140,7 @@ enum {
|
||||||
NSPrintInfo *_printInfo;
|
NSPrintInfo *_printInfo;
|
||||||
NSView *_accessoryView;
|
NSView *_accessoryView;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(NSPageLayout*) panel;
|
-(NSPageLayout*) panel;
|
||||||
|
|
||||||
//IBActions
|
//IBActions
|
||||||
|
@ -229,21 +231,14 @@ enum {
|
||||||
// Class methods
|
// Class methods
|
||||||
//
|
//
|
||||||
/** Load the appropriate bundle for the PageLayout
|
/** Load the appropriate bundle for the PageLayout
|
||||||
(eg: GSLPRPageLayout, GSCUPSPageLayout).
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
+ (id) allocWithZone: (NSZone*) zone
|
+ (id) allocWithZone: (NSZone*) zone
|
||||||
{
|
{
|
||||||
Class principalClass;
|
Class cls = [[GSTheme theme] pageLayoutClass];
|
||||||
|
return [cls allocWithZone: zone];
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
|
||||||
|
|
||||||
if (principalClass == nil)
|
|
||||||
return nil;
|
|
||||||
|
|
||||||
return [[principalClass pageLayoutClass] allocWithZone: zone];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Creates ( if needed ) and returns a shared instance of the
|
/** Creates ( if needed ) and returns a shared instance of the
|
||||||
NSPageLayout panel.
|
NSPageLayout panel.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
#import "AppKit/NSView.h"
|
#import "AppKit/NSView.h"
|
||||||
#import "GSGuiPrivate.h"
|
#import "GSGuiPrivate.h"
|
||||||
#import "GNUstepGUI/GSPrinting.h"
|
#import "GNUstepGUI/GSPrinting.h"
|
||||||
|
#import "GNUstepGUI/GSTheme.h"
|
||||||
|
|
||||||
static NSPrintPanel *shared_instance = nil;
|
static NSPrintPanel *shared_instance = nil;
|
||||||
|
|
||||||
|
@ -85,18 +86,12 @@ static NSPrintPanel *shared_instance = nil;
|
||||||
//
|
//
|
||||||
/** Load the appropriate bundle for the PrintPanel
|
/** Load the appropriate bundle for the PrintPanel
|
||||||
and alloc the class from that in our place
|
and alloc the class from that in our place
|
||||||
(eg: GSLPRPrintPanel, GSCUPSPrintPanel).
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
+ (id) allocWithZone: (NSZone*) zone
|
+ (id) allocWithZone: (NSZone*) zone
|
||||||
{
|
{
|
||||||
Class principalClass;
|
Class cls = [[GSTheme theme] printPanelClass];
|
||||||
|
return [cls allocWithZone: zone];
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
|
||||||
|
|
||||||
if (principalClass == nil)
|
|
||||||
return nil;
|
|
||||||
|
|
||||||
return [[principalClass printPanelClass] allocWithZone: zone];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates ( if needed) and returns a shared instance of the
|
/** Creates ( if needed) and returns a shared instance of the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue