aboutsummaryrefslogtreecommitdiff
path: root/src/frame.h
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2017-01-25 00:01:45 +0100
committerThomas White <taw@bitwiz.org.uk>2017-01-25 00:11:37 +0100
commitc921eed7f3a10b6e403d5d5863df82c652ca5db9 (patch)
tree1dafdca921ff731f43b6049a97656713cc7d7cfe /src/frame.h
parentd6afe0601a4d3e35ab492074b7fcde5bfec70875 (diff)
Implement text selection
Diffstat (limited to 'src/frame.h')
-rw-r--r--src/frame.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/frame.h b/src/frame.h
index 4f8be33..787a2ec 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1,7 +1,7 @@
/*
* frame.h
*
- * Copyright © 2013-2016 Thomas White <taw@bitwiz.org.uk>
+ * Copyright © 2013-2017 Thomas White <taw@bitwiz.org.uk>
*
* This file is part of Colloquium.
*
@@ -58,6 +58,15 @@ enum para_type
typedef struct _paragraph Paragraph;
+
+struct edit_pos
+{
+ int para;
+ size_t pos;
+ int trail;
+};
+
+
struct frame
{
struct frame **children;
@@ -135,13 +144,19 @@ extern void add_image_para(struct frame *fr, SCBlock *scblock,
const char *filename,
double w, double h, int editable);
-extern void wrap_paragraph(Paragraph *para, PangoContext *pc, double w);
+extern void wrap_paragraph(Paragraph *para, PangoContext *pc, double w,
+ size_t sel_start, size_t sel_end);
extern size_t end_offset_of_para(struct frame *fr, int pn);
extern int find_cursor(struct frame *fr, double x, double y,
int *ppara, size_t *ppos, int *ptrail);
+extern int find_cursor_2(struct frame *fr, double x, double y,
+ struct edit_pos *pos);
+
+extern void sort_positions(struct edit_pos *a, struct edit_pos *b);
+
extern int get_para_highlight(struct frame *fr, int cursor_para,
double *cx, double *cy, double *cw, double *ch);