Skip to content

Commit

Permalink
shadow_size & candidate_back_color
Browse files Browse the repository at this point in the history
  • Loading branch information
groverlynn committed May 24, 2024
1 parent 39ba571 commit 4556e7e
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 94 deletions.
4 changes: 2 additions & 2 deletions Squirrel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.16.2e;
CURRENT_PROJECT_VERSION = 0.18.0e;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -711,7 +711,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 0.16.2e;
CURRENT_PROJECT_VERSION = 0.18.0e;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
Expand Down
18 changes: 9 additions & 9 deletions SquirrelApplicationDelegate.hh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#import <Cocoa/Cocoa.h>
#import "rime_api.h"

@class SquirrelConfig;
@class SquirrelPanel;
@class SquirrelOptionSwitcher;
typedef uintptr_t RimeSessionId;

// Note: the SquirrelApplicationDelegate is instantiated automatically as an
// outlet of NSApp's instance
Expand All @@ -19,21 +19,21 @@ typedef NS_CLOSED_ENUM(NSUInteger, SquirrelNotificationPolicy) {
@property(nonatomic, weak, nullable) IBOutlet SquirrelPanel* panel;
@property(nonatomic, weak, nullable) IBOutlet id updater;

@property(nonatomic, strong, readonly, nullable, direct) SquirrelConfig* config;
@property(nonatomic, readonly, strong, nullable, direct) SquirrelConfig* config;
@property(nonatomic, readonly, direct)
SquirrelNotificationPolicy showNotifications;
@property(nonatomic, readonly, direct) BOOL problematicLaunchDetected;
@property(nonatomic, direct) BOOL isCurrentInputMethod;

- (IBAction)showSwitcher:(id _Nullable)sender __attribute__((objc_direct));
- (IBAction)deploy:(id _Nullable)sender __attribute__((objc_direct));
- (IBAction)syncUserData:(id _Nullable)sender __attribute__((objc_direct));
- (IBAction)configure:(id _Nullable)sender __attribute__((objc_direct));
- (IBAction)openWiki:(id _Nullable)sender __attribute__((objc_direct));
- (IBAction)showSwitcher:(id _Nullable)sender;
- (IBAction)deploy:(id _Nullable)sender;
- (IBAction)syncUserData:(id _Nullable)sender;
- (IBAction)configure:(id _Nullable)sender;
- (IBAction)openWiki:(id _Nullable)sender;
- (IBAction)openLogFolder:(id _Nullable)sender;

- (void)setupRime __attribute__((objc_direct));
- (void)startRimeWithFullCheck:(BOOL)fullCheck __attribute__((objc_direct));
- (void)startRimeWithFullCheck:(bool)fullCheck __attribute__((objc_direct));
- (void)loadSettings __attribute__((objc_direct));
- (void)loadSchemaSpecificSettings:(NSString* _Nonnull)schemaId
withRimeSession:(RimeSessionId)sessionId
Expand All @@ -50,5 +50,5 @@ typedef NS_CLOSED_ENUM(NSUInteger, SquirrelNotificationPolicy) {

@end // NSApplication (SquirrelApp)

// also used in main.m
// also used in main.mm
extern void show_notification(const char* _Nonnull msg_text);
23 changes: 12 additions & 11 deletions SquirrelConfig.hh
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#import <Cocoa/Cocoa.h>
#import <rime_api.h>

typedef uintptr_t RimeSessionId;

__attribute__((objc_direct_members))
@interface SquirrelOptionSwitcher : NSObject

@property(nonatomic, strong, readonly, nonnull) NSString* schemaId;
@property(nonatomic, strong, readonly, nonnull) NSString* currentScriptVariant;
@property(nonatomic, strong, readonly, nonnull) NSSet<NSString*>* optionNames;
@property(nonatomic, strong, readonly, nonnull) NSSet<NSString*>* optionStates;
@property(nonatomic, strong, readonly, nonnull)
@property(nonatomic, readonly, strong, nonnull) NSString* schemaId;
@property(nonatomic, readonly, strong, nonnull) NSString* currentScriptVariant;
@property(nonatomic, readonly, strong, nonnull) NSSet<NSString*>* optionNames;
@property(nonatomic, readonly, strong, nonnull) NSSet<NSString*>* optionStates;
@property(nonatomic, readonly, strong, nonnull)
NSDictionary<NSString*, NSString*>* scriptVariantOptions;
@property(nonatomic, strong, readonly, nonnull)
@property(nonatomic, readonly, strong, nonnull)
NSMutableDictionary<NSString*, NSString*>* switcher;
@property(nonatomic, strong, readonly, nonnull)
@property(nonatomic, readonly, strong, nonnull)
NSDictionary<NSString*, NSOrderedSet<NSString*>*>* optionGroups;

- (instancetype _Nonnull)
Expand Down Expand Up @@ -40,7 +41,7 @@ __attribute__((objc_direct_members))
__attribute__((objc_direct_members))
@interface SquirrelAppOptions : NSDictionary<NSString*, NSNumber*>

- (BOOL)boolValueForKey:(NSString* _Nonnull)key;
- (bool)boolValueForKey:(NSString* _Nonnull)key;
- (int)intValueForKey:(NSString* _Nonnull)key;
- (double)doubleValueForKey:(NSString* _Nonnull)key;

Expand All @@ -61,13 +62,13 @@ __attribute__((objc_direct_members))

- (BOOL)hasSection:(NSString* _Nonnull)section;

- (BOOL)setOption:(NSString* _Nonnull)option withBool:(BOOL)value;
- (BOOL)setOption:(NSString* _Nonnull)option withBool:(bool)value;
- (BOOL)setOption:(NSString* _Nonnull)option withInt:(int)value;
- (BOOL)setOption:(NSString* _Nonnull)option withDouble:(double)value;
- (BOOL)setOption:(NSString* _Nonnull)option
withString:(NSString* _Nonnull)value;

- (BOOL)getBoolForOption:(NSString* _Nonnull)option;
- (bool)getBoolForOption:(NSString* _Nonnull)option;
- (int)getIntForOption:(NSString* _Nonnull)option;
- (double)getDoubleForOption:(NSString* _Nonnull)option;
- (double)getDoubleForOption:(NSString* _Nonnull)option
Expand Down
8 changes: 4 additions & 4 deletions SquirrelInputController.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ typedef NS_ENUM(NSUInteger, SquirrelIndex) {
kVoidSymbol = 0xffffff // XK_VoidSymbol
};

@property(nonatomic, weak, readonly, nullable, direct, class)
@property(nonatomic, readonly, weak, nullable, direct, class)
SquirrelInputController* currentController;
@property(nonatomic, strong, readonly, nonnull)
@property(nonatomic, readonly, strong, nonnull)
NSAppearance* viewEffectiveAppearance API_AVAILABLE(macos(10.14));
@property(nonatomic, strong, readonly, nonnull, direct)
@property(nonatomic, readonly, strong, nonnull, direct)
NSMutableArray<NSString*>* candidateTexts;
@property(nonatomic, strong, readonly, nonnull, direct)
@property(nonatomic, readonly, strong, nonnull, direct)
NSMutableArray<NSString*>* candidateComments;

- (void)moveCursor:(NSUInteger)cursorPosition
Expand Down
4 changes: 2 additions & 2 deletions SquirrelPanel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
@property(nonatomic, direct) NSUInteger sectionNum;
// position of the text input I-beam cursor on screen.
@property(nonatomic, direct) NSRect IbeamRect;
@property(nonatomic, strong, readonly, nullable) NSScreen* screen;
@property(nonatomic, readonly, strong, nullable) NSScreen* screen;
// Status message before pop-up is displayed; nil before normal panel is
// displayed
@property(nonatomic, strong, readonly, nullable, direct)
@property(nonatomic, readonly, strong, nullable, direct)
NSString* statusMessage;
// Store switch options that change style (color theme) settings
@property(nonatomic, strong, nonnull, direct)
Expand Down
Loading

0 comments on commit 4556e7e

Please sign in to comment.