diff options
Diffstat (limited to 'src/user/include/cxx/raleigh/w/entry.h')
-rw-r--r-- | src/user/include/cxx/raleigh/w/entry.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/user/include/cxx/raleigh/w/entry.h b/src/user/include/cxx/raleigh/w/entry.h index 7ea2973..fcae122 100644 --- a/src/user/include/cxx/raleigh/w/entry.h +++ b/src/user/include/cxx/raleigh/w/entry.h @@ -12,10 +12,13 @@ namespace raleigh { const char *font="fixed-10", _pixel_t bg=RGB(ff, ff, ff), _pixel_t fg=RGB(00, 00, 00), _pixel_t border_color=RGB(00, 00, 00)); - void notify_window_change(); - void paint(_pixel_t *pixbuf, uint32_t pitch); - bool try_handle_click(coord window_coords, enum mouse_packet::mouse_button click_type, bool up); - void notify_has_opaque_parent(widget *parent); + void notify_window_change() override; + void paint(_pixel_t *pixbuf, uint32_t pitch) override; + void handle_click(coord window_coords, enum mouse_packet::mouse_button click_type, bool up) override; + void notify_has_opaque_parent(widget *parent) override; + void handle_key(struct key_packet kp) override; + void on_focus() override; + void on_unfocus() override; private: uint32_t rows; uint32_t cols; @@ -40,12 +43,26 @@ namespace raleigh { uint32_t end_d; bool first_paint; + bool has_focus; + bool had_focus_last_paint; bool text_changed_since_last_paint; uint32_t cur_y_last_paint; uint32_t cur_x_last_paint; uint32_t cur_d_last_paint; + //uses cur_x, not cur_d; sets both + //will not modify cur_y + void ensure_cursor_in_line(); + void paint_text(_pixel_t *pixbuf, uint32_t pitch); + //sets line_indices[from_y + 1 .. end_y + 1], end_y, end_x and end_d + void get_indices(uint32_t from_y, uint32_t from_x, uint32_t from_d); + + //these four return true on success, and do not send a paint request to the window + bool cursor_left(); + bool cursor_right(); + bool cursor_up(); + bool cursor_down(); }; } |