mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
2572011a4b
The editor now uses the vertical scrollbar for handling mouse wheel scrolling, thus keeping the scrollbar in sync. Scrollbar index can now cover the full range (not sure why I had that -1), and the potential divide by zero is avoided properly. Thumb-tab now positioned properly when the range is 0.
65 lines
1.4 KiB
Objective-C
65 lines
1.4 KiB
Objective-C
#ifndef __qwaq_editor_editor_h
|
|
#define __qwaq_editor_editor_h
|
|
|
|
#include "ruamoko/qwaq/editor/editbuffer.h"
|
|
#include "ruamoko/qwaq/editor/status.h"
|
|
#include "ruamoko/qwaq/ui/view.h"
|
|
|
|
@class Editor;
|
|
@class EditBuffer;
|
|
@class ListenerGroup;
|
|
@class EditStatus;
|
|
|
|
@interface Editor : View
|
|
{
|
|
EditBuffer *buffer;
|
|
EditStatus *status;
|
|
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
|
|
Point base;
|
|
Point cursor;
|
|
unsigned line_count;
|
|
string filename;
|
|
string filepath;
|
|
int modified;
|
|
CursorMode cursorMode;
|
|
|
|
int virtualInsert;
|
|
int cursorThroughTabs;
|
|
}
|
|
+(Editor *)withRect:(Rect)rect file:(string)filename;
|
|
+(Editor *)withRect:(Rect)rect file:(string)filename path:(string)filepath;
|
|
-(string)filename;
|
|
-(string)filepath;
|
|
-(Point)cursor;
|
|
-setStatusView:(EditStatus *)status;
|
|
-scrollLeft:(unsigned) count;
|
|
-scrollRight:(unsigned) count;
|
|
-pageUp;
|
|
-pageDown;
|
|
-linesUp;
|
|
-linesDown;
|
|
-charUp;
|
|
-charDown;
|
|
-charLeft;
|
|
-charRight;
|
|
-wordLeft;
|
|
-wordRight;
|
|
-moveBOT;
|
|
-moveEOT;
|
|
-moveBOS;
|
|
-moveEOS;
|
|
-moveBOL;
|
|
-moveEOL;
|
|
|
|
-recenter:(int) force;
|
|
-gotoLine:(unsigned) line;
|
|
-highlightLine;
|
|
-(string)getWordAt:(Point) pos; // view relative coordinates
|
|
@end
|
|
|
|
#endif//__qwaq_editor_editor_h
|