~ubuntu-branches/ubuntu/raring/geany/raring-proposed

« back to all changes in this revision

Viewing changes to scintilla/src/ContractionState.h

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2011-12-10 07:43:26 UTC
  • mfrom: (3.3.7 sid)
  • Revision ID: package-import@ubuntu.com-20111210074326-s8yqbew5i20h33tf
Tags: 0.21-1ubuntu1
* Merge from Debian Unstable, remaining changes:
  - debian/patches/20_use_evince_viewer.patch:
     + use evince as viewer for pdf and dvi files
  - debian/patches/20_use_x_terminal_emulator.patch:
     + use x-terminal-emulator as terminal
  - debian/control
     + Add breaks on geany-plugins-common << 0.20
* Also fixes bugs:
  - Filter for MATLAB/Octave files filters everythign (LP: 885505)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Scintilla source code edit control
 
2
/** @file ContractionState.h
 
3
 ** Manages visibility of lines for folding and wrapping.
 
4
 **/
 
5
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
 
6
// The License.txt file describes the conditions under which this software may be distributed.
 
7
 
 
8
#ifndef CONTRACTIONSTATE_H
 
9
#define CONTRACTIONSTATE_H
 
10
 
 
11
#ifdef SCI_NAMESPACE
 
12
namespace Scintilla {
 
13
#endif
 
14
 
 
15
/**
 
16
 */
 
17
class ContractionState {
 
18
        // These contain 1 element for every document line.
 
19
        RunStyles *visible;
 
20
        RunStyles *expanded;
 
21
        RunStyles *heights;
 
22
        Partitioning *displayLines;
 
23
        int linesInDocument;
 
24
 
 
25
        void EnsureData();
 
26
 
 
27
        bool OneToOne() const {
 
28
                // True when each document line is exactly one display line so need for
 
29
                // complex data structures.
 
30
                return visible == 0;
 
31
        }
 
32
 
 
33
public:
 
34
        ContractionState();
 
35
        virtual ~ContractionState();
 
36
 
 
37
        void Clear();
 
38
 
 
39
        int LinesInDoc() const;
 
40
        int LinesDisplayed() const;
 
41
        int DisplayFromDoc(int lineDoc) const;
 
42
        int DocFromDisplay(int lineDisplay) const;
 
43
 
 
44
        void InsertLine(int lineDoc);
 
45
        void InsertLines(int lineDoc, int lineCount);
 
46
        void DeleteLine(int lineDoc);
 
47
        void DeleteLines(int lineDoc, int lineCount);
 
48
 
 
49
        bool GetVisible(int lineDoc) const;
 
50
        bool SetVisible(int lineDocStart, int lineDocEnd, bool visible);
 
51
 
 
52
        bool GetExpanded(int lineDoc) const;
 
53
        bool SetExpanded(int lineDoc, bool expanded);
 
54
        int ContractedNext(int lineDocStart) const;
 
55
 
 
56
        int GetHeight(int lineDoc) const;
 
57
        bool SetHeight(int lineDoc, int height);
 
58
 
 
59
        void ShowAll();
 
60
        void Check() const;
 
61
};
 
62
 
 
63
#ifdef SCI_NAMESPACE
 
64
}
 
65
#endif
 
66
 
 
67
#endif