mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
16bd047022
This will allow for easy expansion of editor functionality without messing with the editor itself. In particularly, an editor normally doesn't need to know anything about debugger hot keys.
46 lines
1,016 B
Objective-C
46 lines
1,016 B
Objective-C
#ifndef __qwaq_editor_h
|
|
#define __qwaq_editor_h
|
|
|
|
#include "qwaq-editbuffer.h"
|
|
#include "qwaq-view.h"
|
|
|
|
@class Editor;
|
|
@class EditBuffer;
|
|
@class ListenerGroup;
|
|
|
|
// Data sent to onKeyEvent listeners
|
|
typedef struct ed_event_s {
|
|
Editor *editor;
|
|
struct qwaq_event_s *event;
|
|
} ed_event_t;
|
|
|
|
@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
|
|
Point scroll;
|
|
Point cursor;
|
|
unsigned line_count;
|
|
string filename;
|
|
ListenerGroup *onEvent;
|
|
ed_event_t _event;
|
|
}
|
|
-initWithRect:(Rect) rect file:(string) filename;
|
|
-(ListenerGroup *)onEvent;
|
|
-(string)filename;
|
|
-scrollUp:(unsigned) count;
|
|
-scrollDown:(unsigned) count;
|
|
-scrollLeft:(unsigned) count;
|
|
-scrollRight:(unsigned) count;
|
|
|
|
-recenter:(int) force;
|
|
-gotoLine:(unsigned) line;
|
|
-highlightLine;
|
|
@end
|
|
|
|
#endif//__qwaq_editor_h
|