Skip to content

Commit dceba7c

Browse files
committed
Incorporated nextspace-theme in libs-gui building process. GlobalDefaults.plist moved into Libraries/gnustep directory.
1 parent af2a542 commit dceba7c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+254
-2
lines changed

Core/os_files/Library/Preferences/GlobalDefaults.plist renamed to Libraries/gnustep/GlobalDefaults.plist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<plist version="0.9">
44
<dict>
55
<key>GSBackend</key>
6-
<string>art</string>
6+
<string>cairo</string>
7+
<key>GSTheme</key>
8+
<string>NextSpace</string>
79
<key>GSWorkspaceApplication</key>
810
<string>Workspace</string>
911
<key>GSCommandKeyString</key>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Requires NextSpace's Cairo backend
2+
# Set by: 'defaults write NSGlobalDomain GSTheme NextSpace'
3+
4+
include $(GNUSTEP_MAKEFILES)/common.make
5+
6+
#GNUSTEP_INSTALLATION_DOMAIN=USER
7+
8+
PACKAGE_NAME = NextSpace
9+
BUNDLE_NAME = NextSpace
10+
BUNDLE_EXTENSION = .theme
11+
VERSION = 0.95
12+
13+
$(BUNDLE_NAME)_INSTALL_DIR=$(GNUSTEP_LIBRARY)/Themes
14+
$(BUNDLE_NAME)_PRINCIPAL_CLASS = NextSpace
15+
16+
$(BUNDLE_NAME)_OBJC_FILES = \
17+
NextSpace.m \
18+
NXTScrollerKnobSlotCell.m
19+
20+
$(BUNDLE_NAME)_RESOURCE_FILES = \
21+
Resources/*.tiff \
22+
Resources/ThemeImages
23+
24+
-include GNUmakefile.preamble
25+
include $(GNUSTEP_MAKEFILES)/bundle.make
26+
-include GNUmakefile.postamble
27+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#import <AppKit/NSButtonCell.h>
2+
3+
@interface NXTScrollerKnobSlotCell : NSButtonCell
4+
{
5+
}
6+
// - (instancetype)initWithBundle:(NSBundle *)themeBundle;
7+
@end
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
#import <AppKit/AppKit.h>
3+
#import <GNUstepGUI/GSTheme.h>
4+
5+
#import "NextSpace.h"
6+
#import "NXTScrollerKnobSlotCell.h"
7+
8+
// static NSImage *knobSlotPattern = nil;
9+
10+
@implementation NXTScrollerKnobSlotCell
11+
12+
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
13+
{
14+
NSGraphicsContext *ctxt;
15+
NextSpace *theme = (NextSpace *)[GSTheme theme];
16+
17+
if (NSIsEmptyRect(cellFrame)) {
18+
return;
19+
}
20+
21+
ctxt = GSCurrentContext();
22+
if ([[ctxt className] isEqualToString:@"CairoContext"]) {
23+
[ctxt GSSetPatterColor:theme.knobSlotPattern];
24+
[ctxt DPSrectfill:cellFrame.origin.x:cellFrame.origin.y:cellFrame.size.width:cellFrame.size.height];
25+
}
26+
}
27+
28+
@end
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#import <AppKit/AppKit.h>
2+
#import <GNUstepGUI/GSTheme.h>
3+
4+
@interface NextSpace : GSTheme
5+
{
6+
}
7+
@property (readonly) NSImage *knobSlotPattern;
8+
@end
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
#import <AppKit/AppKit.h>
2+
3+
#import "NextSpace.h"
4+
#import "NXTScrollerKnobSlotCell.h"
5+
6+
@implementation NextSpace
7+
8+
@synthesize knobSlotPattern;
9+
10+
#pragma mark - Init & dealloc
11+
12+
- (void)dealloc
13+
{
14+
[knobSlotPattern release];
15+
[super dealloc];
16+
}
17+
18+
- (NSImage *)knobSlotPattern
19+
{
20+
if (knobSlotPattern == nil) {
21+
// NSLog(@"%s: Setting knob slot pattern image...", __func__);
22+
NSString *path = [[self bundle] pathForResource:@"SharedGrayAlpha"
23+
ofType:@"tiff"
24+
inDirectory:@"Resources"];
25+
// NSLog(@"SharedGrayAlpha path %@", path);
26+
NSImage *sharedGrayBits = [[NSImage alloc] initWithContentsOfFile:path];
27+
NSImage *pattern = [[NSImage alloc] initWithSize:NSMakeSize(12, 12)];
28+
NSData *tiffRep;
29+
30+
[pattern lockFocusOnRepresentation:nil];
31+
[sharedGrayBits drawAtPoint:NSZeroPoint
32+
fromRect:NSMakeRect(49, 88, 12, 12)
33+
operation:NSCompositeSourceOver
34+
fraction:1.0];
35+
[pattern unlockFocus];
36+
37+
tiffRep = [pattern TIFFRepresentation];
38+
[pattern release];
39+
[sharedGrayBits release];
40+
knobSlotPattern = [[NSImage alloc] initWithData:tiffRep];
41+
42+
// NSLog(@"%s: Setting knob slot pattern image - DONE!", __func__);
43+
}
44+
45+
return knobSlotPattern;
46+
}
47+
48+
#pragma mark - NSScroller
49+
50+
- (NSCell *)cellForScrollerKnobSlot:(BOOL)horizontal
51+
{
52+
NXTScrollerKnobSlotCell *cell;
53+
54+
cell = [NXTScrollerKnobSlotCell new];
55+
[cell setBordered:NO];
56+
[cell setTitle:nil];
57+
58+
return cell;
59+
}
60+
61+
#pragma mark - NSSlider
62+
63+
- (void)drawSliderBorderAndBackground:(NSBorderType)aType
64+
frame:(NSRect)cellFrame
65+
inCell:(NSCell *)cell
66+
isHorizontal:(BOOL)horizontal
67+
{
68+
if (NSIsEmptyRect(cellFrame)) {
69+
return;
70+
}
71+
72+
if (aType == NSBezelBorder) {
73+
[self drawGrayBezel:cellFrame withClip:NSZeroRect];
74+
} else {
75+
[[GSTheme theme] drawBorderType:aType frame:cellFrame view:[cell controlView]];
76+
}
77+
}
78+
79+
- (void)drawBarInside:(NSRect)rect inCell:(NSCell *)cell flipped:(BOOL)flipped
80+
{
81+
if (NSIsEmptyRect(rect)) {
82+
return;
83+
}
84+
85+
NSGraphicsContext *ctxt = GSCurrentContext();
86+
if ([[ctxt className] isEqualToString:@"CairoContext"]) {
87+
[ctxt GSSetPatterColor:self.knobSlotPattern];
88+
[ctxt DPSrectfill:rect.origin.x :rect.origin.y :rect.size.width :rect.size.height];
89+
}
90+
}
91+
92+
// - (void)drawKnobInCell:(NSCell *)cell
93+
// {
94+
// NSLog(@"%s", __func__);
95+
96+
// NSView *controlView = [cell controlView];
97+
// NSSliderCell *sliderCell = (NSSliderCell *)cell;
98+
// NSRect knobRect = [sliderCell knobRectFlipped:[controlView isFlipped]];
99+
100+
// [sliderCell drawKnob:knobRect];
101+
// }
102+
103+
@end
104+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
GSThemeAuthors = (
3+
"Sergii Stoian <stoyan255@gmail.com>"
4+
);
5+
GSThemeDetails = "NEXTSPACE touch ups to GNUstep GUI library.";
6+
GSThemeDomain = {
7+
GSThemeVersion = "0.95";
8+
GSThemeIcon = "NeXT.tiff";
9+
GSThemePreview = "ThemePreview.png";
10+
};
11+
}
1.89 KB
Binary file not shown.
7.58 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)