Skip to content
Snippets Groups Projects
Commit 9d6a1a2c authored by C.W. Betts's avatar C.W. Betts
Browse files

Migrate the enums to NS_ENUM or NS_OPTIONS.

I only modified those that were in the Headers group in Xcode.
parent bf32c20d
No related branches found
No related tags found
No related merge requests found
Showing
with 46 additions and 45 deletions
Loading
Loading
@@ -2749,6 +2749,7 @@
);
name = JTerminal;
sourceTree = "<group>";
usesTabs = 0;
};
0464AB0E006CD2EC7F000001 /* Classes */ = {
isa = PBXGroup;
Loading
Loading
Loading
Loading
@@ -11,15 +11,15 @@
 
@class VT100RemoteHost;
 
typedef enum {
typedef NS_ENUM(NSInteger, ContextMenuActions) {
kOpenFileContextMenuAction,
kOpenUrlContextMenuAction,
kRunCommandContextMenuAction,
kRunCoprocessContextMenuAction,
kSendTextContextMenuAction
} ContextMenuActions;
};
 
@protocol ContextMenuActionPrefsDelegate
@protocol ContextMenuActionPrefsDelegate <NSObject>
 
- (void)contextMenuActionsChanged:(NSArray *)newActions;
 
Loading
Loading
Loading
Loading
@@ -8,21 +8,23 @@
 
#import <Foundation/Foundation.h>
 
#define FindOptCaseInsensitive (1 << 0)
#define FindOptBackwards (1 << 1)
#define FindOptRegex (1 << 2)
#define FindMultipleResults (1 << 3)
typedef NS_OPTIONS(NSUInteger, FindOptions) {
FindOptCaseInsensitive = (1 << 0),
FindOptBackwards = (1 << 1),
FindOptRegex = (1 << 2),
FindMultipleResults = (1 << 3)
};
 
typedef enum {
typedef NS_ENUM(NSInteger, FindContextStatus) {
Searching,
Matched,
NotFound
} FindContextStatus;
};
 
@interface FindContext : NSObject {
int absBlockNum_;
NSString* substring_;
int options_;
FindOptions options_;
int dir_;
int offset_;
int stopAt_;
Loading
Loading
@@ -40,7 +42,7 @@ typedef enum {
@property(nonatomic, copy) NSString *substring;
 
// A bitwise OR of the options defined above.
@property(nonatomic, assign) int options;
@property(nonatomic, assign) FindOptions options;
 
// 1: search forward. -1: search backward.
@property(nonatomic, assign) int dir;
Loading
Loading
Loading
Loading
@@ -227,11 +227,11 @@ typedef enum {
WINDOW_TYPE_NO_TITLE_BAR = 12,
} iTermWindowType;
 
typedef enum {
typedef NS_ENUM(NSInteger, iTermObjectType) {
iTermWindowObject,
iTermTabObject,
iTermPaneObject,
} iTermObjectType;
};
 
@interface ITAddressBookMgr : NSObject <NSNetServiceBrowserDelegate, NSNetServiceDelegate>
{
Loading
Loading
Loading
Loading
@@ -807,7 +807,7 @@ static NSString* RewrittenRegex(NSString* originalRegex) {
}
 
static int CoreSearch(NSString* needle, screen_char_t* rawline, int raw_line_length, int start, int end,
int options, int* resultLength, NSString* haystack, unichar* charHaystack,
FindOptions options, int* resultLength, NSString* haystack, unichar* charHaystack,
int* deltas, int deltaOffset)
{
int apiOptions = 0;
Loading
Loading
Loading
Loading
@@ -126,7 +126,7 @@
// Set up the find context. See FindContext.h for options bit values.
- (void)prepareToSearchFor:(NSString*)substring
startingAt:(LineBufferPosition *)start
options:(int)options
options:(FindOptions)options
withContext:(FindContext*)context;
 
// Performs a search. Use prepareToSearchFor:startingAt:options:withContext: to initialize
Loading
Loading
Loading
Loading
@@ -656,7 +656,7 @@ static int RawNumLines(LineBuffer* buffer, int width) {
 
- (void)prepareToSearchFor:(NSString*)substring
startingAt:(LineBufferPosition *)start
options:(int)options
options:(FindOptions)options
withContext:(FindContext*)context
{
context.substring = substring;
Loading
Loading
Loading
Loading
@@ -10,12 +10,12 @@
 
@class PTYNoteViewController;
 
typedef enum {
typedef NS_ENUM(NSInteger, PTYNoteViewTipEdge) {
kPTYNoteViewTipEdgeLeft,
kPTYNoteViewTipEdgeTop,
kPTYNoteViewTipEdgeRight,
kPTYNoteViewTipEdgeBottom
} PTYNoteViewTipEdge;
};
 
@protocol PTYNoteViewDelegate
- (PTYNoteViewController *)noteViewController;
Loading
Loading
Loading
Loading
@@ -50,11 +50,11 @@ static const float kFastTimerIntervalSec = 1.0 / 30.0;
// TODO(georgen): There's room for improvement here.
static const float kBackgroundSessionIntervalSec = 1;
 
typedef enum {
typedef NS_ENUM(NSInteger, SplitSelectionMode) {
kSplitSelectionModeOn,
kSplitSelectionModeOff,
kSplitSelectionModeCancel
} SplitSelectionMode;
};
 
typedef enum {
TMUX_NONE,
Loading
Loading
Loading
Loading
@@ -35,12 +35,12 @@
#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
 
// Types of characters. Used when classifying characters for word selection.
typedef enum {
typedef NS_ENUM(NSInteger, PTYCharType) {
CHARTYPE_WHITESPACE, // whitespace chars or NUL
CHARTYPE_WORDCHAR, // Any character considered part of a word, including user-defined chars.
CHARTYPE_DW_FILLER, // Double-width character effluvia.
CHARTYPE_OTHER, // Symbols, etc. Anything that doesn't fall into the other categories.
} PTYCharType;
};
 
@protocol PTYTextViewDelegate <NSObject>
 
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@
 
#import <Cocoa/Cocoa.h>
 
typedef enum {
typedef NS_ENUM(NSInteger, PreferenceInfoType) {
kPreferenceInfoTypeCheckbox,
kPreferenceInfoTypeIntegerTextField,
kPreferenceInfoTypeStringTextField,
Loading
Loading
@@ -17,7 +17,7 @@ typedef enum {
kPreferenceInfoTypeTokenField,
kPreferenceInfoTypeMatrix,
kPreferenceInfoTypeColorWell,
} PreferenceInfoType;
};
 
 
@interface PreferenceInfo : NSObject
Loading
Loading
Loading
Loading
@@ -8,18 +8,16 @@
 
@class SBSystemPreferencesApplication, SBSystemPreferencesDocument, SBSystemPreferencesWindow, SBSystemPreferencesPane, SBSystemPreferencesAnchor;
 
enum SBSystemPreferencesSaveOptions {
typedef NS_ENUM(OSType, SBSystemPreferencesSaveOptions) {
SBSystemPreferencesSaveOptionsYes = 'yes ' /* Save the file. */,
SBSystemPreferencesSaveOptionsNo = 'no ' /* Do not save the file. */,
SBSystemPreferencesSaveOptionsAsk = 'ask ' /* Ask the user whether or not to save the file. */
};
typedef enum SBSystemPreferencesSaveOptions SBSystemPreferencesSaveOptions;
 
enum SBSystemPreferencesPrintingErrorHandling {
typedef NS_ENUM(OSType, SBSystemPreferencesPrintingErrorHandling) {
SBSystemPreferencesPrintingErrorHandlingStandard = 'lwst' /* Standard PostScript error handling */,
SBSystemPreferencesPrintingErrorHandlingDetailed = 'lwdt' /* print a detailed report of PostScript errors */
};
typedef enum SBSystemPreferencesPrintingErrorHandling SBSystemPreferencesPrintingErrorHandling;
 
 
 
Loading
Loading
Loading
Loading
@@ -45,12 +45,12 @@ extern NSString * const kTmuxGatewayErrorDomain;
 
@end
 
typedef enum {
typedef NS_ENUM(NSInteger, ControlCommand) {
CONTROL_COMMAND_OUTPUT,
CONTROL_COMMAND_LAYOUT_CHANGE,
CONTROL_COMMAND_WINDOWS_CHANGE,
CONTROL_COMMAND_NOOP
} ControlCommand;
};
 
@interface TmuxGateway : NSObject {
NSObject<TmuxGatewayDelegate> *delegate_; // weak
Loading
Loading
Loading
Loading
@@ -28,11 +28,11 @@ extern NSString *kLayoutDictHistoryKey; // Array of screen_char_t-filled N
extern NSString *kLayoutDictAltHistoryKey; // Alternate screen history
extern NSString *kLayoutDictStateKey; // see TmuxStateParser
 
typedef enum {
typedef NS_ENUM(NSInteger, LayoutNodeType) {
kLeafLayoutNode,
kHSplitLayoutNode,
kVSplitLayoutNode
} LayoutNodeType;
};
 
@interface TmuxLayoutParser : NSObject
 
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@
 
@class TransferrableFile;
 
typedef enum {
typedef NS_ENUM(NSInteger, TransferrableFileStatus) {
kTransferrableFileStatusUnstarted,
kTransferrableFileStatusStarting,
kTransferrableFileStatusTransferring,
Loading
Loading
@@ -18,7 +18,7 @@ typedef enum {
kTransferrableFileStatusFinishedWithError,
kTransferrableFileStatusCancelling,
kTransferrableFileStatusCancelled
} TransferrableFileStatus;
};
 
@interface TransferrableFile : NSObject
 
Loading
Loading
Loading
Loading
@@ -11,12 +11,12 @@
 
@class iTermImageInfo;
 
typedef enum {
typedef NS_ENUM(NSInteger, URLActionType) {
kURLActionOpenURL,
kURLActionSmartSelectionAction,
kURLActionOpenExistingFile,
kURLActionOpenImage
} URLActionType;
};
 
@interface URLAction : NSObject
 
Loading
Loading
Loading
Loading
@@ -11,14 +11,14 @@
#import "iTermParser.h"
#import "VT100Token.h"
 
typedef enum {
typedef NS_ENUM(NSInteger, VT100CSIIncidentalType) {
kIncidentalRingBell,
kIncidentalBackspace,
kIncidentalAppendTabAtCursor,
kIncidentalLineFeed,
kIncidentalCarriageReturn,
kIncidentalDeleteCharacterAtCursor
} VT100CSIIncidentalType;
};
 
NS_INLINE BOOL isCSI(unsigned char *code, int len) {
return (len >= 2 && code[0] == VT100CC_ESC && (code[1] == '['));
Loading
Loading
Loading
Loading
@@ -21,18 +21,18 @@
 
@end
 
typedef enum {
typedef NS_ENUM(NSInteger, DcsTermcapTerminfoRequestName) {
kDcsTermcapTerminfoRequestUnrecognizedName,
kDcsTermcapTerminfoRequestTerminalName,
kDcsTermcapTerminfoRequestiTerm2ProfileName,
kDcsTermcapTerminfoRequestTerminfoName
} DcsTermcapTerminfoRequestName;
};
 
NS_INLINE BOOL isDCS(unsigned char *code, int len) {
return (len >= 2 && code[0] == VT100CC_ESC && code[1] == 'P');
}
 
typedef enum {
typedef NS_ENUM(NSInteger, VT100DCSState) {
// Initial state
kVT100DCSStateEntry,
 
Loading
Loading
@@ -56,7 +56,7 @@ typedef enum {
 
// Reading final byte or bytes.
kVT100DCSStatePassthrough
} VT100DCSState;
};
 
@interface VT100DCSParser : NSObject
 
Loading
Loading
Loading
Loading
@@ -11,12 +11,12 @@ typedef enum {
MOUSE_BUTTON_SCROLLUP = 5 // scroll up
} MouseButtonNumber;
 
typedef enum {
typedef NS_ENUM(NSInteger, MouseFormat) {
MOUSE_FORMAT_XTERM = 0, // Regular 1000 mode (limited to 223 rows/cols)
MOUSE_FORMAT_XTERM_EXT = 1, // UTF-8 1005 mode (does not pass through luit unchanged)
MOUSE_FORMAT_URXVT = 2, // rxvt's 1015 mode (outputs csi codes, that if echoed to the term, mess up the display)
MOUSE_FORMAT_SGR = 3 // SGR 1006 mode (preferred)
} MouseFormat;
};
 
// This class produces data to send for special keys (arrow keys, function keys, etc.)
// It has a small amount of state that is copied from VT100Terminal. This object is 1:1 with
Loading
Loading
Loading
Loading
@@ -1549,7 +1549,7 @@ static NSString *const kInlineFileBase64String = @"base64 string"; // NSMutable
}
 
// Set up the options bitmask and call findSubstring.
int opts = 0;
FindOptions opts = 0;
if (!direction) {
opts |= FindOptBackwards;
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment