mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
e60bb3226c
Sending the arguments with the openURL:... message allows the repository document to modify it's UI without the UI flashing between states as it opens.
Covers all the existing functionality of the CLI, but modifies:
- "--all" "--local" "--branch" change the branch filter
- cleaned up the usage (help) text and added info on missing commands
- looks up the full ref name of refs so the name of a branch or tag can be entered (the user can enter "master" instead of "refs/heads/master")
Modified the History Controller to watch for and react to branch filter changes.
The GitX.h file is generated by the 'sdp' tool in a run script build phase called 'Generate Scripting Bridge Header' based on the content of GitX.sdef. It is used by the Scripting Bridge so that other apps (in this case the gitx CLI) can call Applescript commands on GitX in objective-c.
70 lines
2.4 KiB
Objective-C
70 lines
2.4 KiB
Objective-C
/*
|
|
* GitX.h
|
|
*/
|
|
|
|
#import <AppKit/AppKit.h>
|
|
#import <ScriptingBridge/ScriptingBridge.h>
|
|
|
|
|
|
@class GitXApplication, GitXDocument, GitXWindow;
|
|
|
|
|
|
|
|
/*
|
|
* Standard Suite
|
|
*/
|
|
|
|
// The application's top-level scripting object.
|
|
@interface GitXApplication : SBApplication
|
|
|
|
- (SBElementArray *) documents;
|
|
- (SBElementArray *) windows;
|
|
|
|
@property (copy, readonly) NSString *name; // The name of the application.
|
|
@property (readonly) BOOL frontmost; // Is this the active application?
|
|
@property (copy, readonly) NSString *version; // The version number of the application.
|
|
|
|
- (void) open:(NSArray *)x; // Open a document.
|
|
- (void) quit; // Quit the application.
|
|
- (BOOL) exists:(id)x; // Verify that an object exists.
|
|
- (void) showDiff:(NSString *)x; // Show the supplied diff output in a GitX window.
|
|
|
|
@end
|
|
|
|
// A document.
|
|
@interface GitXDocument : SBObject
|
|
|
|
@property (copy, readonly) NSString *name; // Its name.
|
|
@property (copy, readonly) NSURL *file; // Its location on disk, if it has one.
|
|
|
|
- (void) close; // Close a document.
|
|
- (void) delete; // Delete an object.
|
|
- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy an object.
|
|
- (void) moveTo:(SBObject *)to; // Move an object to a new location.
|
|
|
|
@end
|
|
|
|
// A window.
|
|
@interface GitXWindow : SBObject
|
|
|
|
@property (copy, readonly) NSString *name; // The title of the window.
|
|
- (NSInteger) id; // The unique identifier of the window.
|
|
@property NSInteger index; // The index of the window, ordered front to back.
|
|
@property NSRect bounds; // The bounding rectangle of the window.
|
|
@property (readonly) BOOL closeable; // Does the window have a close button?
|
|
@property (readonly) BOOL miniaturizable; // Does the window have a minimize button?
|
|
@property BOOL miniaturized; // Is the window minimized right now?
|
|
@property (readonly) BOOL resizable; // Can the window be resized?
|
|
@property BOOL visible; // Is the window visible right now?
|
|
@property (readonly) BOOL zoomable; // Does the window have a zoom button?
|
|
@property BOOL zoomed; // Is the window zoomed right now?
|
|
@property (copy, readonly) GitXDocument *document; // The document whose contents are displayed in the window.
|
|
|
|
- (void) close; // Close a document.
|
|
- (void) delete; // Delete an object.
|
|
- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy an object.
|
|
- (void) moveTo:(SBObject *)to; // Move an object to a new location.
|
|
|
|
@end
|
|
|