diff options
author | Adrian Lees <adrian@aemulor.com> | 2009-02-02 00:06:31 +0000 |
---|---|---|
committer | Adrian Lees <adrian@aemulor.com> | 2009-02-02 00:06:31 +0000 |
commit | 15e8ba0270fac14839fd4dda65418904bfd0c880 (patch) | |
tree | 3967ca33f543add1b7b838486092381460e1260b /desktop/selection.c | |
parent | a15d9876caa4a0b3a31f1c7fafb724be984d95fb (diff) | |
download | netsurf-15e8ba0270fac14839fd4dda65418904bfd0c880.tar.gz netsurf-15e8ba0270fac14839fd4dda65418904bfd0c880.tar.bz2 |
Selection menu and save/download tweaks
svn path=/trunk/netsurf/; revision=6349
Diffstat (limited to 'desktop/selection.c')
-rw-r--r-- | desktop/selection.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/desktop/selection.c b/desktop/selection.c index 9140ebbf0..0d45f1720 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -134,7 +134,8 @@ void selection_reinit(struct selection *s, struct box *root) if (IS_INPUT(root)) { static int next_idx = 0; - root_idx = (next_idx++) << 28; + if (!++next_idx) next_idx = 1; + root_idx = next_idx << 28; } else root_idx = 0; @@ -192,6 +193,20 @@ void selection_init(struct selection *s, struct box *root) /** + * Indicate whether the selected text is read only, ie. cannot be modified. + * + * \param s selection object + * \return true iff the selection is read only + */ + +bool selection_read_only(struct selection *s) +{ + return !s->root || !NUMBER_SPACE(s->root->byte_offset); + +} + + +/** * Label each text box in the given box subtree with its position * in a textual representation of the content. * |