clang-format atom files
This commit is contained in:
parent
717f55b012
commit
53bdf22c85
128 changed files with 771 additions and 753 deletions
|
@ -9,7 +9,7 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSColor(Hex)
|
||||
@interface NSColor (Hex)
|
||||
+ (NSColor*)colorWithHexColorString:(NSString*)hex;
|
||||
@end
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface NSString(ANSI)
|
||||
@interface NSString (ANSI)
|
||||
- (BOOL)containsANSICodes;
|
||||
- (NSMutableAttributedString*)attributedStringParsingANSICodes;
|
||||
@end
|
||||
|
|
|
@ -26,7 +26,8 @@ class AtomBundleMover {
|
|||
static void Relaunch(NSString* destinationPath);
|
||||
static NSString* ShellQuotedString(NSString* string);
|
||||
static bool CopyBundle(NSString* srcPath, NSString* dstPath);
|
||||
static bool AuthorizedInstall(NSString* srcPath, NSString* dstPath,
|
||||
static bool AuthorizedInstall(NSString* srcPath,
|
||||
NSString* dstPath,
|
||||
bool* canceled);
|
||||
static bool IsApplicationAtPathRunning(NSString* bundlePath);
|
||||
static bool DeleteOrTrash(NSString* path);
|
||||
|
|
|
@ -22,7 +22,7 @@ class AtomMenuModel;
|
|||
// allow for hierarchical menus). The tag is the index into that model for
|
||||
// that particular item. It is important that the model outlives this object
|
||||
// as it only maintains weak references.
|
||||
@interface AtomMenuController : NSObject<NSMenuDelegate> {
|
||||
@interface AtomMenuController : NSObject <NSMenuDelegate> {
|
||||
@protected
|
||||
atom::AtomMenuModel* model_; // weak
|
||||
base::scoped_nsobject<NSMenu> menu_;
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
#include "native_mate/constructor.h"
|
||||
#include "native_mate/persistent_dictionary.h"
|
||||
|
||||
@interface AtomTouchBar : NSObject<NSScrubberDelegate, NSScrubberDataSource, NSScrubberFlowLayoutDelegate> {
|
||||
@interface AtomTouchBar : NSObject <NSScrubberDelegate,
|
||||
NSScrubberDataSource,
|
||||
NSScrubberFlowLayoutDelegate> {
|
||||
@protected
|
||||
std::vector<mate::PersistentDictionary> ordered_settings_;
|
||||
std::map<std::string, mate::PersistentDictionary> settings_;
|
||||
|
@ -25,18 +27,25 @@
|
|||
atom::NativeWindow* window_;
|
||||
}
|
||||
|
||||
- (id)initWithDelegate:(id<NSTouchBarDelegate>)delegate window:(atom::NativeWindow*)window settings:(const std::vector<mate::PersistentDictionary>&)settings;
|
||||
- (id)initWithDelegate:(id<NSTouchBarDelegate>)delegate
|
||||
window:(atom::NativeWindow*)window
|
||||
settings:(const std::vector<mate::PersistentDictionary>&)settings;
|
||||
|
||||
- (NSTouchBar*)makeTouchBar;
|
||||
- (NSTouchBar*)touchBarFromItemIdentifiers:(NSMutableArray*)items;
|
||||
- (NSMutableArray*)identifiersFromSettings:(const std::vector<mate::PersistentDictionary>&)settings;
|
||||
- (void)refreshTouchBarItem:(NSTouchBar*)touchBar id:(const std::string&)item_id;
|
||||
- (void)addNonDefaultTouchBarItems:(const std::vector<mate::PersistentDictionary>&)items;
|
||||
- (void)setEscapeTouchBarItem:(const mate::PersistentDictionary&)item forTouchBar:(NSTouchBar*)touchBar;
|
||||
- (NSMutableArray*)identifiersFromSettings:
|
||||
(const std::vector<mate::PersistentDictionary>&)settings;
|
||||
- (void)refreshTouchBarItem:(NSTouchBar*)touchBar
|
||||
id:(const std::string&)item_id;
|
||||
- (void)addNonDefaultTouchBarItems:
|
||||
(const std::vector<mate::PersistentDictionary>&)items;
|
||||
- (void)setEscapeTouchBarItem:(const mate::PersistentDictionary&)item
|
||||
forTouchBar:(NSTouchBar*)touchBar;
|
||||
|
||||
|
||||
- (NSString*)idFromIdentifier:(NSString*)identifier withPrefix:(NSString*)prefix;
|
||||
- (NSTouchBarItemIdentifier)identifierFromID:(const std::string&)item_id type:(const std::string&)typere;
|
||||
- (NSString*)idFromIdentifier:(NSString*)identifier
|
||||
withPrefix:(NSString*)prefix;
|
||||
- (NSTouchBarItemIdentifier)identifierFromID:(const std::string&)item_id
|
||||
type:(const std::string&)typere;
|
||||
- (bool)hasItemWithID:(const std::string&)item_id;
|
||||
- (NSColor*)colorFromHexColorString:(const std::string&)colorString;
|
||||
|
||||
|
@ -47,19 +56,30 @@
|
|||
|
||||
// Helpers to create touch bar items
|
||||
- (NSTouchBarItem*)makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier;
|
||||
- (NSTouchBarItem*)makeButtonForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeLabelForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeColorPickerForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeSliderForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makePopoverForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeGroupForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeButtonForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeLabelForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeColorPickerForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeSliderForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makePopoverForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeGroupForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
|
||||
// Helpers to update touch bar items
|
||||
- (void)updateButton:(NSCustomTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateLabel:(NSCustomTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateColorPicker:(NSColorPickerTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateSlider:(NSSliderTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updatePopover:(NSPopoverTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateButton:(NSCustomTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateLabel:(NSCustomTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateColorPicker:(NSColorPickerTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateSlider:(NSSliderTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updatePopover:(NSPopoverTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -14,18 +14,18 @@
|
|||
#pragma clang assume_nonnull begin
|
||||
|
||||
@class NSTouchBar, NSTouchBarItem;
|
||||
@class NSScrubber, NSScrubberItemView, NSScrubberArrangedView, NSScrubberTextItemView, NSScrubberImageItemView, NSScrubberSelectionStyle;
|
||||
@protocol NSTouchBarDelegate, NSScrubberDelegate, NSScrubberDataSource, NSScrubberFlowLayoutDelegate, NSScrubberFlowLayout;
|
||||
@class NSScrubber, NSScrubberItemView, NSScrubberArrangedView,
|
||||
NSScrubberTextItemView, NSScrubberImageItemView, NSScrubberSelectionStyle;
|
||||
@protocol NSTouchBarDelegate
|
||||
, NSScrubberDelegate, NSScrubberDataSource, NSScrubberFlowLayoutDelegate,
|
||||
NSScrubberFlowLayout;
|
||||
|
||||
typedef float NSTouchBarItemPriority;
|
||||
static const NSTouchBarItemPriority NSTouchBarItemPriorityHigh = 1000;
|
||||
static const NSTouchBarItemPriority NSTouchBarItemPriorityNormal = 0;
|
||||
static const NSTouchBarItemPriority NSTouchBarItemPriorityLow = -1000;
|
||||
|
||||
enum NSScrubberMode {
|
||||
NSScrubberModeFixed = 0,
|
||||
NSScrubberModeFree
|
||||
};
|
||||
enum NSScrubberMode { NSScrubberModeFixed = 0, NSScrubberModeFree };
|
||||
|
||||
typedef NSString* NSTouchBarItemIdentifier;
|
||||
typedef NSString* NSTouchBarCustomizationIdentifier;
|
||||
|
@ -42,7 +42,7 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierFlexibleSpace =
|
|||
static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
||||
@"NSTouchBarItemIdentifierOtherItemsProxy";
|
||||
|
||||
@interface NSTouchBar : NSObject<NSCoding>
|
||||
@interface NSTouchBar : NSObject <NSCoding>
|
||||
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder*)aDecoder
|
||||
|
@ -55,7 +55,8 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
|||
@property(copy) NSArray* defaultItemIdentifiers;
|
||||
@property(copy, readonly) NSArray* itemIdentifiers;
|
||||
@property(copy, nullable) NSTouchBarItemIdentifier principalItemIdentifier;
|
||||
@property(copy, nullable) NSTouchBarItemIdentifier escapeKeyReplacementItemIdentifier;
|
||||
@property(copy, nullable)
|
||||
NSTouchBarItemIdentifier escapeKeyReplacementItemIdentifier;
|
||||
@property(copy) NSSet* templateItems;
|
||||
@property(nullable, weak) id<NSTouchBarDelegate> delegate;
|
||||
|
||||
|
@ -66,7 +67,7 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
|||
|
||||
@end
|
||||
|
||||
@interface NSTouchBarItem : NSObject<NSCoding>
|
||||
@interface NSTouchBarItem : NSObject <NSCoding>
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSTouchBarItemIdentifier)identifier
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
@ -149,13 +150,15 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
|||
|
||||
@end
|
||||
|
||||
@interface NSScrubberFlowLayout: NSObject
|
||||
@interface NSScrubberFlowLayout : NSObject
|
||||
@end
|
||||
|
||||
@interface NSScrubberSelectionStyle : NSObject<NSCoding>
|
||||
@interface NSScrubberSelectionStyle : NSObject <NSCoding>
|
||||
|
||||
@property(class, strong, readonly) NSScrubberSelectionStyle* outlineOverlayStyle;
|
||||
@property(class, strong, readonly) NSScrubberSelectionStyle* roundedBackgroundStyle;
|
||||
@property(class, strong, readonly)
|
||||
NSScrubberSelectionStyle* outlineOverlayStyle;
|
||||
@property(class, strong, readonly)
|
||||
NSScrubberSelectionStyle* roundedBackgroundStyle;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -209,7 +212,7 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
|||
|
||||
@end
|
||||
|
||||
@protocol NSTouchBarDelegate<NSObject>
|
||||
@protocol NSTouchBarDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
- (nullable NSTouchBarItem*)touchBar:(NSTouchBar*)touchBar
|
||||
|
@ -217,24 +220,28 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
|||
|
||||
@end
|
||||
|
||||
@protocol NSScrubberDelegate<NSObject>
|
||||
@protocol NSScrubberDelegate <NSObject>
|
||||
|
||||
- (void)scrubber:(NSScrubber*)scrubber didHighlightItemAtIndex:(NSInteger)highlightedIndex;
|
||||
- (void)scrubber:(NSScrubber*)scrubber didSelectItemAtIndex:(NSInteger)selectedIndex;
|
||||
- (void)scrubber:(NSScrubber*)scrubber
|
||||
didHighlightItemAtIndex:(NSInteger)highlightedIndex;
|
||||
- (void)scrubber:(NSScrubber*)scrubber
|
||||
didSelectItemAtIndex:(NSInteger)selectedIndex;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSScrubberDataSource<NSObject>
|
||||
@protocol NSScrubberDataSource <NSObject>
|
||||
|
||||
- (NSInteger)numberOfItemsForScrubber:(NSScrubber*)scrubber;
|
||||
- (__kindof NSScrubberItemView*)scrubber:(NSScrubber*)scrubber
|
||||
viewForItemAtIndex:(NSInteger)index;
|
||||
viewForItemAtIndex:(NSInteger)index;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSScrubberFlowLayoutDelegate<NSObject>
|
||||
@protocol NSScrubberFlowLayoutDelegate <NSObject>
|
||||
|
||||
- (NSSize)scrubber:(NSScrubber *)scrubber layout:(NSScrubberFlowLayout *)layout sizeForItemAtIndex:(NSInteger)itemIndex;
|
||||
- (NSSize)scrubber:(NSScrubber*)scrubber
|
||||
layout:(NSScrubberFlowLayout*)layout
|
||||
sizeForItemAtIndex:(NSInteger)itemIndex;
|
||||
|
||||
@end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue