~ubuntu-branches/ubuntu/utopic/geany/utopic

« back to all changes in this revision

Viewing changes to scintilla/DocumentAccessor.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 DocumentAccessor.h
3
 
 ** Implementation of BufferAccess and StylingAccess on a Scintilla
4
 
 ** rapid easy access to contents of a Scintilla.
5
 
 **/
6
 
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
7
 
// The License.txt file describes the conditions under which this software may be distributed.
8
 
 
9
 
#ifdef SCI_NAMESPACE
10
 
namespace Scintilla {
11
 
#endif
12
 
 
13
 
class Document;
14
 
 
15
 
/**
16
 
 */
17
 
 
18
 
class DocumentAccessor : public Accessor {
19
 
        // Private so DocumentAccessor objects can not be copied
20
 
        DocumentAccessor(const DocumentAccessor &source);
21
 
        DocumentAccessor &operator=(const DocumentAccessor &);
22
 
 
23
 
protected:
24
 
        Document *pdoc;
25
 
        PropertyGet &props;
26
 
        WindowID id;
27
 
        int lenDoc;
28
 
 
29
 
        char styleBuf[bufferSize];
30
 
        int validLen;
31
 
        char chFlags;
32
 
        char chWhile;
33
 
        unsigned int startSeg;
34
 
        int startPosStyling;
35
 
        int mask;
36
 
 
37
 
        bool InternalIsLeadByte(char ch);
38
 
        void Fill(int position);
39
 
 
40
 
public:
41
 
        DocumentAccessor(Document *pdoc_, PropertyGet &props_, WindowID id_=0) :
42
 
                Accessor(), pdoc(pdoc_), props(props_), id(id_),
43
 
                lenDoc(-1), validLen(0), chFlags(0), chWhile(0),
44
 
                startSeg(0), startPosStyling(0),
45
 
                mask(127) { // Initialize the mask to be big enough for any lexer.
46
 
        }
47
 
        ~DocumentAccessor();
48
 
        bool Match(int pos, const char *s);
49
 
        char StyleAt(int position);
50
 
        int GetLine(int position);
51
 
        int LineStart(int line);
52
 
        int LevelAt(int line);
53
 
        int Length();
54
 
        void Flush();
55
 
        int GetLineState(int line);
56
 
        int SetLineState(int line, int state);
57
 
        int GetPropertyInt(const char *key, int defaultValue=0) {
58
 
                return props.GetInt(key, defaultValue);
59
 
        }
60
 
        char *GetProperties() {
61
 
                return props.ToString();
62
 
        }
63
 
        WindowID GetWindow() { return id; }
64
 
 
65
 
        void StartAt(unsigned int start, char chMask=31);
66
 
        void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; }
67
 
        unsigned int GetStartSegment() { return startSeg; }
68
 
        void StartSegment(unsigned int pos);
69
 
        void ColourTo(unsigned int pos, int chAttr);
70
 
        void SetLevel(int line, int level);
71
 
        int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);
72
 
        void IndicatorFill(int start, int end, int indicator, int value);
73
 
};
74
 
 
75
 
#ifdef SCI_NAMESPACE
76
 
}
77
 
#endif