Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
eeb32e7
ProcessManager (_terminateApplication): cleanup
trunkmaster Oct 10, 2023
019fb5c
add missed Controller changes.
trunkmaster Oct 10, 2023
23f4952
implemented -launchedApplications that called by NSWorkspace.
trunkmaster Oct 10, 2023
b0021db
xcompmgr added as wmcomposer.c for future composer implementation use.
trunkmaster Oct 10, 2023
c670f33
Merge pull request #2 from trunkmaster/master
MagnetarRocket Oct 12, 2023
2eb341c
compositor added to the build process.
trunkmaster Oct 12, 2023
e046067
added necessary dependecies to adopt compositor addition.
trunkmaster Oct 12, 2023
47b7012
forward errors to Composer error handler. Handler returns True if error
trunkmaster Oct 12, 2023
6f088d7
start Composer in separated thread before Window Manager.
trunkmaster Oct 12, 2023
db5237c
cleanup in log messages.
trunkmaster Oct 12, 2023
b0d1722
add missed header file and various code cleanup in composer
trunkmaster Oct 12, 2023
e382e59
fixed background color setting with composer.
trunkmaster Oct 13, 2023
718863b
set root window background pixmap with _ROOTPMAP_ID property name to
trunkmaster Oct 15, 2023
a0c7c50
use OSEScreen method to set root window background.
trunkmaster Oct 15, 2023
35e88e8
start composer after WM initialization but before WM runloop.
trunkmaster Oct 15, 2023
f09bb3f
removed unused code and made cleanup.
trunkmaster Oct 15, 2023
a378e9d
compile_flags added to applications
trunkmaster Oct 16, 2023
fe4fb8e
compile_flags added to the missed Weather
trunkmaster Oct 16, 2023
843d410
adopt background pixmap resource manipulation to be used by Login
trunkmaster Oct 16, 2023
9a7922b
wmcomposer: renamed Xlib variables to underscore format
trunkmaster Oct 16, 2023
808f9f3
fixed var name after rename.
trunkmaster Oct 16, 2023
7b88f17
fix local variable name
trunkmaster Oct 17, 2023
0612ca6
don't send CF notification for GNUstep app
trunkmaster Oct 17, 2023
40091a0
don't create launching icon for buggy applications without icons
trunkmaster Oct 17, 2023
22176d3
handle case with application without NSIcon specified.
trunkmaster Oct 17, 2023
f733e15
rename _workspaceCenter to _windowManagerCenter to omit confusion with
trunkmaster Oct 17, 2023
b51b8ae
start Composer only if enabled in Workspace defaults.
trunkmaster Oct 17, 2023
21aa39a
name internal compositor as "Workspace Composer" to indicate it's sou…
trunkmaster Oct 17, 2023
c332d24
enable "superfluous" by default - many basic features check if it's
trunkmaster Oct 17, 2023
e771415
Merge remote-tracking branch 'refs/remotes/origin/master'
trunkmaster Oct 17, 2023
67c9bb5
make main application menu window type to _NET_WM_WINDOW_TYPE_TOOLBAR.
trunkmaster Oct 17, 2023
028b3db
EWMH window type names were added to comments as a references between
trunkmaster Oct 17, 2023
d2ccbf1
fixed window level of Recycler icon.
trunkmaster Oct 18, 2023
1152f51
set to dock_shadow Dock window level.
trunkmaster Oct 18, 2023
5179a0c
removed automatically inserted include
trunkmaster Oct 18, 2023
5f273d9
fixed font name in controls.
trunkmaster Oct 19, 2023
108194f
removed debug output.
trunkmaster Oct 20, 2023
2579f84
initial implementation of performFileOperation:source:destination:fil…
trunkmaster Oct 20, 2023
7006850
wmcomposer: change shadow defaults.
trunkmaster Oct 20, 2023
4ea9279
use default TrueType interpreter on platform.
trunkmaster Oct 23, 2023
0ce5599
Prefernces-Font: show example text exactly for selected font.
trunkmaster Oct 23, 2023
c47a6cd
Preferences-Font: fixed size and name of WM fonts.
trunkmaster Oct 23, 2023
fa6b0f5
Preferences: show window if app is not autolaunched.
trunkmaster Oct 23, 2023
18bd704
Preferences: show window when becomes active (for example after
trunkmaster Oct 23, 2023
473c8e0
initial effort to rebirth of the WM.plist defaults file.
trunkmaster Oct 24, 2023
ae63d16
Preferences-Font: send notification with object "GSWorkspaceNotificat…
trunkmaster Oct 24, 2023
ef0ee64
return of WM preferences changs (WM.plist) tracking - font changes in
trunkmaster Oct 25, 2023
e5592bf
Workspace: when reading preferences file create a copy of CFDictionary;
trunkmaster Oct 25, 2023
33392b9
fixed initializing and tracking changes of WM defaults. Disabled trac…
trunkmaster Oct 26, 2023
1d5eaf4
DosktopKit: create NXTWorkspace to hold notification names complementary
trunkmaster Oct 27, 2023
9cc7879
add copyright to a new files.
trunkmaster Oct 27, 2023
4791c5e
initial implementation of "Hide Others" was added.
trunkmaster Oct 27, 2023
36d17c9
cleanup
trunkmaster Oct 30, 2023
172b79d
WM: add "UseAntialiasedText" setting.
trunkmaster Oct 30, 2023
f0ab682
remove old or commented code
trunkmaster Oct 30, 2023
fb5fcc8
Preferences: use newly added WM's antialising option.
trunkmaster Oct 30, 2023
3b916ec
add new options to clang-format.
trunkmaster Oct 30, 2023
07a1087
remved debug output
trunkmaster Oct 30, 2023
352372c
remove warning as TODO was done.
trunkmaster Oct 30, 2023
f102e31
add local compile flags for C part of Workspace to omit clangd warnings.
trunkmaster Oct 31, 2023
2ed25ec
removed extra code
trunkmaster Oct 31, 2023
5206d23
performFileOperation:source:destination:files:tag: implementation com…
trunkmaster Oct 31, 2023
29dcda3
use file operation types (strings) defined in AppKit/NSWorkspace.h.
trunkmaster Oct 31, 2023
2610e2d
enabled code for -fileSystemChanged and -noteFileSystemChanged methods.
trunkmaster Oct 31, 2023
9d89ca9
Workspace: do not try to connect to X11 application after launch.
trunkmaster Oct 31, 2023
44633e3
Workspace: first experiments with "Hide Others" feature.
trunkmaster Oct 31, 2023
c0febb4
trying to make "Hide Others" working for Workspace
trunkmaster Nov 1, 2023
549701e
WM/application: wApplicationActivate(): remember focused window and a…
trunkmaster Nov 1, 2023
8249934
Merge pull request #3 from trunkmaster/master
MagnetarRocket Nov 8, 2023
5bfe64a
Add in bit that the fabled OpenStep PR1 won't be emulated.
MagnetarRocket Mar 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
BasedOnStyle: Google
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBraces: Custom
BraceWrapping:
Expand All @@ -22,3 +24,8 @@ AllowAllArgumentsOnNextLine: false
PointerAlignment: Right
ColumnLimit: 100
SortIncludes: Never
PointerAlignment: Right
AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
AlignTrailingComments: true
AlignEscapedNewlines: Left
AlignOperands: Align
8 changes: 5 additions & 3 deletions Applications/Login/Controller.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
//

#import "Controller.h"
#include "Foundation/NSObjCRuntime.h"
#import "UserSession.h"

#import <unistd.h>
Expand All @@ -31,6 +32,7 @@
#endif

#import <SystemKit/OSEDisplay.h>
#import <SystemKit/OSEScreen.h>
#import <SystemKit/OSEMouse.h>
#import <DesktopKit/NXTAlert.h>

Expand Down Expand Up @@ -169,9 +171,9 @@ - (void)setRootWindowBackground
winattrs.cursor = XCreateFontCursor(xDisplay, XC_left_ptr);
XChangeWindowAttributes(xDisplay, xRootWindow, CWCursor, &winattrs);

XSetWindowBackground(xDisplay, xRootWindow, 5460853L);
XClearWindow(xDisplay, xRootWindow);
XSync(xDisplay, false);
[[OSEScreen sharedScreen] setBackgroundColorRed:83.0 / 255.0
green:83.0 / 255.0
blue:116.0 / 255.0];
}

- (void)setWindowVisible:(BOOL)flag
Expand Down
2 changes: 1 addition & 1 deletion Applications/Login/Login_main.m
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ int main(int argc, const char **argv)
// do window decorations ourselves
[[NSUserDefaults standardUserDefaults] setBool:NO
forKey:@"GSX11HandlesWindowDecorations"];
setenv("FREETYPE_PROPERTIES", "truetype:interpreter-version=35", 1);
// setenv("FREETYPE_PROPERTIES", "truetype:interpreter-version=35", 1);
// Start our application without appicon
[LoginApplication sharedApplication];
NSApplicationMain(argc, argv);
Expand Down
2 changes: 1 addition & 1 deletion Applications/Login/UserSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ - (BOOL)_setUserEnvironment
setenv("GNUSTEP_PATHLIST", [[NSString stringWithFormat:@"%s:/:/usr/NextSpace:/Network", user->pw_dir] cString], 1);

setenv("INFOPATH", [[NSString stringWithFormat:@"%s/Library/Documentation/info:/Library/Documentation/info:/usr/NextSpace/Documentation/info", user->pw_dir] cString], 1);
setenv("FREETYPE_PROPERTIES", "truetype:interpreter-version=35", 1);
// setenv("FREETYPE_PROPERTIES", "truetype:interpreter-version=35", 1);

// For developers
setenv("GNUSTEP_MAKEFILES", "/Developer/Makefiles", 1);
Expand Down
1 change: 1 addition & 0 deletions Applications/Login/compile_flags.txt
1 change: 1 addition & 0 deletions Applications/OpenUp/compile_flags.txt
3 changes: 3 additions & 0 deletions Applications/Preferences/AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotif
if ([screen savedBackgroundColorRed:&red green:&green blue:&blue] == YES) {
[screen setBackgroundColorRed:red green:green blue:blue];
}
} else {
[self showPreferencesWindow];
}
}

Expand All @@ -111,6 +113,7 @@ - (void)applicationWillTerminate:(NSNotification *)aNotif

- (void)applicationDidBecomeActive:(NSNotification*)aNotification
{
[self showPreferencesWindow];
}

- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName
Expand Down
2 changes: 0 additions & 2 deletions Applications/Preferences/Modules/Font/Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@

NSImage *image;
NSString *exampleString;
NSString *normalExampleString;
NSString *boldExampleString;
}

- (IBAction)fontCategoryChanged:(id)sender;
Expand Down
143 changes: 66 additions & 77 deletions Applications/Preferences/Modules/Font/Font.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#import <AppKit/NSApplication.h>
#import <AppKit/NSAttributedString.h>

#import <DesktopKit/NXTWorkspace.h>

#import "Font.h"

@interface Font (Private)
Expand All @@ -50,24 +52,24 @@ - (void) updateUI;

@implementation Font (Private)

static NSBundle *bundle = nil;
static NSUserDefaults *defaults = nil;
static NSBundle *bundle = nil;
static NSUserDefaults *defaults = nil;
static NSMutableDictionary *domain = nil;
static NSPanel *fontPanel = nil;
static NSPanel *fontPanel = nil;

// + userFontOfSize: [Application Font] <NSUserFont>
// + userFontOfSize: [Application Font] <NSUserFont>
// + userFixedPitchFontOfSize: [Fixed Pitch Font] <NSUserFixedPitchFont>
// + systemFontOfSize: [System Font] <NSFont>
// + boldSystemFontOfSize: [Bold System Font] <NSBoldFont>
// + systemFontOfSize: [System Font] <NSFont>
// + boldSystemFontOfSize: [Bold System Font] <NSBoldFont>
// ========================== MACOSX, GS_API_LATEST ===========================
// + toolTipsFontOfSize: [System Font:11] <NSToolTipsFont>
// + menuFontOfSize: [System Font] <NSMenuFont>
// + messageFontOfSize: [System Font:14] <NSMessageFont>
// + controlContentFontOfSize: [System Font] <NSControlContentFont>
// + labelFontOfSize: [System Font] <NSLabelFont>
// + titleBarFontOfSize: [Bold System Font] <NSTitleBarFont>
// + menuBarFontOfSize: [Bold System Font] <NSMenuBarFont>
// + paletteFontOfSize: [Bold System Font] <NSPaletteFont>
// + toolTipsFontOfSize: [System Font:11] <NSToolTipsFont>
// + menuFontOfSize: [System Font] <NSMenuFont>
// + messageFontOfSize: [System Font:14] <NSMessageFont>
// + controlContentFontOfSize: [System Font] <NSControlContentFont>
// + labelFontOfSize: [System Font] <NSLabelFont>
// + titleBarFontOfSize: [Bold System Font] <NSTitleBarFont>
// + menuBarFontOfSize: [Bold System Font] <NSMenuBarFont>
// + paletteFontOfSize: [Bold System Font] <NSPaletteFont>
// ========================== MACOSX, GS_API_LATEST ===========================

static NSMutableDictionary *defaultValues(void)
Expand Down Expand Up @@ -186,45 +188,46 @@ static void setIntDefault(int anInt, NSString *name)
userDefPath = [NSString stringWithFormat:@"%@/.NextSpace/WM.plist",
GSDefaultsRootForUser(NSUserName())];

if (![[NSFileManager defaultManager] fileExistsAtPath:userDefPath]) {
userDefPath = nil;
}
// if (![[NSFileManager defaultManager] fileExistsAtPath:userDefPath]) {
// userDefPath = nil;
// }

return userDefPath;
}

- (void)setWMFont:(NSFont *)font key:(NSString *)key
- (void)setWMPreference:(NSString *)value forKey:(NSString *)key
{
NSString *wmDefaultsPath = WWMDefaultsPath();
NSString *wmDefaultsPath = WWMDefaultsPath();
NSMutableDictionary *wmDefaults;
NSMutableString *value;

if (![[NSFileManager defaultManager] fileExistsAtPath:wmDefaultsPath]) {
/* TODO: WM doesn't track WM.plist changes if it doesn't exist.
We need to send WMDidChangeWindowAppearanceSettings to the distributed
notification center (WM should handle this notification and reread file). */
NSLog(@"[Font] can't find existing WM defaults database! Creating new...");
wmDefaults = [NSMutableDictionary new];
}
else {
} else {
wmDefaults = [[NSMutableDictionary alloc] initWithContentsOfFile:wmDefaultsPath];
}

// Convert font name into the FontConfig format.
value = [NSMutableString stringWithFormat:@"%@:postscriptname=%@:pixelsize=%.0f:antialias=false",
[font familyName], [font fontName], [font pointSize]];
NSLog(@"[Font] set WM font %@ = `%@`", key, value);

[wmDefaults setObject:value forKey:key];
[wmDefaults writeToFile:wmDefaultsPath atomically:YES];
[wmDefaults release];
}

- (void)setWMFont:(NSFont *)font forKey:(NSString *)key
{
NSMutableString *value;

// Convert font name into the FontConfig format.
value = [NSMutableString stringWithFormat:@"%@:postscriptname=%@:pixelsize=%.0f:antialias=%@",
[font familyName], [font fontName], [font pointSize],
[enableAntiAliasingButton state] ? @"true" : @"false"];
[self setWMPreference:value forKey:key];
}

- (void)updateUI
{
NSString *fontKey;
NSString *fontSizeKey;
NSFont *font, *boldFont;
NSFont *font;

fontKey = [fontCategories
objectForKey:[fontCategoryPopUp titleOfSelectedItem]];
Expand All @@ -238,21 +241,13 @@ - (void)updateUI
fontSizeKey = [NSString stringWithFormat:@"%@Size", fontKey];
font = [NSFont fontWithName:getStringDefault(domain, fontKey)
size:getFloatDefault(domain, fontSizeKey)];
boldFont = [[NSFontManager sharedFontManager] convertFont:font
toHaveTrait:NSBoldFontMask];

//
[fontNameTextField setFont:font];
[fontNameTextField setStringValue:[NSString stringWithFormat: @"%@ %g point",
[font displayName],
[font pointSize]]];

//
[fontExampleTextView setFont:font];
[fontExampleTextView setFont:boldFont
range:NSMakeRange([normalExampleString length],
[boldExampleString length]+1)];

//
[enableAntiAliasingButton setIntValue:getBoolDefault(domain, @"GSFontAntiAlias")];

Expand Down Expand Up @@ -293,10 +288,10 @@ - (void)dealloc
[image release];
[fontCategories dealloc];

if (view) {
[normalExampleString release];
[boldExampleString release];
}
// if (view) {
// [normalExampleString release];
// [boldExampleString release];
// }

[super dealloc];
}
Expand Down Expand Up @@ -336,16 +331,7 @@ - (void)awakeFromNib
exampleString = NSLocalizedStringFromTableInBundle(@"Example Text",
@"Localizable",
bundle, @"");
normalExampleString = [[NSString alloc] initWithFormat:@"Normal:\n%@",
exampleString];
boldExampleString = [[NSString alloc] initWithFormat:@"Bold:\n%@",
exampleString];

[fontExampleTextView setText:[NSString stringWithFormat:@"%@\n%@",
normalExampleString,
boldExampleString]];
// [fontExampleTextView
// readRTFDFromFile:[bundle pathForResource:@"ExampleText" ofType:@"rtf"]];
[fontExampleTextView setText:exampleString];

[self updateUI];
}
Expand Down Expand Up @@ -392,8 +378,12 @@ - (IBAction)setFont:(id)sender

- (IBAction)enableAntiAliasingChanged:(id)sender
{
// GS
setBoolDefault([sender intValue], @"GSFontAntiAlias");
setIntDefault(0, @"back-art-subpixel-text");

// WM
[self setWMPreference:([sender intValue] ? @"YES" : @"NO") forKey:@"UseAntialiasedText"];

[self updateUI];
}
Expand All @@ -402,28 +392,25 @@ - (IBAction)enableAntiAliasingChanged:(id)sender

- (void)changeFont:(id)sender
{
NSString *fontName, *fontKey;
CGFloat fontSize;
NSString *fontName, *fontKey;
CGFloat fontSize;
NSFontManager *fontManager = [NSFontManager sharedFontManager];
NSFont *font;
NSFont *font;

font = [fontManager convertFont:[fontExampleTextView font]];
fontName = [font fontName];
fontSize = [font pointSize];
fontKey = [fontCategories
objectForKey:[fontCategoryPopUp titleOfSelectedItem]];
fontKey = [fontCategories objectForKey:[fontCategoryPopUp titleOfSelectedItem]];

if ([fontKey isEqualToString:@"NSUserFont"]) { // Application
if ([fontKey isEqualToString:@"NSUserFont"]) { // Application
// NSUserFont, NSUserFontSize=12
setStringDefault(fontName, @"NSUserFont");
setFloatDefault(fontSize, @"NSUserFontSize");
}
else if ([fontKey isEqualToString:@"NSUserFixedPitchFont"]) {// Fixed Pitch
} else if ([fontKey isEqualToString:@"NSUserFixedPitchFont"]) { // Fixed Pitch
// NSUserFixedPitchFont, NSUserFixedPitchFontSize
setStringDefault(fontName, @"NSUserFixedPitchFont");
setFloatDefault(fontSize, @"NSUserFixedPitchFontSize");
}
else if ([fontKey isEqualToString:@"NSFont"]) { // System
} else if ([fontKey isEqualToString:@"NSFont"]) { // System
// NSFont, NSFontSize=12
setStringDefault(fontName, @"NSFont");
setFloatDefault(fontSize, @"NSFontSize");
Expand All @@ -440,16 +427,16 @@ - (void)changeFont:(id)sender
setStringDefault(fontName, @"NSLabelFont");
setFloatDefault(fontSize, @"NSLabelFontSize");
// NSMiniFontSize=9, NSSmallFontSize=11
setFloatDefault(fontSize - 4.0, @"NSMiniFontSize");
setFloatDefault(fontSize - 3.0, @"NSMiniFontSize");
setFloatDefault(fontSize - 2.0, @"NSSmallFontSize");
// WM
[self setWMFont:[NSFont fontWithName:[font familyName] size:fontSize - 4.0]
key:@"IconTitleFont"];
[self setWMFont:font key:@"MenuTextFont"];
[self setWMFont:[NSFont fontWithName:[font familyName] size:fontSize * 2.0]
key:@"LargeDisplayFont"];
}
else if ([fontKey isEqualToString:@"NSBoldFont"]) { // Bold System
[self setWMFont:font forKey:@"MenuTextFont"];
[self setWMFont:[NSFont fontWithName:fontName size:fontSize - 3.0] forKey:@"IconTitleFont"];
[self setWMFont:[NSFont fontWithName:fontName size:fontSize * 2.0] forKey:@"LargeDisplayFont"];
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:WMDidChangeAppearanceSettingsNotification
object:@"GSWorkspaceNotification"];
} else if ([fontKey isEqualToString:@"NSBoldFont"]) { // Bold System
// NSBoldFont, NSBoldFontSize=12
setStringDefault(fontName, @"NSBoldFont");
setFloatDefault(fontSize, @"NSBoldFontSize");
Expand All @@ -462,10 +449,12 @@ - (void)changeFont:(id)sender
setStringDefault(fontName, @"NSPaletteFont");
setFloatDefault(fontSize, @"NSPaletteFontSize");
// WM
[self setWMFont:font key:@"MenuTitleFont"];
[self setWMFont:font key:@"WindowTitleFont"];
}
else if ([fontKey isEqualToString:@"NSToolTipsFont"]) { // Tool Tips
[self setWMFont:font forKey:@"MenuTitleFont"];
[self setWMFont:font forKey:@"WindowTitleFont"];
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:WMDidChangeAppearanceSettingsNotification
object:@"GSWorkspaceNotification"];
} else if ([fontKey isEqualToString:@"NSToolTipsFont"]) { // Tool Tips
// NSToolTipsFont, NSToolTipsFontSize=11
setStringDefault(fontName, @"NSToolTipsFont");
setFloatDefault(fontSize, @"NSToolTipsFontSize");
Expand All @@ -474,8 +463,8 @@ - (void)changeFont:(id)sender
[defaults synchronize];
[self updateUI];
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:@"NXTSystemFontPreferencesDidChangeNotification"
object:@"Preferences"];
postNotificationName:@"NXTSystemFontPreferencesDidChangeNotification"
object:@"Preferences"];
}

@end // Font
1 change: 1 addition & 0 deletions Applications/Preferences/compile_flags.txt
1 change: 1 addition & 0 deletions Applications/Review/compile_flags.txt
27 changes: 0 additions & 27 deletions Applications/Terminal/compile_flags.txt

This file was deleted.

Loading