summaryrefslogtreecommitdiff
path: root/desktop/selection.c
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/selection.c')
-rw-r--r--desktop/selection.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/desktop/selection.c b/desktop/selection.c
index 06cfdae8f..4d3d335ef 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -45,6 +45,26 @@ struct selection_string {
};
+typedef enum {
+ DRAG_NONE,
+ DRAG_START,
+ DRAG_END
+} seln_drag_state;
+
+struct selection {
+ struct content *c;
+ struct box *root;
+
+ unsigned max_idx; /* total bytes in text representation */
+
+ unsigned start_idx; /* offset in bytes within text representation */
+ unsigned end_idx;
+
+ bool defined;
+
+ seln_drag_state drag_state;
+};
+
/**
* Redraws the given range of text.
*
@@ -236,7 +256,6 @@ struct selection *selection_create(struct content *c)
sel = calloc(1, sizeof(struct selection));
if (sel) {
selection_prepare(sel, c);
- selection_init(sel);
}
return sel;