1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-10-28 12:20:38 +03:00
vimr/SwiftNeoVim/NeoVimUiBridgeProtocol.h

102 lines
2.3 KiB
C
Raw Normal View History

2016-06-04 10:51:57 +03:00
/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
2016-06-19 00:14:49 +03:00
@import Foundation;
2016-06-04 10:51:57 +03:00
typedef NS_ENUM(NSUInteger, FontTrait) {
FontTraitNone = 0,
FontTraitItalic = (1 << 0),
FontTraitBold = (1 << 1),
FontTraitUnderline = (1 << 2),
FontTraitUndercurl = (1 << 3)
};
typedef struct {
FontTrait fontTrait;
unsigned int foreground;
unsigned int background;
unsigned int special;
} CellAttributes;
#define qDefaultForeground 0xFF000000
#define qDefaultBackground 0xFFFFFFFF
#define qDefaultSpecial 0xFFFF0000
@protocol NeoVimUiBridgeProtocol <NSObject>
2016-06-04 10:51:57 +03:00
/**
* NeoVim has set the size of its screen to rows X columns. The view must be resized accordingly.
*/
- (void)resizeToWidth:(int)width height:(int)height;
/**
* Clear the view completely. In subsequent callbacks, eg by put, NeoVim will tell us what to do to completely redraw
* the view.
*/
2016-06-04 20:05:12 +03:00
- (void)clear;
/**
* End of line is met. The view can fill the rest of the line with the background color.
*/
2016-06-04 20:05:12 +03:00
- (void)eolClear;
/**
* Move the current cursor to (row, column). This can mean two things:
* 1. NeoVim wants to put, ie draw, at (row, column) or
* 2. NeoVim wants to put the cursor at (row, column).
* In case of 1. NeoVim will put in subsequent call. In case of 2. NeoVim seems to flush twice in a row.
*/
- (void)cursorGotoRow:(int)row column:(int)column;
2016-06-04 20:05:12 +03:00
- (void)updateMenu;
- (void)busyStart;
- (void)busyStop;
- (void)mouseOn;
- (void)mouseOff;
/**
* Mode changed to mode, cf vim.h.
*/
2016-06-04 10:51:57 +03:00
- (void)modeChange:(int)mode;
- (void)setScrollRegionToTop:(int)top bottom:(int)bottom left:(int)left right:(int)right;
2016-06-04 20:05:12 +03:00
- (void)scroll:(int)count;
- (void)highlightSet:(CellAttributes)attrs;
/**
* Draw string at the current cursor which was set by a previous cursorGotoRow:column callback.
*/
2016-06-04 10:51:57 +03:00
- (void)put:(NSString *)string;
2016-06-04 20:05:12 +03:00
- (void)bell;
- (void)visualBell;
- (void)flush;
/**
2016-06-19 11:07:03 +03:00
* Set the default foreground color.
*/
- (void)updateForeground:(int)fg;
/**
2016-06-19 11:07:03 +03:00
* Set the default background color.
*/
- (void)updateBackground:(int)bg;
2016-06-19 11:07:03 +03:00
/**
* Set the default special color, eg curly underline for spelling errors.
*/
- (void)updateSpecial:(int)sp;
2016-06-04 20:05:12 +03:00
- (void)suspend;
- (void)setTitle:(NSString *)title;
- (void)setIcon:(NSString *)icon;
/**
* NeoVim has been stopped.
*/
2016-06-04 20:05:12 +03:00
- (void)stop;
2016-06-04 10:51:57 +03:00
@end