2020-03-22 13:03:34 +00:00
|
|
|
#ifndef __qwaq_editor_h
|
|
|
|
#define __qwaq_editor_h
|
|
|
|
|
|
|
|
#include "qwaq-editbuffer.h"
|
|
|
|
#include "qwaq-view.h"
|
|
|
|
|
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;
|
|
|
|
|
2020-03-22 13:03:34 +00:00
|
|
|
@interface Editor : View
|
|
|
|
{
|
|
|
|
EditBuffer *buffer;
|
|
|
|
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-24 23:28:12 +00:00
|
|
|
Point scroll;
|
2020-03-22 13:03:34 +00:00
|
|
|
Point cursor;
|
|
|
|
unsigned line_count;
|
2020-03-24 16:07:58 +00:00
|
|
|
string filename;
|
2020-03-25 00:22:54 +00:00
|
|
|
ListenerGroup *onEvent;
|
2020-03-22 13:03:34 +00:00
|
|
|
}
|
|
|
|
-initWithRect:(Rect) rect file:(string) filename;
|
2020-03-25 00:22:54 +00:00
|
|
|
-(ListenerGroup *)onEvent;
|
2020-03-24 16:07:58 +00:00
|
|
|
-(string)filename;
|
2020-03-22 13:42:56 +00:00
|
|
|
-scrollUp:(unsigned) count;
|
|
|
|
-scrollDown:(unsigned) count;
|
|
|
|
-scrollLeft:(unsigned) count;
|
|
|
|
-scrollRight:(unsigned) count;
|
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
|
|
|
|
|
|
|
|
#endif//__qwaq_editor_h
|