summaryrefslogtreecommitdiff
path: root/desktop/selection.h
diff options
context:
space:
mode:
authorAdrian Lees <adrian@aemulor.com>2006-02-15 23:09:55 +0000
committerAdrian Lees <adrian@aemulor.com>2006-02-15 23:09:55 +0000
commitdbfdafdf1820a95995c3b260e147c55125468874 (patch)
tree8ef69f8cbc4733490f82b462edeb167c0ee08fb8 /desktop/selection.h
parent07d55db910095415d15cc2b6509fd44efa79a875 (diff)
downloadnetsurf-dbfdafdf1820a95995c3b260e147c55125468874.tar.gz
netsurf-dbfdafdf1820a95995c3b260e147c55125468874.tar.bz2
[project @ 2006-02-15 23:09:53 by adrianl]
Extend text selection, copying, saving and searching code to handle textplain contents; modified textplain code to accept other line terminators svn path=/import/netsurf/; revision=2081
Diffstat (limited to 'desktop/selection.h')
-rw-r--r--desktop/selection.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/desktop/selection.h b/desktop/selection.h
index 57097f3d0..d0e3af886 100644
--- a/desktop/selection.h
+++ b/desktop/selection.h
@@ -44,8 +44,8 @@ struct selection
};
-typedef bool (*seln_traverse_handler)(struct box *b, int offset,
- size_t length, void *handle);
+typedef bool (*seln_traverse_handler)(const char *text, size_t length,
+ bool space, struct box *box, void *handle);
struct selection *selection_create(struct browser_window *bw);
@@ -70,24 +70,23 @@ void selection_reinit(struct selection *s, struct box *root);
void selection_clear(struct selection *s, bool redraw);
void selection_select_all(struct selection *s);
-void selection_set_start(struct selection *s, struct box *box, int idx);
-void selection_set_end(struct selection *s, struct box *box, int idx);
+void selection_set_start(struct selection *s, unsigned idx);
+void selection_set_end(struct selection *s, unsigned idx);
struct box *selection_get_start(struct selection *s, int *pidx);
struct box *selection_get_end(struct selection *s, int *pidx);
-bool selection_click(struct selection *s, struct box *box, browser_mouse_state mouse,
- int dx, int dy);
-void selection_track(struct selection *s, struct box *box, browser_mouse_state mouse,
- int dx, int dy);
+bool selection_click(struct selection *s, browser_mouse_state mouse, unsigned idx);
+void selection_track(struct selection *s, browser_mouse_state mouse, unsigned idx);
-void selection_drag_end(struct selection *s, struct box *box,
- browser_mouse_state mouse, int dx, int dy);
+/** Handles completion of a drag operation */
+/* void selection_drag_end(struct selection *s); */
+#define selection_drag_end(s) ((s)->drag_state = DRAG_NONE)
bool selection_traverse(struct selection *s, seln_traverse_handler handler,
void *handle);
-bool selection_highlighted(struct selection *s, struct box *box,
+bool selection_highlighted(struct selection *s, unsigned start, unsigned end,
unsigned *start_idx, unsigned *end_idx);
bool selection_save_text(struct selection *s, const char *path);