2020-03-29 17:34:08 +00:00
|
|
|
#ifndef __qwaq_editor_editor_h
|
|
|
|
#define __qwaq_editor_editor_h
|
2020-03-22 13:03:34 +00:00
|
|
|
|
2020-06-21 14:15:17 +00:00
|
|
|
#include "ruamoko/qwaq/editor/editbuffer.h"
|
2021-06-10 03:13:55 +00:00
|
|
|
#include "ruamoko/qwaq/editor/status.h"
|
2020-06-21 14:15:17 +00:00
|
|
|
#include "ruamoko/qwaq/ui/view.h"
|
2020-03-22 13:03:34 +00:00
|
|
|
|
2020-03-25 00:22:54 +00:00
|
|
|
@class Editor;
|
2020-03-22 13:03:34 +00:00
|
|
|
@class EditBuffer;
|
2020-03-25 00:22:54 +00:00
|
|
|
@class ListenerGroup;
|
2021-06-10 03:13:55 +00:00
|
|
|
@class EditStatus;
|
2020-03-25 00:22:54 +00:00
|
|
|
|
2020-03-22 13:03:34 +00:00
|
|
|
@interface Editor : View
|
|
|
|
{
|
|
|
|
EditBuffer *buffer;
|
2021-06-10 03:13:55 +00:00
|
|
|
EditStatus *status;
|
2020-03-22 13:03:34 +00:00
|
|
|
DrawBuffer *linebuffer;
|
|
|
|
eb_sel_t selection;
|
|
|
|
unsigned base_index; // top left corner
|
|
|
|
unsigned line_index; // current line
|
|
|
|
unsigned char_index; // current character
|
|
|
|
unsigned old_cind; // previous character
|
2020-03-31 02:21:47 +00:00
|
|
|
Point base;
|
2020-03-22 13:03:34 +00:00
|
|
|
Point cursor;
|
|
|
|
unsigned line_count;
|
2020-03-24 16:07:58 +00:00
|
|
|
string filename;
|
2021-06-08 07:50:30 +00:00
|
|
|
string filepath;
|
2021-06-10 03:13:55 +00:00
|
|
|
int modified;
|
|
|
|
CursorMode cursorMode;
|
|
|
|
|
|
|
|
int virtualInsert;
|
|
|
|
int cursorThroughTabs;
|
2020-03-22 13:03:34 +00:00
|
|
|
}
|
2020-03-30 07:30:58 +00:00
|
|
|
+(Editor *)withRect:(Rect)rect file:(string)filename;
|
2021-06-08 07:50:30 +00:00
|
|
|
+(Editor *)withRect:(Rect)rect file:(string)filename path:(string)filepath;
|
2020-03-24 16:07:58 +00:00
|
|
|
-(string)filename;
|
2021-06-08 07:50:30 +00:00
|
|
|
-(string)filepath;
|
|
|
|
-(Point)cursor;
|
2021-06-10 03:13:55 +00:00
|
|
|
-setStatusView:(EditStatus *)status;
|
2020-03-22 13:42:56 +00:00
|
|
|
-scrollLeft:(unsigned) count;
|
|
|
|
-scrollRight:(unsigned) count;
|
2021-06-10 03:13:55 +00:00
|
|
|
-pageUp;
|
|
|
|
-pageDown;
|
2021-06-11 14:34:43 +00:00
|
|
|
-linesUp;
|
|
|
|
-linesDown;
|
2021-06-10 03:13:55 +00:00
|
|
|
-charUp;
|
|
|
|
-charDown;
|
|
|
|
-charLeft;
|
|
|
|
-charRight;
|
2021-06-11 01:14:07 +00:00
|
|
|
-wordLeft;
|
|
|
|
-wordRight;
|
2021-06-11 14:34:43 +00:00
|
|
|
-moveBOT;
|
|
|
|
-moveEOT;
|
|
|
|
-moveBOS;
|
|
|
|
-moveEOS;
|
2021-06-10 05:29:32 +00:00
|
|
|
-moveBOL;
|
|
|
|
-moveEOL;
|
2020-03-24 23:28:12 +00:00
|
|
|
|
|
|
|
-recenter:(int) force;
|
|
|
|
-gotoLine:(unsigned) line;
|
|
|
|
-highlightLine;
|
2020-03-25 08:29:08 +00:00
|
|
|
-(string)getWordAt:(Point) pos; // view relative coordinates
|
2020-03-22 13:03:34 +00:00
|
|
|
@end
|
|
|
|
|
2020-03-29 17:34:08 +00:00
|
|
|
#endif//__qwaq_editor_editor_h
|