diff --git a/lcl/interfaces/cocoa/cocoaconfig.pas b/lcl/interfaces/cocoa/cocoaconfig.pas new file mode 100644 index 0000000000..4253796e67 --- /dev/null +++ b/lcl/interfaces/cocoa/cocoaconfig.pas @@ -0,0 +1,33 @@ +unit CocoaConfig; + +{$mode objfpc}{$H+} +{$modeswitch objectivec1} + +interface + +uses + CocoaAll; + +var + CocoaBasePPI : Integer = 96; // for compatiblity with LCL 1.8 release. The macOS base is 72ppi + + // if set to true, then WS would not assign icons via TCocoaWSForm SetIcon + // The icon would have to be changed manually. By default LCL behaviour is used + CocoaIconUse: Boolean = false; + CocoaToggleBezel : NSBezelStyle = NSRoundedBezelStyle; + CocoaToggleType : NSButtonType = NSPushOnPushOffButton; + + CocoaHideFocusNoBorder : Boolean = true; + + CocoaUseLocalizedFontName : Boolean = false; // some localized named might be too long to be returned properly by APIs + + {$ifdef COCOALOOPHIJACK} + // The flag is set to true once hi-jacked loop is finished (at the end of app) + // The flag is checked in Menus to avoid "double" Cmd+Q menu + LoopHiJackEnded : Boolean = false; + {$endif} + +implementation + +end. + diff --git a/lcl/interfaces/cocoa/cocoaconst.pas b/lcl/interfaces/cocoa/cocoaconst.pas index f74dedab33..96c77e21ca 100644 --- a/lcl/interfaces/cocoa/cocoaconst.pas +++ b/lcl/interfaces/cocoa/cocoaconst.pas @@ -8,25 +8,6 @@ interface uses CocoaAll; -const - CocoaBasePPI : Integer = 96; // for compatiblity with LCL 1.8 release. The macOS base is 72ppi - - // if set to true, then WS would not assign icons via TCocoaWSForm SetIcon - // The icon would have to be changed manually. By default LCL behaviour is used - CocoaIconUse: Boolean = false; - CocoaToggleBezel : NSBezelStyle = NSRoundedBezelStyle; - CocoaToggleType : NSButtonType = NSPushOnPushOffButton; - - CocoaHideFocusNoBorder : Boolean = true; - - CocoaUseLocalizedFontName : Boolean = false; // some localized named might be too long to be returned properly by APIs - - {$ifdef COCOALOOPHIJACK} - // The flag is set to true once hi-jacked loop is finished (at the end of app) - // The flag is checked in Menus to avoid "double" Cmd+Q menu - LoopHiJackEnded : Boolean = false; - {$endif} - function NSSTR_EMPTY: NSString; function NSSTR_DARK_NAME: NSString; diff --git a/lcl/interfaces/cocoa/cocoaint.pas b/lcl/interfaces/cocoa/cocoaint.pas index ab91aba0d2..70d765952b 100644 --- a/lcl/interfaces/cocoa/cocoaint.pas +++ b/lcl/interfaces/cocoa/cocoaint.pas @@ -33,8 +33,8 @@ uses // darwin bindings MacOSAll, // private - CocoaAll, CocoaConst, CocoaPrivate, CocoaUtils, CocoaGDIObjects, CocoaCursor, - cocoa_extra, CocoaMenus, CocoaWindows, CocoaScrollers, + CocoaAll, CocoaConst, CocoaConfig, CocoaPrivate, CocoaUtils, Cocoa_Extra, + CocoaGDIObjects, CocoaCursor, CocoaMenus, CocoaWindows, CocoaScrollers, CocoaWSClipboard, CocoaTextEdits, // LCL LMessages, LCLProc, LCLIntf, LCLType, diff --git a/lcl/interfaces/cocoa/cocoawscommon.pas b/lcl/interfaces/cocoa/cocoawscommon.pas index 0199bc90e4..f991c14783 100644 --- a/lcl/interfaces/cocoa/cocoawscommon.pas +++ b/lcl/interfaces/cocoa/cocoawscommon.pas @@ -10,7 +10,7 @@ interface uses Types, Classes, Controls, SysUtils, WSControls, LCLType, LCLMessageGlue, LMessages, LCLProc, LCLIntf, Graphics, Forms, - CocoaAll, CocoaInt, CocoaConst, CocoaPrivate, CocoaUtils, + CocoaAll, CocoaInt, CocoaConfig, CocoaPrivate, CocoaUtils, CocoaGDIObjects, CocoaCursor, CocoaCaret, CocoaScrollers, cocoa_extra; type diff --git a/lcl/interfaces/cocoa/cocoawsforms.pas b/lcl/interfaces/cocoa/cocoawsforms.pas index e3bad2aabf..4b2cbc4907 100644 --- a/lcl/interfaces/cocoa/cocoawsforms.pas +++ b/lcl/interfaces/cocoa/cocoawsforms.pas @@ -30,7 +30,7 @@ uses // Widgetset WSForms, WSLCLClasses, LCLMessageGlue, // LCL Cocoa - CocoaInt, CocoaConst, CocoaPrivate, CocoaUtils, CocoaWSCommon, CocoaMenus, + CocoaInt, CocoaConfig, CocoaPrivate, CocoaUtils, CocoaWSCommon, CocoaMenus, CocoaGDIObjects, CocoaWindows, CocoaScrollers, cocoa_extra; @@ -642,7 +642,7 @@ begin SetWindowButtonState(NSWindowZoomButton, (biMaximize in ABorderIcons) and (ABorderStyle in [bsSizeable, bsSizeToolWin]), (ABorderStyle in [bsSingle, bsSizeable]) and (biSystemMenu in ABorderIcons)); SetWindowButtonState(NSWindowCloseButton, True, (ABorderStyle <> bsNone) and (biSystemMenu in ABorderIcons)); - if not CocoaConst.CocoaIconUse then + if not CocoaConfig.CocoaIconUse then begin btn := AWindow.standardWindowButton(NSWindowDocumentIconButton); url := nil; @@ -1048,7 +1048,7 @@ var trg : NSImage; btn : NSButton; begin - if CocoaConst.CocoaIconUse then Exit; + if CocoaConfig.CocoaIconUse then Exit; if not AForm.HandleAllocated then Exit; win := TCocoaWindowContent(AForm.Handle).lclOwnWindow; diff --git a/lcl/interfaces/cocoa/cocoawsstdctrls.pas b/lcl/interfaces/cocoa/cocoawsstdctrls.pas index b50662fd31..0c03ce9b3c 100644 --- a/lcl/interfaces/cocoa/cocoawsstdctrls.pas +++ b/lcl/interfaces/cocoa/cocoawsstdctrls.pas @@ -33,7 +33,8 @@ uses // Widgetset WSStdCtrls, WSLCLClasses, // LCL Cocoa - CocoaConst, CocoaWSCommon, CocoaPrivate, CocoaUtils, CocoaGDIObjects, CocoaButtons, + CocoaConst, CocoaConfig, + CocoaWSCommon, CocoaPrivate, CocoaUtils, CocoaGDIObjects, CocoaButtons, CocoaTables, CocoaTextEdits, CocoaScrollers, Cocoa_Extra; type diff --git a/lcl/interfaces/lcl.lpk b/lcl/interfaces/lcl.lpk index 8519c30dc5..1a7ba27eac 100644 --- a/lcl/interfaces/lcl.lpk +++ b/lcl/interfaces/lcl.lpk @@ -131,7 +131,7 @@ end;"/> - + @@ -2633,6 +2633,11 @@ end;"/> + + + + +