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"
|
|
|
|
#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;
|
|
|
|
|
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-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;
|
2020-03-22 13:03:34 +00:00
|
|
|
}
|
2020-03-30 07:30:58 +00:00
|
|
|
+(Editor *)withRect:(Rect)rect file:(string)filename;
|
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
|
|
|
|
|
2020-03-29 17:34:08 +00:00
|
|
|
#endif//__qwaq_editor_editor_h
|