]> git.lyx.org Git - lyx.git/blob - src/update_flags.h
Avoid full metrics computation with Update:FitCursor
[lyx.git] / src / update_flags.h
1 // -*- C++ -*-
2 /**
3  * \file update_flags.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author The Denmark Cowboys
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef UPDATE_FLAGS_H
13 #define UPDATE_FLAGS_H
14
15 namespace lyx {
16
17 namespace Update {
18         enum flags {
19                 /// No screen update is needed.
20                 None = 0,
21                 /// Recenter the screen around the cursor if is found outside the
22                 /// visible area.
23                 FitCursor = 1,
24                 /// Force a full screen metrics update and a full draw.
25                 Force = 2,
26                 /// Force a full redraw (but no metrics computations)
27                 ForceDraw = 4,
28                 /// Try to rebreak only the current paragraph metrics.
29                 SinglePar = 8,
30                 /// Only the inset decorations need to be redrawn, no text metrics
31                 /// update is needed.
32                 Decoration = 16,
33                 /// Force metrics and redraw for all buffers.
34                 ForceAll = 32
35         };
36
37 inline flags operator|(flags const f, flags const g)
38 {
39         return static_cast<flags>(int(f) | int(g));
40 }
41
42 inline flags operator&(flags const f, flags const g)
43 {
44         return static_cast<flags>(int(f) & int(g));
45 }
46
47 inline flags operator~(flags const f)
48 {
49         return static_cast<flags>(~int(f) & 0x3f);
50 }
51
52 } // namespace Update
53
54 } // namespace lyx
55 #endif